Skip to content
Snippets Groups Projects
Commit 8a656664 authored by Mark Haines's avatar Mark Haines
Browse files

Fix backfill replication to advance the stream correctly

parent 71df3271
No related branches found
No related tags found
No related merge requests found
......@@ -382,7 +382,7 @@ class _Writer(object):
position = rows[-1][0]
self.streams[name] = {
"position": str(position),
"position": position if type(position) is int else str(position),
"field_names": fields,
"rows": rows,
}
......
......@@ -118,7 +118,7 @@ class SlavedEventStore(BaseSlavedStore):
def stream_positions(self):
result = super(SlavedEventStore, self).stream_positions()
result["events"] = self._stream_id_gen.get_current_token()
result["backfill"] = self._backfill_id_gen.get_current_token()
result["backfill"] = -self._backfill_id_gen.get_current_token()
return result
def process_replication(self, result):
......@@ -136,7 +136,7 @@ class SlavedEventStore(BaseSlavedStore):
stream = result.get("backfill")
if stream:
self._backfill_id_gen.advance(stream["position"])
self._backfill_id_gen.advance(-stream["position"])
for row in stream["rows"]:
self._process_replication_row(
row, backfilled=True, state_resets=state_resets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment