Skip to content

feat: Add paranoid file checks in RocksDB - #3511

Open
sadhansood wants to merge 1 commit into
mainfrom
sadhan/paranoid_checks
Open

feat: Add paranoid file checks in RocksDB#3511
sadhansood wants to merge 1 commit into
mainfrom
sadhan/paranoid_checks

Conversation

@sadhansood

Copy link
Copy Markdown
Contributor

Description

Add an option for paranoid file checks which lets RocksDB check block checksums after .sst file writes.

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that
a user might notice and any actions they must take to implement updates. (Add release notes after the colon for each item)

  • Storage node:
  • Aggregator:
  • Publisher:
  • CLI:

@sadhansood
sadhansood force-pushed the sadhan/paranoid_checks branch from fe96005 to db830b0 Compare July 2, 2026 22:46
@sadhansood
sadhansood force-pushed the sadhan/paranoid_checks branch from db830b0 to 223fe40 Compare July 2, 2026 22:48
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. It will be closed in 7 days unless you remove the stale label, add the do-not-close label, or comment on it.

@halfprice

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 223fe40d5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2485 to +2487
rocksdb
.apply_env_options_to_cfs(cf_names)
.map_err(typed_store_err_from_rocks_err)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Configure file checks before opening the database

When reopening a database after an unclean shutdown, open_cf_descriptors can replay the WAL and flush recovery SSTs before it returns. Because paranoid_file_checks is applied only afterward, those SST writes bypass the requested checksum verification. Apply the environment override to each column family's Options before calling open_cf_descriptors so recovery and startup writes are covered too.

Useful? React with 👍 / 👎.

Comment on lines +816 to +819
// SAFETY: typed-store RocksDB tests use a process-wide mutex to serialize env mutation.
unsafe {
std::env::set_var(name, value);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Isolate the environment mutation from parallel tests

When this test runs in parallel on Unix, the custom mutex does not make set_var safe because several tests call open_rocksdb without acquiring it, and default_db_options reads environment variables during those opens. Rust requires that no other thread read or write the environment while set_var runs, so this can race and invoke undefined behavior; run this case in an isolated subprocess or otherwise serialize every environment access in the test process.

Useful? React with 👍 / 👎.

@halfprice halfprice left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sadhansood for the PR! The logic LGTM. Just one qq: why using env variable instead of config?

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. It will be closed in 7 days unless you remove the stale label, add the do-not-close label, or comment on it.

@github-actions github-actions Bot added the stale label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants