Commit f1b1bda5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e4a7f75c
...@@ -320,16 +320,16 @@ func (stor *Storage) m1initialize1(ctx context.Context, req neonet.Request) erro ...@@ -320,16 +320,16 @@ func (stor *Storage) m1initialize1(ctx context.Context, req neonet.Request) erro
case *proto.Recovery: case *proto.Recovery:
err = req.Reply(&proto.AnswerRecovery{ err = req.Reply(&proto.AnswerRecovery{
PTid: stor.node.PartTab.PTid, PTid: stor.node.state.PartTab.PTid,
BackupTid: proto.INVALID_TID, BackupTid: proto.INVALID_TID,
TruncateTid: proto.INVALID_TID}) TruncateTid: proto.INVALID_TID})
case *proto.AskPartitionTable: case *proto.AskPartitionTable:
// TODO initially read PT from disk // TODO initially read PT from disk
err = req.Reply(&proto.AnswerPartitionTable{ err = req.Reply(&proto.AnswerPartitionTable{
PTid: stor.node.PartTab.PTid, PTid: stor.node.state.PartTab.PTid,
NumReplicas: 0, // FIXME hardcoded; NEO/py uses this as n(replica)-1 NumReplicas: 0, // FIXME hardcoded; NEO/py uses this as n(replica)-1
RowList: stor.node.PartTab.Dump()}) RowList: stor.node.state.PartTab.Dump()})
case *proto.LockedTransactions: case *proto.LockedTransactions:
// XXX r/o stub // XXX r/o stub
...@@ -387,7 +387,7 @@ func (stor *Storage) m1serve(ctx context.Context, reqStart *neonet.Request) (err ...@@ -387,7 +387,7 @@ func (stor *Storage) m1serve(ctx context.Context, reqStart *neonet.Request) (err
for { for {
// XXX abort on ctx (XXX or upper?) // XXX abort on ctx (XXX or upper?)
req, err := mlink.Recv1() // XXX -> RecvM1 req, err := stor.node.RecvM1()
if err != nil { if err != nil {
return err return err
} }
...@@ -408,18 +408,6 @@ func (stor *Storage) m1serve1(ctx context.Context, req neonet.Request) error { ...@@ -408,18 +408,6 @@ func (stor *Storage) m1serve1(ctx context.Context, req neonet.Request) error {
case *proto.StopOperation: case *proto.StopOperation:
return fmt.Errorf("stop requested") return fmt.Errorf("stop requested")
// should be served by Node.commonRecv1
// ---- 8< ----
// XXX SendPartitionTable?
// XXX NotifyPartitionChanges?
case *proto.NotifyNodeInformation:
stor.node.UpdateNodeTab(ctx, msg) // XXX lock?
case *proto.NotifyClusterState:
stor.node.UpdateClusterState(ctx, msg) // XXX lock? what to do with it?
// ---- 8< ----
// TODO commit related messages // TODO commit related messages
} }
...@@ -448,8 +436,8 @@ func (stor *Storage) identify(idReq *proto.RequestIdentification) (proto.Msg, bo ...@@ -448,8 +436,8 @@ func (stor *Storage) identify(idReq *proto.RequestIdentification) (proto.Msg, bo
} }
return &proto.AcceptIdentification{ return &proto.AcceptIdentification{
NodeType: stor.node.MyInfo.Type, NodeType: stor.node.myInfo.Type,
MyNID: stor.node.MyInfo.NID, // XXX lock wrt update MyNID: stor.node.myInfo.NID, // XXX lock wrt update
YourNID: idReq.NID, YourNID: idReq.NID,
}, true }, true
} }
......
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