Remove USE_ROCKSDB_LOG_STATE and WITH_ROCKSDB_CLOUD compile flag - #145
Conversation
|
Warning Rate limit exceeded@githubzilla has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 17 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughConsolidated log-state selection into a single cached CMake variable Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Cfg as CMake (configure)
participant Cache as WITH_LOG_STATE
participant Compile as add_compile_definitions
Cfg->>Cache: read cached WITH_LOG_STATE
alt MEMORY
Cache-->>Compile: LOG_STATE_TYPE_MEM
else ROCKSDB
Cache-->>Compile: LOG_STATE_TYPE_RKDB
else ROCKSDB_CLOUD_S3
Cache-->>Compile: LOG_STATE_TYPE_RKDB_S3
else ROCKSDB_CLOUD_GCS
Cache-->>Compile: LOG_STATE_TYPE_RKDB_GCS
else Unknown
Cache-->>Cfg: message(FATAL_ERROR "Unknown WITH_LOG_STATE: ...")
end
Note over Compile: Definitions applied at configure time\nand visible to root and tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
CMakeLists.txt (1)
28-39: Prefer target-scoped definitions (follow-up).Longer term, move these to target_compile_definitions for txservice, host_manager, and test targets to avoid global pollution. Create a small INTERFACE lib (e.g., log_state_config) carrying these defines and link it where needed.
tests/CMakeLists.txt (1)
8-23: Avoid duplication: centralize the WITH_LOG_STATE-to-macros mapping.Factor the selection logic into a shared CMake module (e.g., cmake/LogStateConfig.cmake) and include() it in both root and tests to keep behavior in sync.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CMakeLists.txt(1 hunks)tests/CMakeLists.txt(1 hunks)
🔇 Additional comments (4)
CMakeLists.txt (2)
24-26: Good: single source of truth for log state selection.WITH_LOG_STATE with constrained values and a NOTICE print is a clear improvement over the legacy flags.
24-39: Confirm legacy flags removed and that LOG_STATE_TYPE_ are actually consumed*
- Search found no occurrences of USE_ROCKSDB_LOG_STATE or WITH_ROCKSDB_CLOUD.
- LOG_STATE_TYPE_* are defined via add_compile_definitions only in CMakeLists.txt and tests/CMakeLists.txt; no source-level references were found — confirm code paths check/use these macros or that the build correctly propagates them.
tests/CMakeLists.txt (2)
8-11: LGTM on consolidating WITH_LOG_STATE in tests too.Keeping the allowed values aligned with the root is good for consistency.
8-23: Sanity-check cloud variants build.If ROCKSDB_CLOUD_S3/GCS require extra deps, add corresponding find_package/flags where needed or conditionally gate tests to avoid failing CI when those SDKs are absent.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
CMakeLists.txt (1)
38-38: Improve fatal error message with allowed values.Helps users immediately see valid options.
Apply this diff:
- message(FATAL_ERROR "Unknown WITH_LOG_STATE: ${WITH_LOG_STATE}") + message(FATAL_ERROR "Unknown WITH_LOG_STATE: ${WITH_LOG_STATE} (allowed: MEMORY, ROCKSDB, ROCKSDB_CLOUD_S3, ROCKSDB_CLOUD_GCS)")tests/CMakeLists.txt (1)
7-19: Avoid duplication of the LOG_STATE mapping between root and tests.Factor the mapping into a shared CMake include to prevent drift.
Example approach:
- Create cmake/LogState.cmake:
# cmake/LogState.cmake if(WITH_LOG_STATE STREQUAL "MEMORY") add_compile_definitions(LOG_STATE_TYPE_MEM) elseif(WITH_LOG_STATE STREQUAL "ROCKSDB") add_compile_definitions(LOG_STATE_TYPE_RKDB) elseif(WITH_LOG_STATE STREQUAL "ROCKSDB_CLOUD_S3") add_compile_definitions(LOG_STATE_TYPE_RKDB_S3) elseif(WITH_LOG_STATE STREQUAL "ROCKSDB_CLOUD_GCS") add_compile_definitions(LOG_STATE_TYPE_RKDB_GCS) else() message(FATAL_ERROR "Unknown WITH_LOG_STATE: ${WITH_LOG_STATE} (allowed: MEMORY, ROCKSDB, ROCKSDB_CLOUD_S3, ROCKSDB_CLOUD_GCS)") endif()
- Then replace the duplicated blocks with:
include(${CMAKE_SOURCE_DIR}/cmake/LogState.cmake)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CMakeLists.txt(2 hunks)tests/CMakeLists.txt(1 hunks)
🔇 Additional comments (5)
CMakeLists.txt (3)
1-1: Min version bump is appropriate for add_compile_definitions.Setting CMake >= 3.12 aligns with add_compile_definitions usage.
28-39: Earlier concern resolved by raising min CMake.Using add_compile_definitions is fine with VERSION 3.12+.
24-25: No stale flags found — WITH_LOG_STATE replaces the removed flagsUSE_ROCKSDB_LOG_STATE and WITH_ROCKSDB_CLOUD are absent. CMakeLists.txt and tests/CMakeLists.txt define WITH_LOG_STATE (MEMORY, ROCKSDB, ROCKSDB_CLOUD_S3, ROCKSDB_CLOUD_GCS) and add LOG_STATE_TYPE_{MEM,RKDB,RKDB_S3,RKDB_GCS); remaining related macro: src/store/snapshot_manager.cpp:449-450 (ROCKSDB_CLOUD_FS_TYPE).
tests/CMakeLists.txt (2)
1-1: Min version aligns with add_compile_definitions, but see NOTICE usage below.If keeping 3.12, adjust message level accordingly.
11-21: Earlier CMake compatibility issue appears resolved.add_compile_definitions is safe now that min is 3.12.
acf638f to
18d6adb
Compare
18d6adb to
b67d3c5
Compare
Here are some reminders before you submit the pull request
fixes eloqdb/tx_service#issue_id./mtr --suite=mono_main,mono_multi,mono_basicSummary by CodeRabbit
Refactor
Chores