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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
88d76044
Commit
88d76044
authored
Jan 19, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't depend on connection's uuid to detect primary connection.
parent
0c408964
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
neo/client/app.py
neo/client/app.py
+2
-2
neo/client/handlers/master.py
neo/client/handlers/master.py
+1
-0
neo/lib/bootstrap.py
neo/lib/bootstrap.py
+3
-1
No files found.
neo/client/app.py
View file @
88d76044
...
...
@@ -263,7 +263,6 @@ class Application(object):
try
:
self
.
new_oid_list
=
[]
result
=
self
.
_connectToPrimaryNode
()
self
.
master_conn
=
result
finally
:
self
.
_connecting_to_master_node_release
()
return
result
...
...
@@ -347,7 +346,8 @@ class Application(object):
# Identify to primary master and request initial data
p
=
Packets
.
RequestIdentification
(
NodeTypes
.
CLIENT
,
self
.
uuid
,
None
,
self
.
name
)
while
conn
.
getUUID
()
is
None
:
assert
self
.
master_conn
is
None
,
self
.
master_conn
while
self
.
master_conn
is
None
:
ask
(
conn
,
p
,
handler
=
handler
)
if
conn
.
getUUID
()
is
None
:
# Node identification was refused by master, it is considered
...
...
neo/client/handlers/master.py
View file @
88d76044
...
...
@@ -49,6 +49,7 @@ class PrimaryBootstrapHandler(AnswerBaseHandler):
# Always create partition table
app
.
pt
=
PartitionTable
(
num_partitions
,
num_replicas
)
app
.
master_conn
=
conn
def
answerPrimary
(
self
,
conn
,
primary_uuid
,
known_master_list
):
...
...
neo/lib/bootstrap.py
View file @
88d76044
...
...
@@ -29,6 +29,7 @@ class BootstrapManager(EventHandler):
"""
Manage the bootstrap stage, lookup for the primary master then connect to it
"""
accepted
=
False
def
__init__
(
self
,
app
,
name
,
node_type
,
uuid
=
None
,
server
=
NO_SERVER
):
"""
...
...
@@ -119,6 +120,7 @@ class BootstrapManager(EventHandler):
self
.
uuid
=
your_uuid
neo
.
lib
.
logging
.
info
(
'Got a new UUID : %s'
%
dump
(
self
.
uuid
))
conn
.
setUUID
(
uuid
)
self
.
accepted
=
True
def
getPrimaryConnection
(
self
,
connector_handler
):
"""
...
...
@@ -131,7 +133,7 @@ class BootstrapManager(EventHandler):
self
.
current
=
nm
.
getMasterList
()[
0
]
conn
=
None
# retry until identified to the primary
while
self
.
primary
is
None
or
conn
.
getUUID
()
!=
self
.
primary
.
getUUID
()
:
while
not
self
.
accepted
:
if
self
.
current
is
None
:
# conn closed
conn
=
None
...
...
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