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
5a76664a
Commit
5a76664a
authored
Jun 29, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master: simplify recovery loop
parent
b19bf40e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
neo/master/recovery.py
neo/master/recovery.py
+14
-19
No files found.
neo/master/recovery.py
View file @
5a76664a
...
@@ -58,35 +58,30 @@ class RecoveryManager(MasterHandler):
...
@@ -58,35 +58,30 @@ class RecoveryManager(MasterHandler):
poll
=
app
.
em
.
poll
poll
=
app
.
em
.
poll
while
1
:
while
1
:
poll
(
1
)
poll
(
1
)
allowed_node_set
=
set
()
if
pt
.
filled
():
if
pt
.
filled
():
# A partition table exists, we are starting an existing
# A partition table exists, we are starting an existing
# cluster.
# cluster.
partition_node_set
=
pt
.
getReadableCellNodeSet
()
node_list
=
pt
.
getReadableCellNodeSet
()
pending_node_set
=
{
x
for
x
in
partition_node_set
if
app
.
_startup_allowed
:
if
x
.
isPending
()}
node_list
=
[
node
for
node
in
node_list
if
node
.
isPending
()]
if
app
.
_startup_allowed
or
\
elif
not
all
(
node
.
isPending
()
for
node
in
node_list
):
partition_node_set
==
pending_node_set
:
continue
allowed_node_set
=
pending_node_set
node_list
=
pt
.
getConnectedNodeList
elif
app
.
_startup_allowed
:
elif
app
.
_startup_allowed
:
# No partition table and admin allowed startup, we are
# No partition table and admin allowed startup, we are
# creating a new cluster out of all pending nodes.
# creating a new cluster out of all pending nodes.
allowed_node_set
=
set
(
app
.
nm
.
getStorageList
(
node_list
=
app
.
nm
.
getStorageList
(
only_identified
=
True
)
only_identified
=
True
))
else
:
node_list
=
lambda
:
allowed_node_set
continue
if
allowed_node_set
:
if
node_list
and
not
any
(
node
.
getConnection
().
isPending
()
for
node
in
allowed_node_set
:
for
node
in
node_list
):
assert
node
.
isPending
(),
node
if
pt
.
filled
():
if
node
.
getConnection
().
isPending
():
node_list
=
pt
.
getConnectedNodeList
()
break
break
else
:
node_list
=
node_list
()
break
logging
.
info
(
'startup allowed'
)
logging
.
info
(
'startup allowed'
)
for
node
in
node_list
:
for
node
in
node_list
:
assert
node
.
isPending
(),
node
node
.
setRunning
()
node
.
setRunning
()
app
.
broadcastNodesInformation
(
node_list
)
app
.
broadcastNodesInformation
(
node_list
)
...
...
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