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

.

parent a16e85ce
...@@ -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", 10, &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
......
...@@ -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
......
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