Skip to content

Branch support#437

Open
githubzilla wants to merge 32 commits intomainfrom
branch_support
Open

Branch support#437
githubzilla wants to merge 32 commits intomainfrom
branch_support

Conversation

@githubzilla
Copy link
Collaborator

@githubzilla githubzilla commented Mar 10, 2026

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

  • Configuration

    • Default data store branch changed from "development" to "main".
  • New Features

    • Added branch name configuration support with CLI flag and config fallback for backup snapshots.
    • Introduced branch fork capability for creating snapshots with alternate branch names.
  • Bug Fixes

    • Improved backup retry idempotency—repeated backup requests now return success instead of failure.
    • Removed assertion blocking empty backup paths in cloud storage deployments.

In cloud/shared-storage mode CreateClusterBackup does not supply a
dest_path because the snapshot is written directly to object storage
(no rsync transfer is needed).  The assertion fired for every cloud
backup request, causing a SIGABRT crash.  Replace with a comment
explaining the expected behaviour.
"main" is the canonical production branch name in eloqstore; using
"development" as the default was misleading.
Add INIReader support for eloq_dss_branch_name so it can be set in the
[store] section of the config file, consistent with other store flags.
Command-line flag still takes precedence over the config file value.
Apply the same CheckCommandLineFlagIsDefault + INIReader pattern as
storage_init.cpp so eloq_dss_branch_name can be set via the [local]
section of the DSS config file. Command-line flag still takes
precedence.
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR updates the default EloqDataStore branch from "development" to "main" and implements branch-aware snapshot and backup creation. It adds branch_name_ configuration to EloqStoreConfig and EloqStoreDataStore, applies consistent branch name resolution across storage initialization, enhances CreateSnapshotForBackup to support branching operations, and makes snapshot manager backup creation idempotent.

Changes

Cohort / File(s) Summary
Branch Configuration & Initialization
core/src/storage_init.cpp, store_handler/eloq_data_store_service/main.cpp
Changed default eloq_dss_branch_name flag from "development" to "main"; implemented two-source branch resolution logic that prefers CLI flag when provided, otherwise falls back to config file value.
EloqStore Data Store Setup
store_handler/eloq_data_store_service/eloq_store_config.h, store_handler/eloq_data_store_service/eloq_store_data_store.h, store_handler/eloq_data_store_service/eloq_store_data_store.cpp
Added branch_name_ member variable to EloqStoreConfig and EloqStoreDataStore; updated StartDB to pass branch_name_ to eloq_store_service_->Start; enhanced CreateSnapshotForBackup with conditional branching to support both current-branch snapshots and new-branch fork creation from backup timestamps.
Backup & Snapshot Handling
tx_service/src/remote/cc_node_service.cpp, tx_service/src/store/snapshot_manager.cpp
Removed dest_path non-empty assertion in CreateBackup to support cloud/shared-storage mode; updated snapshot manager to return Finished (idempotent success) instead of asserting when a backup with same name and Finished status already exists under the same node group.
Submodule Update
store_handler/eloq_data_store_service/eloqstore
Updated eloqstore subproject commit reference.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • tx_service#421: Updates eloqstore submodule pointer, similar dependency management.
  • tx_service#394: Modifies backup/snapshot creation flow and EloqStore integration for shared-storage support.
  • tx_service#378: Changes EloqStoreDataStore::CreateSnapshotForBackup snapshot/backup workflow and error handling.

Suggested reviewers

  • liunyl
  • thweetkomputer

Poem

🐰 From "dev" to "main" we hop with care,
Branch names configured everywhere!
Snapshots fork with timestamps bright,
Backups idempotent—retries done right! ✨

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only a submission checklist template with no implementation details, objectives, or explanations of the changes made. Provide a detailed description explaining the purpose of the branch support feature, what was changed, why it was necessary, and any relevant context or issue references.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Branch support' is vague and generic, using non-descriptive terminology that fails to clearly summarize the main changes in the changeset. Replace with a more specific title that describes the primary change, such as 'Add branch name configuration support for EloqStore and RocksDBCloud data stores' or 'Support configurable EloqStore branch selection.'

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch branch_support
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
store_handler/eloq_data_store_service/main.cpp (1)

73-73: ⚠️ Potential issue | 🟠 Major

Inconsistent default value: should be "main" per PR objective.

This file defines FLAGS_eloq_dss_branch_name with default "development", but core/src/storage_init.cpp (line 87) defines the same flag with default "main". The PR commit message states the intent is to change the default from "development" to "main".

This inconsistency means the standalone eloq_dss binary will use "development" while the integrated tx_service will use "main" by default, leading to potential confusion and different behaviors across deployments.

