Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
a0dcc920
Commit
a0dcc920
authored
May 18, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c6599556
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
go/neo/connection.go
go/neo/connection.go
+2
-0
go/neo/nodetab.go
go/neo/nodetab.go
+35
-1
neo/client/handlers/master.py
neo/client/handlers/master.py
+1
-1
neo/lib/node.py
neo/lib/node.py
+1
-0
No files found.
go/neo/connection.go
View file @
a0dcc920
...
...
@@ -133,6 +133,8 @@ const (
//
// 2. NodeLink.Accept() works only on server side.
// XXX vs client processing e.g. invalidation notifications from master ?
// XXX -> we could require that such listen for notification Conn is that
// one left after RequestIdentification/AcceptIdentification.
//
// Usually server role should be used for connections created via
// net.Listen/net.Accept and client role for connections created via net.Dial.
...
...
go/neo/nodetab.go
View file @
a0dcc920
...
...
@@ -31,7 +31,41 @@ type Node struct {
}
// NodeTable represents all known nodes in a cluster from local-node point of view
// NodeTable represents all known nodes in a cluster from primary master point of view
// XXX do we need "from local-node point of view" ?
//
// - 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
//
// 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
// .nodeUUID
// .nodeType
// .nodeState
// .listenAt ip:port | ø // ø - if client or down(?)
//
// - - - - - - -
//
// .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
//
//
// .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.
//
type
NodeTable
struct
{
// users have to care locking explicitly
sync
.
Mutex
// XXX -> RWMutex ?
...
...
neo/client/handlers/master.py
View file @
a0dcc920
...
...
@@ -146,7 +146,7 @@ class PrimaryNotificationsHandler(MTEventHandler):
# to do the same thing for nodes in other non-running states ?
getByUUID
=
self
.
app
.
nm
.
getByUUID
for
node
in
node_list
:
if
node
[
3
]
!=
NodeStates
.
RUNNING
:
if
node
[
3
]
!=
NodeStates
.
RUNNING
:
# NOTE C closes connections to other nodes if M says they are not running
node
=
getByUUID
(
node
[
2
])
if
node
and
node
.
isConnected
():
node
.
getConnection
().
close
()
...
...
neo/lib/node.py
View file @
a0dcc920
...
...
@@ -522,6 +522,7 @@ def NODE_TYPE_MAPPING():
name
=
camel_case
(
node_type
)
is_name
=
'is'
+
name
setmethod
(
Node
,
is_name
,
bool
)
# e.g. MasterNode(Node): .is_master: true; .getType: lambda ... -> Master
node_type_dict
[
node_type
]
=
cls
=
type
(
name
+
'Node'
,
bases
,
{
'getType'
:
getType
(
node_type
),
is_name
:
true
,
...
...
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