Commit 39dd4c4d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 329fc53c
......@@ -64,11 +64,6 @@ import (
type _MasteredNode struct {
*xneo.Node
// myInfo proto.NodeInfo // type, laddr, nid, state, idtime
// ClusterName string
// Net xnet.Networker // network AP we are sending/receiving on
// MasterAddr string // address of current master TODO -> masterRegistry
// operational state is maintained by TalkMaster.
// users retrieve it via WithOperational().
//
......@@ -117,24 +112,6 @@ const (
func newMasteredNode(typ proto.NodeType, clusterName string, net xnet.Networker, masterAddr string) *_MasteredNode {
node := &_MasteredNode{
Node: xneo.NewNode(typ, clusterName, net, masterAddr),
/*
myInfo: proto.NodeInfo{
Type: typ,
Addr: proto.Address{},
NID: 0,
IdTime: proto.IdTimeNone,
},
ClusterName: clusterName,
Net: net,
MasterAddr: masterAddr,
state: xneo.ClusterState{
NodeTab: &xneo.NodeTable{},
PartTab: &xneo.PartitionTable{},
Code: -1, // invalid
},
*/
opReady: make(chan struct{}),
}
......@@ -230,15 +207,18 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
return fmt.Errorf("after identification: %w", err)
}
// partTab XXX not to S and secondary M?
// partTab (not to S and secondary M(?))
// https://lab.nexedi.com/nexedi/neoppod/blob/v1.12-69-gd98205d0/neo/master/handlers/__init__.py#L60-67
mpt := proto.SendPartitionTable{}
_, err = mlink.Expect1(&mpt)
if err != nil {
return fmt.Errorf("after identification: %w", err)
pt := node.State.PartTab
if !(node.MyInfo.Type == proto.STORAGE) { // XXX -> use flag instead?
mpt := proto.SendPartitionTable{}
_, err = mlink.Expect1(&mpt)
if err != nil {
return fmt.Errorf("after identification: %w", err)
}
pt = xneo.PartTabFromDump(mpt.PTid, mpt.RowList) // TODO handle mpt.NumReplicas
log.Infof(ctx, "<- parttab:\n%s", pt)
}
pt := xneo.PartTabFromDump(mpt.PTid, mpt.RowList) // TODO handle mpt.NumReplicas
log.Infof(ctx, "<- parttab:\n%s", pt)
// update cluster state
......
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