Skip to content

Commit bd08d2e

Browse files
authored
Fix replication lag after initial replication. (#281)
1 parent 0a8acc2 commit bd08d2e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/module-postgres/src/replication/WalStream.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,11 @@ WHERE oid = $1::regclass`,
10031003
// Big caveat: This _must not_ be used to skip individual messages, since this LSN
10041004
// may be in the middle of the next transaction.
10051005
// It must only be used to associate checkpoints with LSNs.
1006-
await batch.keepalive(chunkLastLsn);
1006+
const didCommit = await batch.keepalive(chunkLastLsn);
1007+
if (didCommit) {
1008+
this.oldestUncommittedChange = null;
1009+
}
1010+
10071011
this.isStartingReplication = false;
10081012
}
10091013

0 commit comments

Comments
 (0)