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
7890d4cb
Commit
7890d4cb
authored
Aug 31, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a16e85ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
11 deletions
+28
-11
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+9
-9
go/neo/server/master.go
go/neo/server/master.go
+19
-2
No files found.
go/neo/server/cluster_test.go
View file @
7890d4cb
...
@@ -287,8 +287,8 @@ func TestMasterStorage(t *testing.T) {
...
@@ -287,8 +287,8 @@ func TestMasterStorage(t *testing.T) {
TruncateTid
:
neo
.
INVALID_TID
,
TruncateTid
:
neo
.
INVALID_TID
,
}))
}))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
1
,
&
neo
.
AskPartitionTable
{}))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
2
,
&
neo
.
AskPartitionTable
{}))
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
1
,
&
neo
.
AnswerPartitionTable
{
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
2
,
&
neo
.
AnswerPartitionTable
{
PTid
:
0
,
PTid
:
0
,
RowList
:
[]
neo
.
RowInfo
{},
RowList
:
[]
neo
.
RowInfo
{},
}))
}))
...
@@ -311,23 +311,23 @@ func TestMasterStorage(t *testing.T) {
...
@@ -311,23 +311,23 @@ func TestMasterStorage(t *testing.T) {
// M starts verification
// M starts verification
tc
.
Expect
(
clusterState
(
&
M
.
node
.
ClusterState
,
neo
.
ClusterVerifying
))
tc
.
Expect
(
clusterState
(
&
M
.
node
.
ClusterState
,
neo
.
ClusterVerifying
))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
1
,
&
neo
.
NotifyPartitionTable
{
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
4
,
&
neo
.
NotifyPartitionTable
{
PTid
:
1
,
PTid
:
1
,
RowList
:
[]
neo
.
RowInfo
{
RowList
:
[]
neo
.
RowInfo
{
{
0
,
[]
neo
.
CellInfo
{{
neo
.
UUID
(
neo
.
STORAGE
,
1
),
neo
.
UP_TO_DATE
}}},
{
0
,
[]
neo
.
CellInfo
{{
neo
.
UUID
(
neo
.
STORAGE
,
1
),
neo
.
UP_TO_DATE
}}},
},
},
}))
}))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
1
,
&
neo
.
LockedTransactions
{}))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
6
,
&
neo
.
LockedTransactions
{}))
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
1
,
&
neo
.
AnswerLockedTransactions
{
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
6
,
&
neo
.
AnswerLockedTransactions
{
TidDict
:
nil
,
// map[zodb.Tid]zodb.Tid{},
TidDict
:
nil
,
// map[zodb.Tid]zodb.Tid{},
}))
}))
lastOid
,
err1
:=
zstor
.
LastOid
(
bg
)
lastOid
,
err1
:=
zstor
.
LastOid
(
bg
)
lastTid
,
err2
:=
zstor
.
LastTid
(
bg
)
lastTid
,
err2
:=
zstor
.
LastTid
(
bg
)
exc
.
Raiseif
(
xerr
.
Merge
(
err1
,
err2
))
exc
.
Raiseif
(
xerr
.
Merge
(
err1
,
err2
))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
1
,
&
neo
.
LastIDs
{}))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
8
,
&
neo
.
LastIDs
{}))
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
1
,
&
neo
.
AnswerLastIDs
{
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
8
,
&
neo
.
AnswerLastIDs
{
LastOid
:
lastOid
,
LastOid
:
lastOid
,
LastTid
:
lastTid
,
LastTid
:
lastTid
,
}))
}))
...
@@ -343,8 +343,8 @@ func TestMasterStorage(t *testing.T) {
...
@@ -343,8 +343,8 @@ func TestMasterStorage(t *testing.T) {
tc
.
Expect
(
clusterState
(
&
M
.
node
.
ClusterState
,
neo
.
ClusterRunning
))
tc
.
Expect
(
clusterState
(
&
M
.
node
.
ClusterState
,
neo
.
ClusterRunning
))
// TODO ^^^ should be sent to S
// TODO ^^^ should be sent to S
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
1
,
&
neo
.
StartOperation
{
Backup
:
false
}))
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
1
0
,
&
neo
.
StartOperation
{
Backup
:
false
}))
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
1
,
&
neo
.
NotifyReady
{}))
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
3
,
&
neo
.
NotifyReady
{}))
// TODO S leave while service
// TODO S leave while service
...
...
go/neo/server/master.go
View file @
7890d4cb
...
@@ -864,11 +864,28 @@ func storCtlService(ctx context.Context, stor *neo.Node) (err error) {
...
@@ -864,11 +864,28 @@ func storCtlService(ctx context.Context, stor *neo.Node) (err error) {
// XXX send nodeTab ?
// XXX send nodeTab ?
// XXX send clusterInformation ?
// XXX send clusterInformation ?
ready
:=
neo
.
NotifyReady
{}
// XXX current neo/py does StartOperation / NotifyReady as separate
err
=
slink
.
Ask1
(
&
neo
.
StartOperation
{
Backup
:
false
},
&
ready
)
// sends, not exchange on the same conn.
//ready := neo.NotifyReady{}
//err = slink.Ask1(&neo.StartOperation{Backup: false}, &ready)
err
=
slink
.
Send1
(
&
neo
.
StartOperation
{
Backup
:
false
})
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
req
,
err
:=
slink
.
Recv1
()
if
err
!=
nil
{
return
err
}
req
.
Close
()
switch
msg
:=
req
.
Msg
.
(
type
)
{
case
*
neo
.
NotifyReady
:
// ok
case
*
neo
.
Error
:
return
msg
default
:
return
fmt
.
Errorf
(
"unexpected message %T"
,
msg
)
}
// now wait in a loop
// now wait in a loop
// XXX this should be also controlling transactions
// XXX this should be also controlling transactions
...
...
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