Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
cdea40d3
Commit
cdea40d3
authored
Aug 31, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0fac5aed
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
40 deletions
+23
-40
go/neo/nodetab.go
go/neo/nodetab.go
+20
-38
go/neo/parttab.go
go/neo/parttab.go
+1
-1
go/neo/proto.go
go/neo/proto.go
+2
-1
No files found.
go/neo/nodetab.go
View file @
cdea40d3
...
...
@@ -28,48 +28,31 @@ import (
"time"
)
// NodeTable represents known nodes in a cluster
// NodeTable represents known nodes in a cluster
.
//
// Usually Master maintains such table and provides it to other nodes to know
// each other but in general use-cases can be different.
// It is
//
//
XXX vvv is about Master=main use-case:
//
UUID -> *Node
//
// - Primary Master view of cluster
// - M tracks changes to nodeTab as nodes appear (connected to M) and go (disconnected from M)
// - M regularly broadcasts nodeTab content updates(?) to all nodes
// This way all nodes stay informed about their peers in cluster
// mapping associating node uuid with information about a node.
//
// UC:
// - C needs to connect/talk to a storage by uuid
// - C needs to initially connect to PM (?)
// - S pulls from other S
//
//
// XXX [] of
// .UUID
// .Type
// .State
// .listenAt ip:port | ø // ø - if client or down(?)
//
// - - - - - - -
// Primary use-case is that master maintains such table and provides it to
// its peers to know each other:
//
// .comesFrom ?(ip:port) connected to PM from here
// XXX ^^^ needed ? nodeLink has this info
//
// .nodeLink | nil M's node link to this node
// .notifyConn | nil conn left after identification phase
// M uses this to send notifications to the node
// - Primary Master view of cluster.
// - M tracks changes to nodeTab as nodes appear (connected to M) and go (disconnected from M).
// - M regularly broadcasts nodeTab content updates(?) to all nodes.
// This way all nodes stay informed about their peers in cluster.
//
// Usage examples:
// - C needs to connect/talk to a storage by uuid
// (the uuid itself is obtained from PartitionTable by oid).
// - S pulls from other S.
//
// .acceptingUpdates (?) - whether it is ok to update nodeTab (e.g. if
// master is shutting down it first sends all nodes something but has to make
// sure not to accept new connections -> XXX not needed - just stop listening
// first.
//
//
XXX once a node was added to NodeTable its entry never deleted: if e.g. a
//
connection to node is lost associated entry is marked as having DOWN (XXX or UNKNOWN ?) node
// state.
//
NOTE once a node was added to NodeTable its entry is never deleted: if e.g.
//
a connection to node is lost associated entry is marked as having DOWN (XXX
//
or UNKNOWN ?) node
state.
//
// NodeTable zero value is valid empty node table.
type
NodeTable
struct
{
...
...
@@ -82,6 +65,8 @@ type NodeTable struct {
}
// XXX vvv move -> peer.go?
// even if dialing a peer failed, we'll attempt redial after this timeout
const
δtRedial
=
3
*
time
.
Second
...
...
@@ -288,7 +273,7 @@ func (p *Peer) dial(ctx context.Context) (*NodeLink, error) {
/* XXX closing .link on .state = DOWN
/* XXX closing .link on .state = DOWN
?
func (p *Peer) SetState(state NodeState) {
// XXX lock?
p.State = state
...
...
@@ -321,9 +306,6 @@ type Node struct {
// XXX not yet sure it is good idea
Conn
*
Conn
// main connection
// XXX something indicating in-flight connecting/identification
// (wish Link != nil means connected and identified)
}
...
...
go/neo/parttab.go
View file @
cdea40d3
...
...
@@ -30,7 +30,7 @@ import (
//
// It is
//
// Oid -> []Storage
// Oid -> []Storage
# XXX actually oid -> []uuid
//
// mapping associating object id with list of storage nodes on where data for
// this oid should be written-to/loaded-from. This mapping is organized as follows:
...
...
go/neo/proto.go
View file @
cdea40d3
...
...
@@ -192,7 +192,8 @@ type Address struct {
// A SHA1 hash
type
Checksum
[
20
]
byte
// Partition Table identifier
// Partition Table identifier.
//
// Zero value means "invalid id" (<-> None in py.PPTID)
type
PTid
uint64
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment