Commit dc85ab7e authored by Julien Muchembled's avatar Julien Muchembled

master: fix internal replication while trying to connect to upstream master

This fixes a regression in commit ad01f379
("fix leaving backup mode, including truncating to consistent TID")
parent 743b207c
...@@ -299,16 +299,17 @@ class BackupApplication(object): ...@@ -299,16 +299,17 @@ class BackupApplication(object):
result = None if primary else app.pt.setUpToDate(node, offset) result = None if primary else app.pt.setUpToDate(node, offset)
assert cell.isReadable() assert cell.isReadable()
if result: # was out-of-date if result: # was out-of-date
max_tid, = [x.backup_tid for x in cell_list if primary_node is not None:
if x.getNode() is primary_node] max_tid, = [x.backup_tid for x in cell_list
if tid < max_tid: if x.getNode() is primary_node]
cell.replicating = max_tid if tid < max_tid:
logging.debug( cell.replicating = max_tid
"ask %s to replicate partition %u up to %s from %s", logging.debug(
uuid_str(node.getUUID()), offset, dump(max_tid), "ask %s to replicate partition %u up to %s from %s",
uuid_str(primary_node.getUUID())) uuid_str(node.getUUID()), offset, dump(max_tid),
node.notify(Packets.Replicate(max_tid, '', uuid_str(primary_node.getUUID()))
{offset: primary_node.getAddress()})) node.notify(Packets.Replicate(max_tid, '',
{offset: primary_node.getAddress()}))
else: else:
if app.getClusterState() == ClusterStates.BACKINGUP: if app.getClusterState() == ClusterStates.BACKINGUP:
self.triggerBackup(node) self.triggerBackup(node)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment