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