fix(wal): gate flush feedback on durable server acknowledgements - #124
Open
gabriele-wolfox wants to merge 2 commits into
Open
fix(wal): gate flush feedback on durable server acknowledgements#124gabriele-wolfox wants to merge 2 commits into
gabriele-wolfox wants to merge 2 commits into
Conversation
gabriele-wolfox
force-pushed
the
dev/98
branch
2 times, most recently
from
August 17, 2026 09:35
224ad58 to
0bc6c72
Compare
The WAL streaming client reported a flush position to PostgreSQL as soon as WAL data was handed to the gRPC send buffer, before the Klio server confirmed it durable. That made it unsafe to use Klio as a synchronous replication target for zero RPO: PostgreSQL could acknowledge commits, or advance the replication slot's restart_lsn, for data not yet guaranteed to survive a server or network failure. Convert the Put RPC to bidirectional streaming so the server acknowledges each block once fsynced, and add a require_durable_ack client option (default off) that advances the flush position only up to durably acknowledged data. The default preserves the previous optimistic behavior. Assisted-by: Claude Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
gabriele-wolfox
force-pushed
the
dev/98
branch
from
August 17, 2026 09:37
0bc6c72 to
e44824f
Compare
Add a requireDurableAck field to the PluginConfiguration spec and wire it into the generated WAL client configuration, so synchronous replication targets can require durable acknowledgements. Document how to enable it. Assisted-by: Claude Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
gabriele-wolfox
force-pushed
the
dev/98
branch
from
August 17, 2026 09:57
e44824f to
cf10467
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The WAL streaming client reported a flush position to PostgreSQL as soon as WAL
data was handed to the gRPC send buffer, before the Klio server confirmed it
durable. This made it unsafe to use Klio as a synchronous replication target for
zero RPO: PostgreSQL could acknowledge commits, or advance the physical slot's
restart_lsn, for data not yet guaranteed to survive a Klio server or network
failure.
Change
PutRPC to bidirectional streaming so the serveracknowledges each block once it has been fsynced.
require_durable_ackclient option (default off) that advances thereported flush position only up to durably acknowledged data. The default
preserves the previous optimistic behavior.
PluginConfiguration.spec.requireDurableAckand wire it into thegenerated client config.
claims.
Testing
on commit latency or throughput. With Klio as the sole synchronous standby it
gates commits as intended: in the single-client worst case, per-commit latency
went from ~200 ms to ~400 ms (one extra flush cycle for the durable round
trip); async runs were unchanged.
Closes #98