Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
590f0a46
Commit
590f0a46
authored
Mar 12, 2018
by
Kirill Smelkov
1
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
Hide 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) {
...
@@ -621,7 +621,7 @@ func TestMasterStorage(t *testing.T) {
NodeType
:
proto
.
MASTER
,
NodeType
:
proto
.
MASTER
,
MyUUID
:
proto
.
UUID
(
proto
.
MASTER
,
1
),
MyUUID
:
proto
.
UUID
(
proto
.
MASTER
,
1
),
NumPartitions
:
1
,
NumPartitions
:
1
,
NumReplicas
:
1
,
NumReplicas
:
0
,
YourUUID
:
proto
.
UUID
(
proto
.
STORAGE
,
1
),
YourUUID
:
proto
.
UUID
(
proto
.
STORAGE
,
1
),
}))
}))
...
@@ -735,7 +735,7 @@ func TestMasterStorage(t *testing.T) {
...
@@ -735,7 +735,7 @@ func TestMasterStorage(t *testing.T) {
NodeType
:
proto
.
MASTER
,
NodeType
:
proto
.
MASTER
,
MyUUID
:
proto
.
UUID
(
proto
.
MASTER
,
1
),
MyUUID
:
proto
.
UUID
(
proto
.
MASTER
,
1
),
NumPartitions
:
1
,
NumPartitions
:
1
,
NumReplicas
:
1
,
NumReplicas
:
0
,
YourUUID
:
proto
.
UUID
(
proto
.
CLIENT
,
1
),
YourUUID
:
proto
.
UUID
(
proto
.
CLIENT
,
1
),
}))
}))
...
@@ -819,7 +819,7 @@ func TestMasterStorage(t *testing.T) {
...
@@ -819,7 +819,7 @@ func TestMasterStorage(t *testing.T) {
NodeType
:
proto
.
STORAGE
,
NodeType
:
proto
.
STORAGE
,
MyUUID
:
proto
.
UUID
(
proto
.
STORAGE
,
1
),
MyUUID
:
proto
.
UUID
(
proto
.
STORAGE
,
1
),
NumPartitions
:
1
,
NumPartitions
:
1
,
NumReplicas
:
1
,
NumReplicas
:
0
,
YourUUID
:
proto
.
UUID
(
proto
.
CLIENT
,
1
),
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
...
@@ -1082,7 +1082,7 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (node *Node, resp pro
NodeType
:
proto
.
MASTER
,
NodeType
:
proto
.
MASTER
,
MyUUID
:
m
.
node
.
MyInfo
.
UUID
,
MyUUID
:
m
.
node
.
MyInfo
.
UUID
,
NumPartitions
:
1
,
// FIXME hardcoded
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
,
YourUUID
:
uuid
,
}
}
...
...
go/neo/nodetab.go
View file @
590f0a46
...
@@ -346,7 +346,8 @@ func (p *Node) dial(ctx context.Context) (_ *neonet.NodeLink, err error) {
...
@@ -346,7 +346,8 @@ func (p *Node) dial(ctx context.Context) (_ *neonet.NodeLink, err error) {
case
accept
.
YourUUID
!=
app
.
MyInfo
.
UUID
:
case
accept
.
YourUUID
!=
app
.
MyInfo
.
UUID
:
err
=
fmt
.
Errorf
(
"connected, but peer gives us uuid %v (our is %v)"
,
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."
)
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) {
...
@@ -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 ?
// 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
)
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
...
@@ -411,7 +412,7 @@ func (stor *Storage) identify(idReq *proto.RequestIdentification) (proto.Msg, bo
NodeType
:
stor
.
node
.
MyInfo
.
Type
,
NodeType
:
stor
.
node
.
MyInfo
.
Type
,
MyUUID
:
stor
.
node
.
MyInfo
.
UUID
,
// XXX lock wrt update
MyUUID
:
stor
.
node
.
MyInfo
.
UUID
,
// XXX lock wrt update
NumPartitions
:
1
,
// XXX
NumPartitions
:
1
,
// XXX
NumReplicas
:
1
,
// XXX
NumReplicas
:
0
,
// XXX
YourUUID
:
idReq
.
UUID
,
YourUUID
:
idReq
.
UUID
,
},
true
},
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) {
...
@@ -463,7 +463,7 @@ func openURL(ctx context.Context, u *url.URL) (_ storage.Backend, err error) {
checkConfig
(
"version"
,
schemaVersion
)
checkConfig
(
"version"
,
schemaVersion
)
checkConfig
(
"nid"
,
int
(
proto
.
UUID
(
proto
.
STORAGE
,
1
)))
checkConfig
(
"nid"
,
int
(
proto
.
UUID
(
proto
.
STORAGE
,
1
)))
checkConfig
(
"partitions"
,
1
)
checkConfig
(
"partitions"
,
1
)
checkConfig
(
"replicas"
,
1
)
checkConfig
(
"replicas"
,
0
)
// XXX neo/py uses nreplicas as 1 + n(replica
)
err
=
errv
.
Err
()
err
=
errv
.
Err
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
go/neo/t/neotest
View file @
590f0a46
...
@@ -266,8 +266,10 @@ neopy_log() {
...
@@ -266,8 +266,10 @@ neopy_log() {
# M{py,go} ... - spawn master
# M{py,go} ... - spawn master
Mpy
()
{
Mpy
()
{
# --autostart=1
# --autostart=1
# XXX neo/py meaning for --replicas is `n(real-replica) - 1`
exec
-a
Mpy
\
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
()
{
Mgo
()
{
...
...
Kirill Smelkov
@kirr
mentioned in commit
3f578560
·
Jul 12, 2018
mentioned in commit
3f578560
mentioned in commit 3f578560c49222cf4b0f8ba2b408d3db9c94444d
Toggle commit list
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