Commit edc38c9d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b58a6bc1
......@@ -250,8 +250,7 @@ func (c *Client) recvMaster(ctx context.Context, mlink *neo.NodeLink) error {
// M sends whole PT
case *neo.SendPartitionTable:
pt := neo.PartTabFromDump(msg.PTid, msg.RowList)
c.node.PartTab = pt
c.node.UpdatePartTab(ctx, msg)
// M sends δPT
//case *neo.NotifyPartitionChanges:
......
......@@ -326,10 +326,6 @@ func (l *listener) Addr() net.Addr {
// ----------------------------------------
// TODO functions to update:
// .PartTab from NotifyPartitionTable msg
// UpdateNodeTab applies updates to .NodeTab from message and logs changes appropriately.
func (app *NodeApp) UpdateNodeTab(ctx context.Context, msg *NotifyNodeInformation) {
// XXX msg.IdTime ?
......@@ -357,6 +353,14 @@ func (app *NodeApp) UpdateNodeTab(ctx context.Context, msg *NotifyNodeInformatio
log.Infof(ctx, "full nodetab:\n%s", app.NodeTab)
}
// UpdatePartTab applies updates to .PartTab from message and logs changes appropriately.
func (app *NodeApp) UpdatePartTab(ctx context.Context, msg *SendPartitionTable) {
pt := PartTabFromDump(msg.PTid, msg.RowList)
// XXX logging under lock
log.Infof(ctx, "rx parttab: %v", pt)
app.PartTab = pt
}
// UpdateClusterState applies update to .ClusterState from message and logs change appropriately.
func (app *NodeApp) UpdateClusterState(ctx context.Context, msg *NotifyClusterState) {
// XXX loging under lock
......
......@@ -269,6 +269,7 @@ func (stor *Storage) m1initialize(ctx context.Context, mlink *neo.NodeLink) (req
case *neo.SendPartitionTable:
// TODO M sends us whole PT -> save locally
stor.node.UpdatePartTab(ctx, msg) // XXX lock?
case *neo.NotifyPartitionChanges:
// TODO M sends us δPT -> save locally?
......
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