🐛 Proposed fix
-DEFINE_string(eloq_dss_branch_name, "development", "Data store branch name.");
+DEFINE_string(eloq_dss_branch_name, "main", "Data store branch name.");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@store_handler/eloq_data_store_service/main.cpp` at line 73, Change the
default for FLAGS_eloq_dss_branch_name in the DEFINE_string call
(DEFINE_string(eloq_dss_branch_name, "development", ...)) to "main" so it
matches the default used in core's storage_init (and the PR intent); update the
second argument of DEFINE_string for eloq_dss_branch_name from "development" to
"main" to keep behavior consistent across binaries.
🧹 Nitpick comments (1)
store_handler/eloq_data_store_service/eloq_store_data_store.cpp (1)

28-31: Remove duplicate #include <memory>.

<memory> is included twice: once at line 26 and again at line 30.

🧹 Proposed fix
 `#include` <cassert>
 `#include` <filesystem>
-#include <memory>

 `#include` "common.h"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@store_handler/eloq_data_store_service/eloq_store_data_store.cpp` around lines
28 - 31, The file has a duplicate include of the same header (<memory>) in the
include block; remove the redundant "#include <memory>" so only a single include
remains (locate and edit the include block containing <cassert>, <filesystem>,
and the duplicated <memory> lines and delete the extra <memory> entry).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@store_handler/eloq_data_store_service/main.cpp`:
- Line 73: Change the default for FLAGS_eloq_dss_branch_name in the
DEFINE_string call (DEFINE_string(eloq_dss_branch_name, "development", ...)) to
"main" so it matches the default used in core's storage_init (and the PR
intent); update the second argument of DEFINE_string for eloq_dss_branch_name
from "development" to "main" to keep behavior consistent across binaries.

---

Nitpick comments:
In `@store_handler/eloq_data_store_service/eloq_store_data_store.cpp`:
- Around line 28-31: The file has a duplicate include of the same header
(<memory>) in the include block; remove the redundant "#include <memory>" so
only a single include remains (locate and edit the include block containing
<cassert>, <filesystem>, and the duplicated <memory> lines and delete the extra
<memory> entry).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3d3d405-c84b-44f7-988b-2fb78905b8dc

📥 Commits

Reviewing files that changed from the base of the PR and between f94af00 and dcadd7b.

📒 Files selected for processing (8)
  • core/src/storage_init.cpp
  • store_handler/eloq_data_store_service/eloq_store_config.h
  • store_handler/eloq_data_store_service/eloq_store_data_store.cpp
  • store_handler/eloq_data_store_service/eloq_store_data_store.h
  • store_handler/eloq_data_store_service/eloqstore
  • store_handler/eloq_data_store_service/main.cpp
  • tx_service/src/remote/cc_node_service.cpp
  • tx_service/src/store/snapshot_manager.cpp

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@store_handler/eloq_data_store_service/eloq_store_config.cpp`:
- Around line 133-135: The change temporarily setting the flag
DEFINE_uint32(eloq_store_pages_per_file_shift, 2, ...) was committed with a
"temp" message and should not be merged to main; either revert the value to the
production default (e.g., restore the previous shift such as 11) and remove the
"temp" commit, or move this change to a feature/testing branch and update the
commit/PR message to describe the experiment; locate the DEFINE_uint32 call for
eloq_store_pages_per_file_shift in eloq_store_config.cpp and either restore the
original value or create a feature branch and update commit metadata before
merging.

In `@store_handler/eloq_data_store_service/main.cpp`:
- Around line 334-338: The branch_name assignment uses config_reader.GetString
with the wrong section ("local"); update the call so
eloq_store_config.branch_name_ falls back to config_reader.GetString("store",
"eloq_dss_branch_name", FLAGS_eloq_dss_branch_name) when
CheckCommandLineFlagIsDefault("eloq_dss_branch_name") is true, keeping the
existing use of FLAGS_eloq_dss_branch_name and the
CheckCommandLineFlagIsDefault/FLAGS_eloq_dss_branch_name logic intact.
- Around line 306-310: The code in main.cpp reads eloq_dss_branch_name from the
"local" section causing a mismatch with storage_init.cpp; update the config
lookup in the rocksdb_cloud_config.branch_name_ assignment (the call site using
CheckCommandLineFlagIsDefault, FLAGS_eloq_dss_branch_name and
config_reader.GetString) and the other similar occurrence that currently uses
"local" so both use the "store" section instead to match storage_init.cpp and
avoid silent misconfiguration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2a6d89b0-0a0c-4acc-b03b-5f6d47e697aa

📥 Commits

Reviewing files that changed from the base of the PR and between dcadd7b and e286474.

📒 Files selected for processing (3)
  • store_handler/eloq_data_store_service/eloq_store_config.cpp
  • store_handler/eloq_data_store_service/eloqstore
  • store_handler/eloq_data_store_service/main.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • store_handler/eloq_data_store_service/eloqstore

… 'local'

The branch_name config lookup in main.cpp used the 'local' INI section,
while storage_init.cpp uses the 'store' section. This mismatch caused
silent misconfiguration when users set eloq_dss_branch_name under the
[store] section. Updated both occurrences (rocksdb_cloud_config and
eloq_store_config) to use 'store' for consistency.
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.

1 participant