Commit 391212b7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a0dcc920
...@@ -31,8 +31,10 @@ type Node struct { ...@@ -31,8 +31,10 @@ type Node struct {
} }
// NodeTable represents all known nodes in a cluster from primary master point of view // NodeTable represents all nodes in a cluster
// XXX do we need "from local-node point of view" ? //
// Usually Master maintains such table and provides it to other nodes to know
// each other but in general use-cases can be different.
// //
// - Primary Master view of cluster // - Primary Master view of cluster
// - M tracks changes to nodeTab as nodes appear (connected to M) and go (disconnected from M) // - M tracks changes to nodeTab as nodes appear (connected to M) and go (disconnected from M)
......
...@@ -24,8 +24,14 @@ package neo ...@@ -24,8 +24,14 @@ package neo
// //
// #Np (how-many partitions) #R (replication factor) // #Np (how-many partitions) #R (replication factor)
// Cell // Cell
// .node (-> .nodeid, .addr) // .nodeUUID // .node (-> .node{UUID,Type,State,Addr})
// .cell_state // .cellState
//
// XXX ? + .haveUpToTid associated node has data up to such tid
// = uptodate if haveUpToTid == lastTid
//
// XXX ? + .plannedToDelete (when after tweak another node will get data
// from here and here it will be removed)
// //
// .backup_tid # last tid this cell has all data for // .backup_tid # last tid this cell has all data for
// .replicating # currently replicating up to this (.replicating) tid // .replicating # currently replicating up to this (.replicating) tid
...@@ -39,9 +45,9 @@ package neo ...@@ -39,9 +45,9 @@ package neo
// Pt // Pt
// +-+ // +-+
// | | // | |
// +-+ +----------+ +------------+ +-----+ // +-+ +---------------+ +-----------------+ +-----+
// | | |node,state| |node2,state2| |cell3| ... // | | |node,cell_state| |node2,cell_state2| |cell3| ...
// +-+ +----------+ +------------+ +-----+ // +-+ +---------------+ +-----------------+ +-----+
// Np | | // Np | |
// +-+ // +-+
// | | // | |
......
...@@ -136,7 +136,7 @@ class PrimaryNotificationsHandler(MTEventHandler): ...@@ -136,7 +136,7 @@ class PrimaryNotificationsHandler(MTEventHandler):
app._cache_lock_release() app._cache_lock_release()
def notifyPartitionChanges(self, conn, ptid, cell_list): def notifyPartitionChanges(self, conn, ptid, cell_list):
if self.app.pt.filled(): # XXX wrong if self.app.pt.filled(): # XXX wrong - updating only when already filled ?
self.app.pt.update(ptid, cell_list, self.app.nm) self.app.pt.update(ptid, cell_list, self.app.nm)
def notifyNodeInformation(self, conn, timestamp, node_list): def notifyNodeInformation(self, conn, timestamp, node_list):
......
...@@ -683,8 +683,8 @@ class RequestIdentification(Packet): ...@@ -683,8 +683,8 @@ class RequestIdentification(Packet):
_answer = PStruct('accept_identification', _answer = PStruct('accept_identification',
PFNodeType, PFNodeType,
PUUID('my_uuid'), PUUID('my_uuid'),
PNumber('num_partitions'), PNumber('num_partitions'), # XXX why here, not in pt updates ?
PNumber('num_replicas'), PNumber('num_replicas'), # XXX ---- // ----
PUUID('your_uuid'), PUUID('your_uuid'),
) )
...@@ -737,6 +737,7 @@ class PartitionTable(Packet): ...@@ -737,6 +737,7 @@ class PartitionTable(Packet):
PFRowList, PFRowList,
) )
# XXX dup wrt PartitionChanges ?
class NotifyPartitionTable(Packet): class NotifyPartitionTable(Packet):
""" """
Send rows in a partition table to update other nodes. PM -> S, C. Send rows in a partition table to update other nodes. PM -> S, C.
...@@ -746,6 +747,7 @@ class NotifyPartitionTable(Packet): ...@@ -746,6 +747,7 @@ class NotifyPartitionTable(Packet):
PFRowList, PFRowList,
) )
# XXX dup wrt NotifyPartitionTable ?
class PartitionChanges(Packet): class PartitionChanges(Packet):
""" """
Notify a subset of a partition table. This is used to notify changes. Notify a subset of a partition table. This is used to notify changes.
......
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