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
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
Stefane Fermigier
neo
Commits
e0a2a217
Commit
e0a2a217
authored
Dec 01, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: tweak should be safer
parent
264f6f57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
neo/tests/threaded/testReplication.py
neo/tests/threaded/testReplication.py
+29
-1
No files found.
neo/tests/threaded/testReplication.py
View file @
e0a2a217
...
...
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
random
import
sys
import
time
import
transaction
from
ZODB.POSException
import
ReadOnlyError
,
POSKeyError
...
...
@@ -31,7 +32,7 @@ from neo.lib.event import EventManager
from
neo.lib.protocol
import
CellStates
,
ClusterStates
,
Packets
,
\
ZERO_OID
,
ZERO_TID
,
MAX_TID
,
uuid_str
from
neo.lib.util
import
p64
from
..
import
Patch
from
..
import
expectedFailure
,
Patch
from
.
import
ConnectionFilter
,
NEOCluster
,
NEOThreadedTest
,
predictable_random
...
...
@@ -306,6 +307,33 @@ class ReplicationTests(NEOThreadedTest):
self
.
tic
()
self
.
assertEqual
(
1
,
self
.
checkBackup
(
backup
))
def
testSafeTweak
(
self
):
"""
Check that tweak always tries to keep a minimum of (replicas + 1)
readable cells, otherwise we have less/no redundancy as long as
replication has not finished.
"""
def
changePartitionTable
(
orig
,
*
args
):
orig
(
*
args
)
sys
.
exit
()
cluster
=
NEOCluster
(
partitions
=
3
,
replicas
=
1
,
storage_count
=
3
)
s0
,
s1
,
s2
=
cluster
.
storage_list
try
:
cluster
.
start
([
s0
,
s1
])
s2
.
start
()
self
.
tic
()
cluster
.
enableStorageList
([
s2
])
# 2 UP_TO_DATE cells should become FEEDING,
# and be dropped only when the replication is done,
# so that 1 storage can still die without data loss.
with
Patch
(
s0
.
dm
,
changePartitionTable
=
changePartitionTable
):
cluster
.
neoctl
.
tweakPartitionTable
()
self
.
tic
()
expectedFailure
(
self
.
assertEqual
)(
cluster
.
neoctl
.
getClusterState
(),
ClusterStates
.
RUNNING
)
finally
:
cluster
.
stop
()
def
testReplicationAbortedBySource
(
self
):
"""
Check that a feeding node aborts replication when its partition is
...
...
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