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
40410799
Commit
40410799
authored
Aug 16, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X recovery: on startup S PENDING -> RUNNING
parent
ca0ffd62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+12
-6
go/neo/server/master.go
go/neo/server/master.go
+15
-1
go/xcommon/xtesting/xtesting.go
go/xcommon/xtesting/xtesting.go
+1
-0
No files found.
go/neo/server/cluster_test.go
View file @
40410799
...
...
@@ -211,14 +211,14 @@ func TestMasterStorage(t *testing.T) {
Mhost
:=
xnet
.
NetTrace
(
net
.
Host
(
"m"
),
tracer
)
Shost
:=
xnet
.
NetTrace
(
net
.
Host
(
"s"
),
tracer
)
wg
:=
&
xsync
.
WorkGroup
{}
g
wg
:=
&
xsync
.
WorkGroup
{}
// start master
Mclock
:=
&
vclock
{}
M
:=
NewMaster
(
"abc1"
,
":1"
,
Mhost
)
M
.
monotime
=
Mclock
.
monotime
Mctx
,
Mcancel
:=
context
.
WithCancel
(
context
.
Background
())
wg
.
Gox
(
func
()
{
g
wg
.
Gox
(
func
()
{
err
:=
M
.
Run
(
Mctx
)
fmt
.
Println
(
"M err: "
,
err
)
_
=
err
// XXX
...
...
@@ -235,7 +235,7 @@ func TestMasterStorage(t *testing.T) {
zstor
:=
xfs1stor
(
"../../zodb/storage/fs1/testdata/1.fs"
)
S
:=
NewStorage
(
"abc1"
,
"m:1"
,
":1"
,
Shost
,
zstor
)
Sctx
,
Scancel
:=
context
.
WithCancel
(
context
.
Background
())
wg
.
Gox
(
func
()
{
g
wg
.
Gox
(
func
()
{
err
:=
S
.
Run
(
Sctx
)
fmt
.
Println
(
"S err: "
,
err
)
_
=
err
// XXX
...
...
@@ -285,8 +285,14 @@ func TestMasterStorage(t *testing.T) {
tc
.
Expect
(
masterStartReady
(
M
,
true
))
// M <- start cmd
err
:=
M
.
Start
()
exc
.
Raiseif
(
err
)
wg
:=
&
xsync
.
WorkGroup
{}
wg
.
Gox
(
func
()
{
err
:=
M
.
Start
()
exc
.
Raiseif
(
err
)
})
tc
.
Expect
(
node
(
M
.
nodeTab
,
"s:1"
,
neo
.
STORAGE
,
1
,
neo
.
RUNNING
,
0.01
))
xwait
(
wg
)
// XXX M.partTab <- S1
// XXX M can start -> writes parttab to S and goes to verification
...
...
@@ -328,7 +334,7 @@ func TestMasterStorage(t *testing.T) {
// TODO test M.recovery starting back from verification/service
// (M needs to resend to all storages recovery messages just from start)
xwait
(
wg
)
xwait
(
g
wg
)
Mcancel
()
// XXX temp
Scancel
()
// XXX temp
}
...
...
go/neo/server/master.go
View file @
40410799
...
...
@@ -451,6 +451,19 @@ loop2:
}
}
if
err
!=
nil
{
return
err
}
// recovery successful - we are starting
// S PENDING -> RUNNING
for
_
,
stor
:=
range
m
.
nodeTab
.
StorageList
()
{
if
stor
.
State
==
neo
.
PENDING
{
m
.
nodeTab
.
SetNodeState
(
stor
,
neo
.
RUNNING
)
}
}
// if we are starting for new cluster - create partition table
if
err
!=
nil
&&
m
.
partTab
.
PTid
==
0
{
// XXX -> m.nodeTab.StorageList(State > DOWN)
...
...
@@ -461,9 +474,10 @@ loop2:
}
}
m
.
partTab
=
neo
.
MakePartTab
(
1
/* XXX hardcoded */
,
storv
)
m
.
partTab
.
PTid
=
1
}
return
err
return
nil
}
// storCtlRecovery drives a storage node during cluster recovering state
...
...
go/xcommon/xtesting/xtesting.go
View file @
40410799
...
...
@@ -58,6 +58,7 @@ func NewSyncTracer() *SyncTracer {
// Trace1 sends message with 1 tracing event to a consumer and waits for ack
func
(
st
*
SyncTracer
)
Trace1
(
event
interface
{})
{
ack
:=
make
(
chan
struct
{})
//fmt.Printf("trace: send: %T %v\n", event, event)
st
.
tracech
<-
&
SyncTraceMsg
{
event
,
ack
}
<-
ack
}
...
...
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