Commit 7890d4cb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a16e85ce
......@@ -287,8 +287,8 @@ func TestMasterStorage(t *testing.T) {
TruncateTid: neo.INVALID_TID,
}))
tc.Expect(conntx("m:2", "s:2", 1, &neo.AskPartitionTable{}))
tc.Expect(conntx("s:2", "m:2", 1, &neo.AnswerPartitionTable{
tc.Expect(conntx("m:2", "s:2", 2, &neo.AskPartitionTable{}))
tc.Expect(conntx("s:2", "m:2", 2, &neo.AnswerPartitionTable{
PTid: 0,
RowList: []neo.RowInfo{},
}))
......@@ -311,23 +311,23 @@ func TestMasterStorage(t *testing.T) {
// M starts verification
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,
RowList: []neo.RowInfo{
{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("s:2", "m:2", 1, &neo.AnswerLockedTransactions{
tc.Expect(conntx("m:2", "s:2", 6, &neo.LockedTransactions{}))
tc.Expect(conntx("s:2", "m:2", 6, &neo.AnswerLockedTransactions{
TidDict: nil, // map[zodb.Tid]zodb.Tid{},
}))
lastOid, err1 := zstor.LastOid(bg)
lastTid, err2 := zstor.LastTid(bg)
exc.Raiseif(xerr.Merge(err1, err2))
tc.Expect(conntx("m:2", "s:2", 1, &neo.LastIDs{}))
tc.Expect(conntx("s:2", "m:2", 1, &neo.AnswerLastIDs{
tc.Expect(conntx("m:2", "s:2", 8, &neo.LastIDs{}))
tc.Expect(conntx("s:2", "m:2", 8, &neo.AnswerLastIDs{
LastOid: lastOid,
LastTid: lastTid,
}))
......@@ -343,8 +343,8 @@ func TestMasterStorage(t *testing.T) {
tc.Expect(clusterState(&M.node.ClusterState, neo.ClusterRunning))
// TODO ^^^ should be sent to S
tc.Expect(conntx("m:2", "s:2", 1, &neo.StartOperation{Backup: false}))
tc.Expect(conntx("s:2", "m:2", 1, &neo.NotifyReady{}))
tc.Expect(conntx("m:2", "s:2", 10, &neo.StartOperation{Backup: false}))
tc.Expect(conntx("s:2", "m:2", 3, &neo.NotifyReady{}))
// TODO S leave while service
......
......@@ -864,11 +864,28 @@ func storCtlService(ctx context.Context, stor *neo.Node) (err error) {
// XXX send nodeTab ?
// XXX send clusterInformation ?
ready := neo.NotifyReady{}
err = slink.Ask1(&neo.StartOperation{Backup: false}, &ready)
// XXX current neo/py does StartOperation / NotifyReady as separate
// 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 {
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
// XXX this should be also controlling transactions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment