Conversation
WalkthroughUpdates include a data_substrate submodule pointer bump, build flag changes enabling MYSQLD_LIBRARY_MODE for library builds, conditional library-mode startup argv handling in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-11-07T07:10:40.633ZApplied to files:
🔇 Additional comments (3)
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: 0
🧹 Nitpick comments (1)
sql/mysqld.cc (1)
5567-5608: Argv wrapper forload_defaults_or_exitlooks correct; a couple of minor nitsThe new
load_default_argvconstruction preserves behavior for normal binaries and adds the desired library-mode injection of--defaults-file=...and--bootstrapbeforeload_defaults_or_exit, with correct sizing and null termination. A few optional refinements:
- The comment “append
--eloqsql_configand--bootstrap” is slightly misleading; the code actually appends--defaults-file=<eloqsql_config>and--bootstrap. Updating the comment would prevent confusion.defaults_file_arg.c_str()is passed viaconst_cast<char*>. Todayload_defaults_or_exitonly reads these strings, but if that ever changed to modify them in-place it would be undefined behavior. If you want extra safety, you could allocate a writable buffer (e.g. viamy_strdup()or a smallstd::vector<char>) for that entry.These are polish-level; functionally the block is fine.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
data_substrate(1 hunks)sql/mysqld.cc(4 hunks)storage/eloq/CMakeLists.txt(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: githubzilla
Repo: eloqdata/eloqsql PR: 154
File: storage/eloq/ha_eloq.cc:2571-2623
Timestamp: 2025-11-07T07:10:40.633Z
Learning: Repo: eloqdata/eloqsql PR: 154
File/Area: storage/eloq/ha_eloq.cc (eloq_init_func cluster membership resolution)
Learning: In this repo’s ng_config, the local node is guaranteed to be a candidate (NodeConfig::is_candidate_ == true). Therefore, assigning native_ng_id only when is_candidate_ is true is acceptable; the key improvement is to break early from both loops once the local node is found.
📚 Learning: 2025-09-25T11:41:40.111Z
Learnt from: githubzilla
Repo: eloqdata/eloqsql PR: 127
File: storage/eloq/build_log_service.cmake:97-124
Timestamp: 2025-09-25T11:41:40.111Z
Learning: The `storage/eloq/build_log_service.cmake` file is specifically for the open log service build and only supports ROCKSDB as its log state backend. Unlike the enterprise version in `build_eloq_log_service.cmake`, it does not need to handle cloud-specific variants like ROCKSDB_CLOUD_S3 or ROCKSDB_CLOUD_GCS.
Applied to files:
storage/eloq/CMakeLists.txt
📚 Learning: 2025-11-07T07:10:40.633Z
Learnt from: githubzilla
Repo: eloqdata/eloqsql PR: 154
File: storage/eloq/ha_eloq.cc:2571-2623
Timestamp: 2025-11-07T07:10:40.633Z
Learning: Repo: eloqdata/eloqsql PR: 154
File/Area: storage/eloq/ha_eloq.cc (eloq_init_func cluster membership resolution)
Learning: In this repo’s ng_config, the local node is guaranteed to be a candidate (NodeConfig::is_candidate_ == true). Therefore, assigning native_ng_id only when is_candidate_ is true is acceptable; the key improvement is to break early from both loops once the local node is found.
Applied to files:
storage/eloq/CMakeLists.txt
📚 Learning: 2025-11-07T05:12:43.208Z
Learnt from: githubzilla
Repo: eloqdata/eloqsql PR: 154
File: storage/eloq/ha_eloq.cc:2770-2781
Timestamp: 2025-11-07T05:12:43.208Z
Learning: In eloqdata/eloqsql, storage/eloq/ha_eloq.cc (KV_ELOQDS path): for DATA_STORE_TYPE_ELOQDSS_ROCKSDB (local RocksDB), each eloqsql instance owns its own RocksDB instance, and passing create_if_missing=true to DataStoreService::StartService is intentional and safe.
Applied to files:
storage/eloq/CMakeLists.txt
🔇 Additional comments (3)
data_substrate (1)
1-1: Provide context for submodule pointer update and verify the related changes.This file only shows a submodule pointer update. To properly review this change, I need:
Context on the actual changes: The AI summary mentions this PR also updates
sql/mysqld.ccandstorage/eloq/CMakeLists.txtto supportMYSQLD_LIBRARY_MODE, but those files are not provided for review.Verification of the submodule commit: Confirm that commit
2e1fb679e115452b2d92fd05fe06fe78e599ce45in thedata_substraterepository contains the intended changes that align with the PR objective ("fix eloqdb compile").Please provide or clarify:
- The changes in
sql/mysqld.ccandstorage/eloq/CMakeLists.txtrelated toMYSQLD_LIBRARY_MODEsupport- A summary of what was changed in the
data_substratesubmodule at the new commit to fix the compilation issue- Any build logs or specific compilation errors that this PR resolves
storage/eloq/CMakeLists.txt (1)
24-26: Based on my verification:
BUILD_ELOQSQL_AS_LIBRARY is properly defined: It's declared as an
option()in the rootCMakeLists.txtwith defaultOFF, and correctly propagates to subdirectories likestorage/eloq/.MYSQLD_LIBRARY_MODE usage is guarded: The define is consistently used with
#ifdef MYSQLD_LIBRARY_MODEguards in source files (storage/eloq/ha_eloq.cc,sql/mysqld.cc,sql/main.cc), ensuring conditional compilation works correctly.Redundant definition: The root
CMakeLists.txtalready definesMYSQLD_LIBRARY_MODEunder the same condition. The definition instorage/eloq/CMakeLists.txtlines 24-26 is redundant but harmless.The conditional logic is sound and will function correctly. The original review concern about verification is unnecessary—the variable is properly defined upstream and the implementation is correct.
sql/mysqld.cc (1)
645-648: Switching toDECLARE_stringforeloqsql_configis appropriateUsing
DECLARE_string(eloqsql_config)here (with a singleDEFINE_stringin another translation unit) is the right pattern for gflags flags in shared/library builds and avoids multiple-definition/link issues. No further changes needed around this declaration.
Summary by CodeRabbit
Chores
Bug Fixes
Style
✏️ Tip: You can customize this high-level summary in your review settings.