Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
590f0a46
Commit
590f0a46
authored
Mar 12, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X neo/py uses n(replica) as n(real-replica) - 1
parent
ca0c734d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
9 deletions
+13
-9
go/neo/cluster_test.go
go/neo/cluster_test.go
+3
-3
go/neo/master.go
go/neo/master.go
+1
-1
go/neo/nodetab.go
go/neo/nodetab.go
+2
-1
go/neo/storage.go
go/neo/storage.go
+3
-2
go/neo/storage/sqlite/sqlite.go
go/neo/storage/sqlite/sqlite.go
+1
-1
go/neo/t/neotest
go/neo/t/neotest
+3
-1
No files found.
go/neo/cluster_test.go
View file @
590f0a46
...
...
@@ -621,7 +621,7 @@ func TestMasterStorage(t *testing.T) {
NodeType
:
proto
.
MASTER
,
MyUUID
:
proto
.
UUID
(
proto
.
MASTER
,
1
),
NumPartitions
:
1
,
NumReplicas
:
1
,
NumReplicas
:
0
,
YourUUID
:
proto
.
UUID
(
proto
.
STORAGE
,
1
),
}))
...
...
@@ -735,7 +735,7 @@ func TestMasterStorage(t *testing.T) {
NodeType
:
proto
.
MASTER
,
MyUUID
:
proto
.
UUID
(
proto
.
MASTER
,
1
),
NumPartitions
:
1
,
NumReplicas
:
1
,
NumReplicas
:
0
,
YourUUID
:
proto
.
UUID
(
proto
.
CLIENT
,
1
),
}))
...
...
@@ -819,7 +819,7 @@ func TestMasterStorage(t *testing.T) {
NodeType
:
proto
.
STORAGE
,
MyUUID
:
proto
.
UUID
(
proto
.
STORAGE
,
1
),
NumPartitions
:
1
,
NumReplicas
:
1
,
NumReplicas
:
0
,
YourUUID
:
proto
.
UUID
(
proto
.
CLIENT
,
1
),
}))
...
...
go/neo/master.go
View file @
590f0a46
...
...
@@ -1082,7 +1082,7 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (node *Node, resp pro
NodeType
:
proto
.
MASTER
,
MyUUID
:
m
.
node
.
MyInfo
.
UUID
,
NumPartitions
:
1
,
// FIXME hardcoded
NumReplicas
:
1
,
// FIXME hardcoded
NumReplicas
:
0
,
// FIXME hardcoded (neo/py meaning for n(replica) is `n(real-replica) - 1`)
YourUUID
:
uuid
,
}
...
...
go/neo/nodetab.go
View file @
590f0a46
...
...
@@ -346,7 +346,8 @@ func (p *Node) dial(ctx context.Context) (_ *neonet.NodeLink, err error) {
case
accept
.
YourUUID
!=
app
.
MyInfo
.
UUID
:
err
=
fmt
.
Errorf
(
"connected, but peer gives us uuid %v (our is %v)"
,
accept
.
YourUUID
,
app
.
MyInfo
.
UUID
)
case
!
(
accept
.
NumPartitions
==
1
&&
accept
.
NumReplicas
==
1
)
:
// XXX NumReplicas: neo/py meaning for n(replica) = `n(real-replica) - 1`
case
!
(
accept
.
NumPartitions
==
1
&&
accept
.
NumReplicas
==
0
)
:
err
=
fmt
.
Errorf
(
"connected but TODO peer works with !1x1 partition table."
)
}
...
...
go/neo/storage.go
View file @
590f0a46
...
...
@@ -202,7 +202,8 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
// XXX add master UUID -> nodeTab ? or master will notify us with it himself ?
if
!
(
accept
.
NumPartitions
==
1
&&
accept
.
NumReplicas
==
1
)
{
// NumReplicas: neo/py meaning for n(replica) = `n(real-replica) - 1`
if
!
(
accept
.
NumPartitions
==
1
&&
accept
.
NumReplicas
==
0
)
{
return
fmt
.
Errorf
(
"TODO for 1-storage POC: Npt: %v Nreplica: %v"
,
accept
.
NumPartitions
,
accept
.
NumReplicas
)
}
...
...
@@ -411,7 +412,7 @@ func (stor *Storage) identify(idReq *proto.RequestIdentification) (proto.Msg, bo
NodeType
:
stor
.
node
.
MyInfo
.
Type
,
MyUUID
:
stor
.
node
.
MyInfo
.
UUID
,
// XXX lock wrt update
NumPartitions
:
1
,
// XXX
NumReplicas
:
1
,
// XXX
NumReplicas
:
0
,
// XXX
YourUUID
:
idReq
.
UUID
,
},
true
}
...
...
go/neo/storage/sqlite/sqlite.go
View file @
590f0a46
...
...
@@ -463,7 +463,7 @@ func openURL(ctx context.Context, u *url.URL) (_ storage.Backend, err error) {
checkConfig
(
"version"
,
schemaVersion
)
checkConfig
(
"nid"
,
int
(
proto
.
UUID
(
proto
.
STORAGE
,
1
)))
checkConfig
(
"partitions"
,
1
)
checkConfig
(
"replicas"
,
1
)
checkConfig
(
"replicas"
,
0
)
// XXX neo/py uses nreplicas as 1 + n(replica
)
err
=
errv
.
Err
()
if
err
!=
nil
{
...
...
go/neo/t/neotest
View file @
590f0a46
...
...
@@ -266,8 +266,10 @@ neopy_log() {
# M{py,go} ... - spawn master
Mpy
()
{
# --autostart=1
# XXX neo/py meaning for --replicas is `n(real-replica) - 1`
exec
-a
Mpy
\
neomaster
--cluster
=
$neocluster
--bind
=
$Mbind
--masters
=
$Mbind
-r
1
-p
1
`
neopy_log Mpy
`
"
$@
"
&
neomaster
--cluster
=
$neocluster
--bind
=
$Mbind
--masters
=
$Mbind
\
--replicas
0
--partitions
1
`
neopy_log Mpy
`
"
$@
"
&
}
Mgo
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment