Skip to content

Pigeonhole 0.2.2

Choose a tag to compare

@CodingAnarchy CodingAnarchy released this 12 Oct 22:04
· 11 commits to release/0.2.x since this release
17b2e41

Fixes to closing a database after cross-shard commits. Upgrade recommended for every 0.2.x user whose writes span shards. The file format is unchanged, and files written by 0.2.0 and 0.2.1 open as before. Every published crate moves to 0.2.2 together.

Fixed

  • Closing the database could hang forever after concurrent cross-shard commits (#585, D225).
    • When: two commits that each wrote rows on more than one shard were in flight together, and each was coordinated by a shard the other wrote to. Likelier with many shards and many threads writing at once.
    • What happened: each shard's WAL checkpoint waited for the other's, so neither could move. close waited for them and never returned. While running, the WAL stopped being trimmed past those commits. With many such commits in flight, a shard thread could instead overflow its stack during the close and abort the process.
    • The fix: a shard drops a cross-shard commit's record from its WAL once every shard's part of the commit is written to the file, without waiting for the coordinating shard's checkpoint (D225).
  • Closing the database could hang forever after a crash during cross-shard commits (#591). The reopen recovered correctly, but a commit the recovery had correctly discarded was later treated as undecided, and the close waited for it.
  • Closing the database could hang forever after a tablet move (#597): a shard was not told when another shard wrote its moved data to the file, so a commit never completed its bookkeeping.

Upgrading

Change nothing but the version: pigeonhole = "0.2" resolves to 0.2.2 after cargo update -p pigeonhole. No data was ever lost or corrupted by these bugs: each one made close (or, while running, WAL trimming) wait forever. A process stuck in close on 0.2.0 or 0.2.1 can be killed safely, and the next open recovers every acknowledged commit. Single-shard workloads were not affected.

Details: #585, #591, #597 (root causes and reproductions), D225 (the rule change), #587 and #594 (main), #598 (this backport).