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
Hide 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 (
...
@@ -28,48 +28,31 @@ import (
"time"
"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
// It is
// each other but in general use-cases can be different.
//
//
//
XXX vvv is about Master=main use-case:
//
UUID -> *Node
//
//
// - Primary Master view of cluster
// mapping associating node uuid with information about a node.
// - 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
//
//
// UC:
// Primary use-case is that master maintains such table and provides it to
// - C needs to connect/talk to a storage by uuid
// its peers to know each other:
// - C needs to initially connect to PM (?)
// - S pulls from other S
//
//
// XXX [] of
// .UUID
// .Type
// .State
// .listenAt ip:port | ø // ø - if client or down(?)
//
// - - - - - - -
//
//
// .comesFrom ?(ip:port) connected to PM from here
// - Primary Master view of cluster.
// XXX ^^^ needed ? nodeLink has this info
// - 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.
// .nodeLink | nil M's node link to this node
// This way all nodes stay informed about their peers in cluster.
// .notifyConn | nil conn left after identification phase
// M uses this to send notifications to the node
//
//
// 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
//
NOTE once a node was added to NodeTable its entry is never deleted: if e.g.
//
connection to node is lost associated entry is marked as having DOWN (XXX or UNKNOWN ?) node
//
a connection to node is lost associated entry is marked as having DOWN (XXX
// state.
//
or UNKNOWN ?) node
state.
//
//
// NodeTable zero value is valid empty node table.
// NodeTable zero value is valid empty node table.
type
NodeTable
struct
{
type
NodeTable
struct
{
...
@@ -82,6 +65,8 @@ 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
// even if dialing a peer failed, we'll attempt redial after this timeout
const
δtRedial
=
3
*
time
.
Second
const
δtRedial
=
3
*
time
.
Second
...
@@ -288,7 +273,7 @@ func (p *Peer) dial(ctx context.Context) (*NodeLink, error) {
...
@@ -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) {
func (p *Peer) SetState(state NodeState) {
// XXX lock?
// XXX lock?
p.State = state
p.State = state
...
@@ -321,9 +306,6 @@ type Node struct {
...
@@ -321,9 +306,6 @@ type Node struct {
// XXX not yet sure it is good idea
// XXX not yet sure it is good idea
Conn
*
Conn
// main connection
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 (
...
@@ -30,7 +30,7 @@ import (
//
//
// It is
// It is
//
//
// Oid -> []Storage
// Oid -> []Storage
# XXX actually oid -> []uuid
//
//
// mapping associating object id with list of storage nodes on where data for
// 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:
// 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 {
...
@@ -192,7 +192,8 @@ type Address struct {
// A SHA1 hash
// A SHA1 hash
type
Checksum
[
20
]
byte
type
Checksum
[
20
]
byte
// Partition Table identifier
// Partition Table identifier.
//
// Zero value means "invalid id" (<-> None in py.PPTID)
// Zero value means "invalid id" (<-> None in py.PPTID)
type
PTid
uint64
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