You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6e31ab0
Browse filesBrowse the repository at this point in the historyBrowse files
fix(webapp): stop replication services re-acking an older commit LSN
Stops the runs, sessions and webhook-deliveries replication services
from reporting an older replication position after a keepalive. On an
idle database this made `pg_stat_replication` lag appear to grow without
bound, even though the slot itself was current.
The acknowledge loop compared the keepalive LSN (unpadded) with the last
commit LSN (zero-padded) as strings, so they never matched and the older
commit LSN was re-sent. LSNs are now compared numerically, and an ack is
skipped when the last acknowledged LSN is already at or past the latest
commit:
```ts
if (
runtime.lastAcknowledgedLsn &&
lsnToUInt64(runtime.lastAcknowledgedLsn) >= lsnToUInt64(runtime.latestCommitEndLsn)
) {
return;
}
```
Each service has an integration test against real Postgres that fails
before the fix (flush LSN moves backwards) and passes after.
Mono-RevId: 3cbe8f510438e51171aa6577edafb525b30bef1a
0 commit comments