Skip to content

Restore Universal compaction for consensus BLOCKS_CF on mainnet#26184

Open
mystenmark wants to merge 1 commit intomainfrom
mlogan-restore-universal-compaction-blocks-cf
Open

Restore Universal compaction for consensus BLOCKS_CF on mainnet#26184
mystenmark wants to merge 1 commit intomainfrom
mlogan-restore-universal-compaction-blocks-cf

Conversation

@mystenmark
Copy link
Copy Markdown
Contributor

Summary

  • Fixes collateral damage from [consensus] use FIFO compaction outside of mainnet #26010: on mainnet (where FIFO compaction is disabled), BLOCKS_CF was falling through to optimize_for_write_throughput() (Level compaction, L0 trigger=4) instead of the original optimize_for_write_throughput_no_deletion() (Universal compaction, L0 trigger=80).
  • Restores the original optimize_for_write_throughput_no_deletion() function (byte-for-byte identical to pre-[consensus] use FIFO compaction outside of mainnet #26010) and uses it for BLOCKS_CF in the non-FIFO path.
  • Opening an existing Universal-compacted DB under Level compaction with a much lower L0 trigger causes a compaction storm that can block consensus startup indefinitely.

Test plan

🤖 Generated with Claude Code

#26010 accidentally changed the compaction strategy for the BLOCKS_CF
column family on mainnet. The old code used optimize_for_write_throughput_no_deletion()
(Universal compaction, L0 trigger=80) for BLOCKS_CF, while other CFs used
optimize_for_write_throughput() (Level compaction, L0 trigger=4).

When #26010 introduced FIFO compaction gated behind use_fifo_compaction &&
chain != Mainnet, it removed optimize_for_write_throughput_no_deletion() and
replaced it with optimize_for_no_deletion() (FIFO). On mainnet where FIFO is
disabled, ALL CFs including BLOCKS_CF fell through to optimize_for_write_throughput()
(Level compaction, L0 trigger=4).

Opening an existing consensus DB (created with Universal compaction) under Level
compaction with a much lower L0 trigger causes a compaction storm that can block
consensus startup indefinitely. This prevents ConsensusAuthority::start() from
completing, which blocks the TransactionClient from being set, stalling the
entire validator.

Fix: restore optimize_for_write_throughput_no_deletion() with Universal compaction
and use it for BLOCKS_CF in the non-FIFO path, matching the pre-#26010 behavior.
@mystenmark mystenmark requested a review from a team as a code owner April 9, 2026 20:00
@mystenmark mystenmark temporarily deployed to sui-typescript-aws-kms-test-env April 9, 2026 20:00 — with GitHub Actions Inactive
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Apr 9, 2026 8:01pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Apr 9, 2026 8:01pm
sui-kiosk Ignored Ignored Preview Apr 9, 2026 8:01pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants