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
d31f1348
Commit
d31f1348
authored
Jun 13, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7f7e2a02
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
16 deletions
+63
-16
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+62
-15
go/neo/server/master.go
go/neo/server/master.go
+1
-1
No files found.
go/neo/server/cluster_test.go
View file @
d31f1348
...
...
@@ -54,34 +54,81 @@ func TestMasterStorage(t *testing.T) {
Maddr
:=
"0"
Saddr
:=
"1"
wg
:=
&
xsync
.
WorkGroup
{}
// start master
M
:=
NewMaster
(
"abc1"
,
Maddr
,
net
)
Mctx
,
Mcancel
:=
context
.
WithCancel
(
context
.
Background
())
wg
.
Gox
(
func
()
{
err
:=
M
.
Run
(
Mctx
)
_
=
err
// XXX
})
// expect:
// M.clusterState <- RECOVERY
// M.nodeTab <- Node(M)
// start storage
zstor
:=
xfs1stor
(
"../../zodb/storage/fs1/testdata/1.fs"
)
S
:=
NewStorage
(
"abc1"
,
Maddr
,
Saddr
,
net
,
zstor
)
Mctx
,
Mcancel
:=
context
.
WithCancel
(
context
.
Background
())
Sctx
,
Scancel
:=
context
.
WithCancel
(
context
.
Background
())
_
=
Scancel
;
//Mev := M.subscribe(...)
wg
:=
&
xsync
.
WorkGroup
{}
wg
.
Gox
(
func
()
{
err
:=
M
.
Run
(
M
ctx
)
err
:=
S
.
Run
(
S
ctx
)
_
=
err
// XXX
})
//ev <- Mev
//assert ev == ClusterInformation{State: RECOVERY}
// expect:
// M <- S .? RequestIdentification{...} + TODO test ID rejects
// M -> S .? AcceptIdentification{...}
// M.nodeTab <- Node(S) XXX order can be racy?
// S.nodeTab <- Node(M) XXX order can be racy?
//
// ; storCtlRecovery
// M -> S .? Recovery
// S <- M .? AnswerRecovery
//
// M -> S .? AskPartitionTable
// S <- M .? AnswerPartitionTable
// M.partTab <- ... XXX
// XXX updated something cluster currently can be operational
err
:=
M
.
Start
()
exc
.
Raiseif
(
err
)
if
false
{
err
:=
S
.
Run
(
Sctx
)
// XXX go
_
=
err
}
// expect:
// M.clusterState <- VERIFICATION + TODO it should be sent to S
// M -> S .? LockedTransactions{}
// M <- S .? AnswerLockedTransactions{...}
// M -> S .? LastIDs{}
// M <- S .? AnswerLastIDs{...}
// + TODO S leave at verify
// + TODO S join at verify
// + TODO M.Stop() while verify
// expect:
// M.clusterState <- RUNNING + TODO it should be sent to S
// + TODO S leave while service
// + TODO S join while service
// + TODO M.Stop while service
// + TODO Client connects here ?
// TODO S.Stop() or Scancel()
// expect:
// M.nodeTab -= S
// M.clusterState <- RECOVERY
// ...
// TODO Scancel -> S down - test how M behaves
// TODO test M.recovery starting back from verification/service
// (M needs to resend to all storages recovery messages just from start)
xwait
(
wg
)
Mcancel
()
// XXX temp
Scancel
()
// XXX temp
}
// basic interaction between Client -- Storage
...
...
go/neo/server/master.go
View file @
d31f1348
...
...
@@ -428,7 +428,7 @@ loop:
// check partTab is still operational
// if not -> cancel to go back to recovery
if
m
.
partTab
.
OperationalWith
(
&
m
.
nodeTab
)
{
if
!
m
.
partTab
.
OperationalWith
(
&
m
.
nodeTab
)
{
vcancel
()
err
=
errClusterDegraded
break
loop
...
...
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