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
eceb8b9e
Commit
eceb8b9e
authored
Nov 04, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bd5e1658
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
18 deletions
+12
-18
neo/master/backup_app.py
neo/master/backup_app.py
+1
-1
neo/tests/threaded/testReplication.py
neo/tests/threaded/testReplication.py
+11
-17
No files found.
neo/master/backup_app.py
View file @
eceb8b9e
...
...
@@ -225,7 +225,7 @@ class BackupApplication(object):
# all partitions. t1 is wrong for the same reason.
# So we have chosen the highest one (t3 - 1).
# t2 should also work but maybe harder to implement.
cell.backup_tid = add64(tid, -1)
# XXX wrong! (we did not yet pulled the data)
cell.backup_tid = add64(tid, -1)
logging.debug(
"partition %u: updating backup_tid of %r to %s",
offset, cell, dump(cell.backup_tid))
...
...
neo/tests/threaded/testReplication.py
View file @
eceb8b9e
...
...
@@ -169,7 +169,8 @@ class ReplicationTests(NEOThreadedTest):
finally
:
backup
.
stop
()
# U -> B propagation with Mb -> Sb (Replicate) delayed
# U -> B propagation with Mb -> Sb' (secondary, Replicate from primary Sb) delayed
# TODO also test: "U -> B propagation with Mb -> Sb (Replicate) delayed" ?
from
neo.storage.database
import
manager
as
dbmanager
from
neo.master
import
handlers
as
mhandler
#dbmanager.X = 1
...
...
@@ -179,9 +180,9 @@ class ReplicationTests(NEOThreadedTest):
tid
,
upstream_name
,
source_dict
=
packet
.
decode
()
print
'REPLICATE tid: %r, upstream_name: %r, source_dict: %r'
%
\
(
tid
,
upstream_name
,
source_dict
)
return
True
#
return not upstream_name and all(source_dict.itervalues())
return
upstream_name
!=
""
#
return True
return
not
upstream_name
and
all
(
source_dict
.
itervalues
())
#
return upstream_name != ""
backup
.
reset
()
try
:
backup
.
start
()
...
...
@@ -190,23 +191,16 @@ class ReplicationTests(NEOThreadedTest):
u_last_tid0
=
U
.
last_tid
self
.
assertEqual
(
B
.
backup_tid
,
u_last_tid0
)
self
.
assertEqual
(
B
.
last_tid
,
u_last_tid0
)
print
print
'B.backup_tid: %r'
%
B
.
backup_tid
with
backup
.
master
.
filterConnection
(
*
backup
.
storage_list
)
as
f
:
f
.
add
(
delaySecondary
)
# NOTE delays backup pickup Mb -> Sb
print
'B.backup_tid: %r'
%
B
.
backup_tid
f
.
add
(
delaySecondary
)
while
not
f
.
filtered_count
:
print
'B.backup_tid: %r'
%
B
.
backup_tid
importZODB
(
1
)
print
'B.backup_tid: %r'
%
B
.
backup_tid
self
.
tic
()
print
'B.backup_tid: %r'
%
B
.
backup_tid
print
print
'u_last_tid0: %r'
%
u_last_tid0
print
'U.last_tid: %r'
%
U
.
last_tid
print
'B.backup_tid: %r'
%
B
.
backup_tid
# there were new commits
self
.
assertGreater
(
U
.
last_tid
,
u_last_tid0
)
self
.
assertEqual
(
B
.
backup_tid
,
u_last_tid0
)
# is not updated for data (but can be pre-updated to tid-1 on first synced txn) XXX text
self
.
assertLess
(
B
.
backup_tid
,
U
.
last_tid
)
# info about last_tid is synced fully
self
.
assertEqual
(
B
.
last_tid
,
U
.
last_tid
)
backup
.
neoctl
.
setClusterState
(
ClusterStates
.
STOPPING_BACKUP
)
self
.
tic
()
...
...
@@ -224,7 +218,7 @@ class ReplicationTests(NEOThreadedTest):
dbmanager
.
X
=
0
mhandler
.
X
=
0
# S -> Sb (AddObject) delayed
# S -> Sb (AddObject) delayed
XXX not only S -> Sb: also Sb -> Sb'
backup
.
reset
()
try
:
backup
.
start
()
...
...
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