Skip to content

fix crash in malloc_usable_size and rocksdb_gcs compile#328

Merged
liunyl merged 1 commit into
mainfrom
fix_malloc_usable_size
Dec 29, 2025
Merged

fix crash in malloc_usable_size and rocksdb_gcs compile#328
liunyl merged 1 commit into
mainfrom
fix_malloc_usable_size

Conversation

@liunyl

@liunyl liunyl commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

Here are some reminders before you submit the pull request

  • Add tests for the change
  • Document changes
  • Reference the link of issue using fixes eloqdb/tx_service#issue_id
  • Reference the link of RFC if exists
  • Pass ./mtr --suite=mono_main,mono_multi,mono_basic

Summary by CodeRabbit

  • New Features

    • Added support for Google Cloud Storage as an additional RocksDB-backed storage option.
  • Bug Fixes

    • Improved stability in data flush paths by adding defensive checks to avoid unsafe memory accesses and potential crashes.
  • Chores

    • Refined storage backend configuration and moved AWS credential flags so they apply only to the S3 variant.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 29, 2025

Copy link
Copy Markdown

Walkthrough

Adds ELOQDSS_ROCKSDB_CLOUD_GCS build paths and linking in CMake, confines AWS credential flag declarations to the CLOUD_S3 RocksDB configuration, and guards malloc-usable-size calculations in local_cc_shards.cpp to avoid dereferencing empty vectors. (47 words)

Changes

Cohort / File(s) Summary
Build & RocksDB cloud sources
CMakeLists.txt
Add ELOQDSS_ROCKSDB_CLOUD_GCS branches to include RocksDB cloud/GCS sources (rocksdb_cloud_data_store.cpp, purger_event_listener.cpp, purger_sliding_window.cpp) and treat CLOUD_GCS as a ROCKSDB variant when selecting/linking ROCKSDB_LIBRARIES.
AWS credential conditional changes
core/src/storage_init.cpp, store_handler/eloq_data_store_service/rocksdb_config.cpp
Restrict aws_access_key_id / aws_secret_key declarations to S3-specific preprocessor guards (DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_S3); remove CLOUD_GCS from the block that previously exposed those flags.
Memory-safety in flush size accounting
tx_service/src/cc/local_cc_shards.cpp
Add defensive checks before using allocator-specific usable-size APIs (mi_malloc_usable_size / malloc_usable_size): avoid dereferencing empty/null data vectors, separate ASan vs non-ASan paths, and include malloc.h.

Sequence Diagram(s)

(omitted — changes are build/conditional and defensive memory guards without a new multi-component control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Add s3 url config #288: Modifies RocksDB cloud storage code paths and build sources (closely related to CMake and rocksdb_cloud_data_store changes).
  • fix compile  #258: Adjusts preprocessor conditions for AWS credential flag declarations (related to aws_access_key_id/aws_secret_key changes).
  • address comment #325: Changes flush_data_size memory-accounting in local_cc_shards.cpp (related memory-safety edits).

Suggested reviewers

  • githubzilla
  • MrGuin

Poem

🐰 I hopped through CMake, added GCS cheer,
Keys tucked to S3 now safely near,
I check each vector before I bite—
No more segfaults in the night! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the template checklist with unchecked items and no actual description of changes, missing required context about the fixes. Replace the checklist with a substantive description explaining the malloc_usable_size crash fix and rocksdb_gcs compilation changes, then address each checklist item.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: fixing a crash in malloc_usable_size and adding rocksdb_gcs compilation support.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_malloc_usable_size

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e52d5d and 939be54.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • core/src/storage_init.cpp
  • store_handler/eloq_data_store_service/rocksdb_config.cpp
  • tx_service/src/cc/local_cc_shards.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • store_handler/eloq_data_store_service/rocksdb_config.cpp
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: githubzilla
Repo: eloqdata/tx_service PR: 288
File: store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h:54-76
Timestamp: 2025-12-16T09:47:09.981Z
Learning: In RocksDBCloudDataStoreFactory::CreateDataStore (store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h), when oss_url is configured, the factory always appends /ds_<shard_id> to the oss_url. Users should not include the shard path in the oss_url themselves.
📚 Learning: 2025-12-16T09:47:09.981Z
Learnt from: githubzilla
Repo: eloqdata/tx_service PR: 288
File: store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h:54-76
Timestamp: 2025-12-16T09:47:09.981Z
Learning: In RocksDBCloudDataStoreFactory::CreateDataStore (store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h), when oss_url is configured, the factory always appends /ds_<shard_id> to the oss_url. Users should not include the shard path in the oss_url themselves.

Applied to files:

  • CMakeLists.txt
📚 Learning: 2025-10-09T03:56:58.811Z
Learnt from: thweetkomputer
Repo: eloqdata/tx_service PR: 150
File: include/cc/local_cc_shards.h:626-631
Timestamp: 2025-10-09T03:56:58.811Z
Learning: For the LocalCcShards class in include/cc/local_cc_shards.h: Writer locks (unique_lock) should continue using the original meta_data_mux_ (std::shared_mutex) rather than fast_meta_data_mux_ (FastMetaDataMutex) at this stage. Only reader locks may use the FastMetaDataMutex wrapper.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
📚 Learning: 2025-11-11T07:10:40.346Z
Learnt from: lzxddz
Repo: eloqdata/tx_service PR: 199
File: include/cc/local_cc_shards.h:233-234
Timestamp: 2025-11-11T07:10:40.346Z
Learning: In the LocalCcShards class in include/cc/local_cc_shards.h, the EnqueueCcRequest methods use `shard_code & 0x3FF` followed by `% cc_shards_.size()` to distribute work across processor cores for load balancing. This is intentional and separate from partition ID calculation. The 0x3FF mask creates a consistent distribution range (0-1023) before modulo by actual core count.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
📚 Learning: 2025-12-02T10:43:27.431Z
Learnt from: lokax
Repo: eloqdata/tx_service PR: 254
File: tx_service/src/cc/local_cc_shards.cpp:2949-3188
Timestamp: 2025-12-02T10:43:27.431Z
Learning: In tx_service/src/cc/local_cc_shards.cpp, whenever TryPinNodeGroupData is used, only call Sharder::Instance().UnpinNodeGroupData(node_group) if the recorded term is >= 0 (i.e., pin succeeded). Example: LocalCcShards::PostProcessFlushTaskEntries guards the unpin with `if (term >= 0)`.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
🔇 Additional comments (5)
core/src/storage_init.cpp (1)

72-76: AWS credential flags now correctly scoped to S3/DynamoDB paths

Restricting aws_access_key_id/aws_secret_key to DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_S3, DATA_STORE_TYPE_DYNAMODB, and LOG_STATE_TYPE_RKDB_S3 avoids leaking AWS-specific flags into GCS builds and matches the S3-only usage. Looks good.

tx_service/src/cc/local_cc_shards.cpp (3)

26-27: Guarded allocator-size usage fixes crash potential in non-jemalloc builds

Including <malloc.h> and switching the non-jemalloc path to:

  • Skip *.data() when the vectors are empty, and
  • Use malloc_usable_size under __SANITIZE_ADDRESS__ vs mi_malloc_usable_size otherwise,

prevents calling the wrong usable-size API on ASan-managed allocations and avoids dereferencing invalid/empty pointers while computing flush_data_size. This directly addresses the malloc_usable_size crash without changing jemalloc behaviour.

One thing to double-check in your toolchains is that __SANITIZE_ADDRESS__ is indeed defined in all ASan builds you care about; if you also run Clang in modes that only expose __has_feature(address_sanitizer), you might want to extend the condition accordingly.

Also applies to: 4098-4142


5042-5083: Same allocator-guard pattern applied to hash-partition data sync

The hash-partition path now mirrors the range-partition logic by:

  • Guarding malloc_usable_size/mi_malloc_usable_size behind empty checks.
  • Selecting malloc_usable_size only under __SANITIZE_ADDRESS__.

This keeps flush_data_size accounting consistent across both code paths and avoids ASan/mimalloc mismatches or null-pointer issues during hash-partition checkpointing.


3060-3093: Pinned node-group term caching and guarded unpinning align with TryPin semantics

PostProcessFlushTaskEntries now:

  • Caches TryPinNodeGroupData(node_group_id) results in pinned_node_group_terms_ to reuse across all tasks for the same node group.
  • Treats a mismatched term as TERM_MISMATCH but still tracks the pin result in the cache.
  • Unpins each node group exactly once at the end of processing, and only when the recorded term >= 0.

This removes the prior risk of calling UnpinNodeGroupData when TryPinNodeGroupData failed, and avoids redundant pin/unpin churn when many tasks share a node group. The behaviour also matches the guidance that unpin should only be invoked on successfully pinned node groups.

Also applies to: 3283-3290

CMakeLists.txt (1)

37-60: ELOQDSS_ROCKSDB_CLOUD_GCS wiring looks consistent; verify GCS library linkage

The new ELOQDSS_ROCKSDB_CLOUD_GCS path is plumbed through coherently:

  • WITH_DATA_STORE options and the DATA_STORE_USES_* flags now distinguish local, cloud S3, and cloud GCS RocksDB and keep DATA_STORE_USES_ROCKSDB in sync.
  • WITH_LOG_STATE auto-selection/validation now correctly enforces ROCKSDB_CLOUD_GCS when the data store uses a cloud GCS-backed RocksDB.
  • DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS is defined and used to pull in the same ELOQDSS data store service machinery as the S3 variant, but without the S3-only s3_file_downloader.cpp.
  • Linking treats ELOQDSS_ROCKSDB_CLOUD_GCS like the other ELOQDSS RocksDB variants by feeding ${ROCKSDB_LIBRARIES} into DATA_SUBSTRATE_LINK_LIBS.

Two things you may want to double-check:

  1. For ELOQDSS_ROCKSDB_CLOUD_GCS, only the “common RocksDB Cloud setup” populates include paths; any GCS-specific libraries (or rocksdb-cloud libraries that support GCS) must already be encapsulated in ${ROCKSDB_LIBRARIES} or added elsewhere (e.g., in build_tx_service.cmake). If your environment requires a distinct rocksdb-cloud-gcs (or similar) library, you’ll likely want to mirror the S3 find_library logic for that as well.

  2. If bare "ROCKSDB_CLOUD_S3" / "ROCKSDB_CLOUD_GCS" values are no longer intended as valid WITH_DATA_STORE settings (since they’re not in the CACHE STRINGS), consider either:

    • Adding them to the allowed STRINGS and giving them compile definitions, or
    • Dropping them from the conditional in the RocksDB Cloud config block to reduce confusion.

Functionally, though, the new CLOUD_GCS variant should now compile and link on par with the CLOUD_S3 variant, assuming the underlying RocksDB Cloud + GCS libraries are present as expected.

Also applies to: 75-77, 117-123, 153-204, 293-327, 363-371


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CMakeLists.txt (1)

363-371: GCS variant lacks proper cloud RocksDB library configuration

The GCS variant is linked against ROCKSDB_LIBRARIES, but this variable is only populated with S3-specific cloud libraries (rocksdb-cloud-aws). There is no corresponding GCS-specific cloud RocksDB library added to ROCKSDB_LIBRARIES. The "Common RocksDB Cloud setup" section (lines 197-202) only configures include paths, not library dependencies. Add a find_library call for the GCS variant with the appropriate RocksDB-cloud GCS library, or ensure ROCKSDB_LIBRARIES is properly populated for GCS builds.

🧹 Nitpick comments (3)
tx_service/src/cc/local_cc_shards.cpp (2)

4107-4123: Good fix: guard mi_malloc_usable_size calls with empty() checks

The added references and empty() checks around mi_malloc_usable_size avoid passing null/invalid pointers when the vectors are empty, which directly addresses the reported SEGV without changing behavior for non‑empty batches. The slight under‑accounting for reserved‑but‑empty vectors is acceptable for this quota heuristic.


5030-5047: Consistent crash‑proofing for hash‑partition data sync quota

Mirroring the empty() guard pattern for the hash‑partition path keeps the quota logic consistent with the range‑partition path and eliminates the same potential crash when those vectors are empty.

CMakeLists.txt (1)

293-327: ELOQDSS_ROCKSDB_CLOUD_GCS source selection looks correct; verify downloader coverage

Including rocksdb_cloud_data_store.cpp, purger_event_listener.cpp, and purger_sliding_window.cpp for ELOQDSS_ROCKSDB_CLOUD_GCS matches the S3 cloud path and should unblock GCS builds. Since the S3 path also pulls in s3_file_downloader.cpp, double‑check that the GCS backend either doesn’t need an equivalent downloader or that any GCS‑specific downloader source is wired in elsewhere.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 527c2d3 and 3b4e9de.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • core/src/storage_init.cpp
  • store_handler/eloq_data_store_service/rocksdb_config.cpp
  • tx_service/src/cc/local_cc_shards.cpp
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: githubzilla
Repo: eloqdata/tx_service PR: 288
File: store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h:54-76
Timestamp: 2025-12-16T09:47:09.981Z
Learning: In RocksDBCloudDataStoreFactory::CreateDataStore (store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h), when oss_url is configured, the factory always appends /ds_<shard_id> to the oss_url. Users should not include the shard path in the oss_url themselves.
📚 Learning: 2025-12-16T09:47:09.981Z
Learnt from: githubzilla
Repo: eloqdata/tx_service PR: 288
File: store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h:54-76
Timestamp: 2025-12-16T09:47:09.981Z
Learning: In RocksDBCloudDataStoreFactory::CreateDataStore (store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h), when oss_url is configured, the factory always appends /ds_<shard_id> to the oss_url. Users should not include the shard path in the oss_url themselves.

Applied to files:

  • CMakeLists.txt
📚 Learning: 2025-11-11T07:10:40.346Z
Learnt from: lzxddz
Repo: eloqdata/tx_service PR: 199
File: include/cc/local_cc_shards.h:233-234
Timestamp: 2025-11-11T07:10:40.346Z
Learning: In the LocalCcShards class in include/cc/local_cc_shards.h, the EnqueueCcRequest methods use `shard_code & 0x3FF` followed by `% cc_shards_.size()` to distribute work across processor cores for load balancing. This is intentional and separate from partition ID calculation. The 0x3FF mask creates a consistent distribution range (0-1023) before modulo by actual core count.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
📚 Learning: 2025-10-09T03:56:58.811Z
Learnt from: thweetkomputer
Repo: eloqdata/tx_service PR: 150
File: include/cc/local_cc_shards.h:626-631
Timestamp: 2025-10-09T03:56:58.811Z
Learning: For the LocalCcShards class in include/cc/local_cc_shards.h: Writer locks (unique_lock) should continue using the original meta_data_mux_ (std::shared_mutex) rather than fast_meta_data_mux_ (FastMetaDataMutex) at this stage. Only reader locks may use the FastMetaDataMutex wrapper.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
📚 Learning: 2025-12-02T10:43:27.431Z
Learnt from: lokax
Repo: eloqdata/tx_service PR: 254
File: tx_service/src/cc/local_cc_shards.cpp:2949-3188
Timestamp: 2025-12-02T10:43:27.431Z
Learning: In tx_service/src/cc/local_cc_shards.cpp, whenever TryPinNodeGroupData is used, only call Sharder::Instance().UnpinNodeGroupData(node_group) if the recorded term is >= 0 (i.e., pin succeeded). Example: LocalCcShards::PostProcessFlushTaskEntries guards the unpin with `if (term >= 0)`.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
🔇 Additional comments (2)
store_handler/eloq_data_store_service/rocksdb_config.cpp (1)

280-284: LGTM! Correctly isolates AWS credentials to S3 backend.

The change properly restricts AWS credential definitions to the S3 backend only, removing the dependency on AWS SDK when compiling with GCS backend. This directly addresses the "rocksdb_gcs compile" issue mentioned in the PR title.

core/src/storage_init.cpp (1)

72-78: LGTM! AWS credentials correctly scoped to S3 and DynamoDB backends.

The change appropriately removes the GCS backend from the AWS credential conditional, ensuring GCS compilation doesn't require AWS SDK dependencies. This aligns with the parallel changes in rocksdb_config.cpp.

Minor: Line 75 has trailing whitespace before the closing parenthesis.

@liunyl liunyl force-pushed the fix_malloc_usable_size branch from 3b4e9de to 2e52d5d Compare December 29, 2025 09:40

@coderabbitai coderabbitai 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.

Actionable comments posted: 0

🧹 Nitpick comments (4)
core/src/storage_init.cpp (1)

75-75: Minor: Trailing whitespace.

Line 75 has trailing whitespace after the condition. Consider removing it for consistency.

🔎 Proposed fix
-#elif defined(DATA_STORE_TYPE_DYNAMODB) || defined(LOG_STATE_TYPE_RKDB_S3) 
+#elif defined(DATA_STORE_TYPE_DYNAMODB) || defined(LOG_STATE_TYPE_RKDB_S3)
tx_service/src/cc/local_cc_shards.cpp (3)

24-28: <malloc.h> include is fine but may be non‑portable

Including <malloc.h> is needed for malloc_usable_size, but it is GNU/glibc‑specific. If this code must build on non‑Linux or non‑glibc platforms (e.g. macOS, BSD), you may need a small portability shim (e.g. #ifdef __GLIBC__ with an alternative such as <malloc/malloc.h> or a fallback) rather than unconditionally including <malloc.h>.

Please confirm whether tx_service is guaranteed to build only on glibc/Linux, or if you need a guarded include for other targets.


4098-4142: ASan/mimalloc guarded *_usable_size usage looks correct; consider de‑duplicating and double‑check allocator assumptions

The new logic:

  • Skips malloc_usable_size / mi_malloc_usable_size calls when the vectors are empty.
  • Uses malloc_usable_size under __SANITIZE_ADDRESS__ and mi_malloc_usable_size otherwise, matching the allocator expected in ASan vs mimalloc builds.
  • Avoids the crash seen when calling mi_malloc_usable_size on buffers not owned by mimalloc.

This looks reasonable and should eliminate the observed SEGV in non‑jemalloc range‑partition paths.

Two follow‑ups to consider:

  1. Allocator/build assumption: This relies on ASan builds not also using mimalloc as the allocator for these vectors. If you ever combine ASan with mimalloc overrides, the malloc_usable_size branch could again be incompatible with the actual allocator.

  2. Duplication: The ASan/mimalloc + .empty() pattern is duplicated here and in the hash‑partition path. A tiny helper would keep behavior consistent and easier to audit, for example:

    template <class Vec>
    static size_t UsableStorageSize(const Vec& v) {
      if (v.empty()) return 0;
    #ifdef __SANITIZE_ADDRESS__
      return malloc_usable_size(v.data());
    #else
      return mi_malloc_usable_size(v.data());
    #endif
    }

    and then sum UsableStorageSize(...) for each vector.

Please confirm that ASan builds in this repo do not also route allocations through mimalloc; if they do, we should revisit which *_usable_size API is correct under that configuration and potentially centralize this in a helper as above.


5042-5084: Hash‑partition flush_data_size accounting changes mirror the range path; keep them in sync via a helper

The hash‑partition branch now mirrors the new range‑partition behavior: under non‑jemalloc builds it:

  • Guards calls on .empty() vectors.
  • Uses malloc_usable_size under __SANITIZE_ADDRESS__ and mi_malloc_usable_size otherwise.

That aligns the two code paths and should prevent the same crash in the hash‑partition case.

Given the logic is now duplicated almost verbatim between range and hash paths, it would be safer long‑term to factor out a shared helper (as suggested in the previous comment) so future fixes apply uniformly.

If you introduce a helper for the range path, please apply it here too to avoid divergence between partition types; also verify in your CI matrix that both ASan and non‑ASan, WITH_JEMALLOC and non‑JEMALLOC builds all see the intended branch.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b4e9de and 2e52d5d.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • core/src/storage_init.cpp
  • store_handler/eloq_data_store_service/rocksdb_config.cpp
  • tx_service/src/cc/local_cc_shards.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • store_handler/eloq_data_store_service/rocksdb_config.cpp
  • CMakeLists.txt
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: githubzilla
Repo: eloqdata/tx_service PR: 288
File: store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h:54-76
Timestamp: 2025-12-16T09:47:09.981Z
Learning: In RocksDBCloudDataStoreFactory::CreateDataStore (store_handler/eloq_data_store_service/rocksdb_cloud_data_store_factory.h), when oss_url is configured, the factory always appends /ds_<shard_id> to the oss_url. Users should not include the shard path in the oss_url themselves.
📚 Learning: 2025-11-11T07:10:40.346Z
Learnt from: lzxddz
Repo: eloqdata/tx_service PR: 199
File: include/cc/local_cc_shards.h:233-234
Timestamp: 2025-11-11T07:10:40.346Z
Learning: In the LocalCcShards class in include/cc/local_cc_shards.h, the EnqueueCcRequest methods use `shard_code & 0x3FF` followed by `% cc_shards_.size()` to distribute work across processor cores for load balancing. This is intentional and separate from partition ID calculation. The 0x3FF mask creates a consistent distribution range (0-1023) before modulo by actual core count.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
📚 Learning: 2025-10-09T03:56:58.811Z
Learnt from: thweetkomputer
Repo: eloqdata/tx_service PR: 150
File: include/cc/local_cc_shards.h:626-631
Timestamp: 2025-10-09T03:56:58.811Z
Learning: For the LocalCcShards class in include/cc/local_cc_shards.h: Writer locks (unique_lock) should continue using the original meta_data_mux_ (std::shared_mutex) rather than fast_meta_data_mux_ (FastMetaDataMutex) at this stage. Only reader locks may use the FastMetaDataMutex wrapper.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
📚 Learning: 2025-12-02T10:43:27.431Z
Learnt from: lokax
Repo: eloqdata/tx_service PR: 254
File: tx_service/src/cc/local_cc_shards.cpp:2949-3188
Timestamp: 2025-12-02T10:43:27.431Z
Learning: In tx_service/src/cc/local_cc_shards.cpp, whenever TryPinNodeGroupData is used, only call Sharder::Instance().UnpinNodeGroupData(node_group) if the recorded term is >= 0 (i.e., pin succeeded). Example: LocalCcShards::PostProcessFlushTaskEntries guards the unpin with `if (term >= 0)`.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
📚 Learning: 2025-10-20T04:30:07.884Z
Learnt from: liunyl
Repo: eloqdata/tx_service PR: 149
File: include/cc/cc_request.h:1876-1927
Timestamp: 2025-10-20T04:30:07.884Z
Learning: ScanNextBatchCc in include/cc/cc_request.h is used only for hash-partition scans; range-partition scans are handled by ScanSliceCc.

Applied to files:

  • tx_service/src/cc/local_cc_shards.cpp
🔇 Additional comments (1)
core/src/storage_init.cpp (1)

72-78: Remove trailing whitespace on line 75.

The preprocessor guard logic in lines 72-78 is correct. When DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_S3 is defined, the flags are defined in rocksdb_config.cpp (lines 281-283) and declared here; when only LOG_STATE_TYPE_RKDB_S3 or DATA_STORE_TYPE_DYNAMODB are defined, the flags are defined in this file's elif branch. No issue with flag availability across configurations.

The only concern is the trailing space at the end of line 75 (#elif defined(...)).

Likely an incorrect or invalid review comment.

@liunyl liunyl force-pushed the fix_malloc_usable_size branch from 2e52d5d to 939be54 Compare December 29, 2025 09:47
@liunyl liunyl merged commit 681ecf1 into main Dec 29, 2025
2 of 4 checks passed
@liunyl liunyl deleted the fix_malloc_usable_size branch December 29, 2025 09:50
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