Avoid cloud object listings during RocksDB Cloud startup - #554
Avoid cloud object listings during RocksDB Cloud startup#554thweetkomputer wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesCloud listing restoration
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to The change is localized to startup behavior and preserves normal runtime directory visibility; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Context
During RocksDB Cloud failover,
DBCloud::Open()completed in 364 ms butOpenDataStoretook 70.272 s. The startup log contained two approximately 34-second gaps: one atSetOptions(disable_auto_compactions=false)and one atSetDBOptions(max_open_files=-1).Both APIs persist a local OPTIONS file. RocksDB then cleans obsolete OPTIONS files through
GetChildren(); afterDBCloud::Open(), EloqDS had already restoredskip_cloud_files_in_getchildren=false, so each cleanup issued an OBSListObjectsV2over the complete DB object prefix. OPTIONS files are local-only, so those cloud listings do not contribute to correctness.Behavior before and after
Before: startup restores cloud-aware directory listing immediately after
DBCloud::Open(). The two subsequent startup option updates can each list every cloud object, extending failover by roughly the size and latency of two full-prefix listings.After: cloud listings remain skipped until both startup option updates finish. Normal cloud-aware
GetChildren()behavior is restored before background work and warm-up resume. Runtime behavior and persisted options are unchanged.Implementation
skip_cloud_files_in_getchildren=truethroughSetOptions()andSetDBOptions().Design decisions and alternatives
The change narrows an existing startup-only optimization instead of permanently disabling cloud listings.
GetMutableCloudFileSystemOptions()exposes the live option object, andCloudFileSystemImpl::GetChildren()reads this flag on each call, so no reopen is required.Leaving the flag permanently enabled was rejected because it would change runtime directory visibility. Restoring it immediately after
DBCloud::Open()preserves the two expensive startup listings and does not solve the failover delay.Test plan
Commands and results:
A production-scale OBS failover timing test was not run in this workspace.
Risk assessment
Low and startup-scoped. The mutable flag is restored before background work resumes, avoiding concurrent background
GetChildren()calls observing the temporary value. Failure paths also restore it. No transaction visibility, durability boundary, on-disk format, or cloud object lifecycle behavior changes.The main residual risk is that an unrecognized synchronous startup operation between DB open and restoration requires cloud-only directory entries. Existing DB open already runs with listings skipped, and the added interval contains epoch validation plus local OPTIONS persistence.
Rollback plan
Revert this PR. That restores the previous timing of the option reset and the two cloud-aware startup cleanups; no data or configuration migration is required.
Reviewer guide
Review
RocksDBCloudDataStore::OpenCloudDB()and verify these invariants:skip_cloud_files_in_getchildrenstays true across both startup option writes.Follow-up work
Run an OBS deployment failover benchmark and confirm the two approximately 34-second gaps disappear.
Summary by CodeRabbit