Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- **Multi-shard SWAPDB is now durable and replica-visible before `+OK`
(#133).** Two defects in `coordinate_swapdb`: (1) no fsync rendezvous —
under `--appendfsync always` the client saw `+OK` before any shard had
fsynced its SWAPDB record; (2) the coordinator shard's own record was
written to WAL v3 only, never the per-shard AOF — and for
`--shards ≥ 2 --appendonly yes` the per-shard AOF manifest is the sole
recovery authority, so a kill-9 after `+OK` permanently lost the LOCAL
shard's half of the swap while remote shards' halves survived
(cross-shard keyspace divergence; reproduced empirically). The local leg
now performs a durable AOF group-commit append + fsync barrier BEFORE
swapping (abort-with-no-mutation on failure) and records the swap on the
replication plane (backlog + offset + live fan-out, `SELECT 0` framing);
the coordinator confirms each remote shard's durability with one
post-ack `fsync_barrier` (H1-BARRIER ordering). A remote barrier failure
after the swap is applied is reported truthfully as
durability-unconfirmed rather than a false `+OK`.

### Performance
- **Shard offload paths are precomputed at shard init — the recurring
tick paths no longer allocate (#45).** The 100ms eviction tick, the
Expand Down
2 changes: 2 additions & 0 deletions src/server/conn/handler_monoio/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,8 @@ pub(super) async fn try_handle_swapdb(
&ctx.shard_databases,
&ctx.dispatch_tx,
&ctx.spsc_notifiers,
ctx.aof_pool.as_ref(),
&ctx.repl_state,
)
.await;
responses.push(response);
Expand Down
2 changes: 2 additions & 0 deletions src/server/conn/handler_sharded/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ pub(super) async fn try_handle_swapdb(
&ctx.shard_databases,
&ctx.dispatch_tx,
&ctx.spsc_notifiers,
ctx.aof_pool.as_ref(),
&ctx.repl_state,
)
.await;
responses.push(response);
Expand Down
Loading
Loading