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
Xavier Thompson
neoppod
Commits
21190ee7
Commit
21190ee7
authored
Mar 31, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make 'neoctl print pt' report the number of replicas
parent
ef5fc508
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
10 deletions
+13
-10
neo/admin/app.py
neo/admin/app.py
+5
-3
neo/lib/protocol.py
neo/lib/protocol.py
+1
-0
neo/neoctl/app.py
neo/neoctl/app.py
+3
-3
neo/neoctl/neoctl.py
neo/neoctl/neoctl.py
+1
-1
neo/tests/functional/__init__.py
neo/tests/functional/__init__.py
+2
-2
neo/tests/threaded/testReplication.py
neo/tests/threaded/testReplication.py
+1
-1
No files found.
neo/admin/app.py
View file @
21190ee7
...
...
@@ -122,11 +122,13 @@ class Application(BaseApplication):
self
.
master_conn
.
ask
(
Packets
.
AskClusterState
())
def
sendPartitionTable
(
self
,
conn
,
min_offset
,
max_offset
,
uuid
):
pt
=
self
.
pt
if
max_offset
==
0
:
max_offset
=
self
.
pt
.
getPartitions
()
max_offset
=
pt
.
getPartitions
()
try
:
row_list
=
map
(
self
.
pt
.
getRow
,
xrange
(
min_offset
,
max_offset
))
row_list
=
map
(
pt
.
getRow
,
xrange
(
min_offset
,
max_offset
))
except
IndexError
:
conn
.
send
(
Errors
.
ProtocolError
(
'invalid partition table offset'
))
else
:
conn
.
answer
(
Packets
.
AnswerPartitionList
(
self
.
pt
.
getID
(),
row_list
))
conn
.
answer
(
Packets
.
AnswerPartitionList
(
pt
.
getID
(),
pt
.
getReplicas
(),
row_list
))
neo/lib/protocol.py
View file @
21190ee7
...
...
@@ -1201,6 +1201,7 @@ class PartitionList(Packet):
_answer
=
PStruct
(
'answer_partition_list'
,
PPTID
(
'ptid'
),
PNumber
(
'num_replicas'
),
PFRowList
,
)
...
...
neo/neoctl/app.py
View file @
21190ee7
...
...
@@ -106,10 +106,10 @@ class TerminalNeoCTL(object):
max_offset
=
int
(
max_offset
)
if
node
is
not
None
:
node
=
self
.
asNode
(
node
)
ptid
,
row_list
=
self
.
neoctl
.
getPartitionRowList
(
ptid
,
num_replicas
,
row_list
=
self
.
neoctl
.
getPartitionRowList
(
min_offset
=
min_offset
,
max_offset
=
max_offset
,
node
=
node
)
# TODO: return ptid
return
self
.
formatRowList
(
enumerate
(
row_list
,
min_offset
))
return
'# ptid: %s, replicas: %s
\
n
%s'
%
(
ptid
,
num_replicas
,
self
.
formatRowList
(
enumerate
(
row_list
,
min_offset
)
))
def
getNodeList
(
self
,
params
):
"""
...
...
neo/neoctl/neoctl.py
View file @
21190ee7
...
...
@@ -169,7 +169,7 @@ class NeoCTL(BaseApplication):
response
=
self
.
__ask
(
packet
)
if
response
[
0
]
!=
Packets
.
AnswerPartitionList
:
raise
RuntimeError
(
response
)
return
response
[
1
:
3
]
# ptid, row_list
return
response
[
1
:
]
def
startCluster
(
self
):
"""
...
...
neo/tests/functional/__init__.py
View file @
21190ee7
...
...
@@ -649,7 +649,7 @@ class NEOCluster(object):
def
expectOudatedCells
(
self
,
number
,
*
args
,
**
kw
):
def
callback
(
last_try
):
row_list
=
self
.
neoctl
.
getPartitionRowList
()[
1
]
row_list
=
self
.
neoctl
.
getPartitionRowList
()[
2
]
number_of_outdated
=
0
for
row
in
row_list
:
for
cell
in
row
:
...
...
@@ -660,7 +660,7 @@ class NEOCluster(object):
def
expectAssignedCells
(
self
,
process
,
number
,
*
args
,
**
kw
):
def
callback
(
last_try
):
row_list
=
self
.
neoctl
.
getPartitionRowList
()[
1
]
row_list
=
self
.
neoctl
.
getPartitionRowList
()[
2
]
assigned_cells_number
=
0
for
row
in
row_list
:
for
cell
in
row
:
...
...
neo/tests/threaded/testReplication.py
View file @
21190ee7
...
...
@@ -979,7 +979,7 @@ class ReplicationTests(NEOThreadedTest):
return
s0
.
uuid
def
check
(
expected_state
,
expected_count
):
self
.
assertEqual
(
expected_count
,
len
([
None
for
row
in
cluster
.
neoctl
.
getPartitionRowList
()[
1
]
for
row
in
cluster
.
neoctl
.
getPartitionRowList
()[
2
]
for
cell
in
row
if
cell
[
1
]
==
CellStates
.
CORRUPTED
]))
self
.
assertEqual
(
expected_state
,
cluster
.
neoctl
.
getClusterState
())
...
...
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