Skip to content

Fix for backup operation#394

Merged
yi-xmu merged 4 commits intomainfrom
fix_backup
Feb 3, 2026
Merged

Fix for backup operation#394
yi-xmu merged 4 commits intomainfrom
fix_backup

Conversation

@yi-xmu
Copy link
Collaborator

@yi-xmu yi-xmu commented Feb 2, 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

  • New Features

    • Snapshot removal: users can remove backup snapshots to better manage backup storage and lifecycle.
    • ELOQSTORE backup support: backup snapshot creation now supports the ELOQSTORE storage backend alongside existing providers.
  • Chores

    • Internal submodule updated with no behavioral changes.
    • Build/dependency visibility adjusted (no runtime behavior change).

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Warning

Rate limit exceeded

@yi-xmu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Walkthrough

Adds ELOQSTORE to the shared-storage backup snapshot creation path, bumps the eloqstore submodule pointer, makes absl::flat_hash_map a public link dependency of eloqstore, and adds RemoveBackupSnapshot to DataStoreServiceClient.

Changes

Cohort / File(s) Summary
DataStoreServiceClient header
store_handler/data_store_service_client.h
Adds bool RemoveBackupSnapshot(const std::string &backup_name) override; with an inline implementation returning true.
Eloqstore submodule
store_handler/eloq_data_store_service/eloqstore
Updates submodule pointer (reference bump).
Snapshot manager backend enablement
tx_service/src/store/snapshot_manager.cpp
Extends preprocessor condition to include DATA_STORE_TYPE_ELOQDSS_ELOQSTORE, so CreateSnapshotForBackup(...) is invoked for ELOQSTORE in the shared-storage code path.
CMake public linkage
store_handler/eloq_data_store_service/build_eloq_store.cmake
Changes eloqstore target to expose absl::flat_hash_map as a PUBLIC dependency (visibility change in link declaration).

Sequence Diagram(s)

sequenceDiagram
    participant SnapshotMgr as SnapshotManager
    participant DSSClient as DataStoreServiceClient
    participant EloqStore as EloqStore

    SnapshotMgr->>DSSClient: Request CreateSnapshotForBackup(...)
    DSSClient->>EloqStore: Forward snapshot creation request
    EloqStore-->>DSSClient: Snapshot created (success)
    DSSClient-->>SnapshotMgr: Return success
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • liunyl
  • thweetkomputer

Poem

🐰 I hopped into code with a keen little squeak,
ELOQSTORE now listens when backups seek.
A pointer got bumped, a link made more fair,
And a tiny new method floats light as air.
Snap! — the snapshot hums, carrots tossed in the air. 🎋

🚥 Pre-merge checks | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is an unchecked template with no actual content filling in the required sections for issue references, RFC details, or change documentation. Complete the checklist by providing specific details: reference the issue being fixed, document the changes made, include RFC link if applicable, and confirm test results.
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 'Fix for backup operation' is vague and generic, using non-descriptive language that doesn't convey specific details about what was fixed or which components were changed. Replace with a more specific title describing the actual fix, such as 'Add RemoveBackupSnapshot override and extend ELOQSTORE support to backup path' or similar.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_backup

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.

@yi-xmu yi-xmu self-assigned this Feb 2, 2026
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: 2

🤖 Fix all issues with AI agents
In `@store_handler/data_store_service_client.h`:
- Around line 470-473: The declaration of RemoveBackupSnapshot has an extra
semicolon before the following function body, producing a stray block; fix by
either removing the semicolon and turning the declaration+body into a single
inline definition "bool RemoveBackupSnapshot(const std::string &backup_name)
override { ... }" inside the header (ensure the signature includes override and
the body directly) or move the definition into the .cpp as "bool
DataStoreServiceClient::RemoveBackupSnapshot(const std::string &backup_name) {
... }" and keep only the declaration in the header; target the
RemoveBackupSnapshot symbol to apply this change.

In `@store_handler/eloq_data_store_service/eloqstore`:
- Line 1: The declaration/definition for RemoveBackupSnapshot in
store_handler/data_store_service_client.h is syntactically invalid due to a
stray semicolon after the override; fix by making it a proper definition: remove
the semicolon after "override" so the method reads as a single definition for
bool RemoveBackupSnapshot(const std::string &backup_name) override { return
true; } (alternatively, if it should be a pure declaration keep the semicolon
and remove the following function body), ensuring the signature and body belong
together in the class containing RemoveBackupSnapshot.

@yi-xmu yi-xmu requested a review from liunyl February 2, 2026 10:32
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: 1

🤖 Fix all issues with AI agents
In `@store_handler/eloq_data_store_service/build_eloq_store.cmake`:
- Around line 128-131: The eloqstore target exposes absl::flat_hash_map as a
PUBLIC link dependency even though only the private eloq-metrics dependency
requires it, causing unnecessary transitive exposure; update the
target_link_libraries invocation for target eloqstore to change
absl::flat_hash_map from PUBLIC to PRIVATE (i.e., make absl::flat_hash_map a
PRIVATE dependency of eloqstore) so consumers no longer inherit it—abseil
remains available via tx_service when WITH_TXSERVICE / ELOQDSS_ELOQSTORE is
enabled.

Comment on lines 128 to +131
target_include_directories(eloqstore PUBLIC ${ELOQ_STORE_INCLUDE})
target_link_libraries(eloqstore PRIVATE ${URING_LIB} ${BOOST_CONTEXT_TARGET} glog::glog absl::flat_hash_map jsoncpp_lib ${CURL_LIBRARIES} ${ZSTD_LIBRARY} ${AWSSDK_LINK_LIBRARIES})
target_link_libraries(eloqstore PRIVATE ${URING_LIB} ${BOOST_CONTEXT_TARGET} glog::glog jsoncpp_lib ${CURL_LIBRARIES} ${ZSTD_LIBRARY} ${AWSSDK_LINK_LIBRARIES}
PUBLIC absl::flat_hash_map
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, examine the CMake file structure
cd store_handler/eloq_data_store_service && pwd && wc -l build_eloq_store.cmake

Repository: eloqdata/tx_service

Length of output: 146


🏁 Script executed:

# Check the relevant sections of the CMake file
cat -n store_handler/eloq_data_store_service/build_eloq_store.cmake | sed -n '75,135p'

Repository: eloqdata/tx_service

Length of output: 3349


🏁 Script executed:

# Search for absl-related CMake statements across the codebase
rg -n 'absl::flat_hash_map|abseil|find_package.*absl|add_subdirectory.*abseil' --glob '*.cmake' --glob 'CMakeLists.txt'

Repository: eloqdata/tx_service

Length of output: 1012


🏁 Script executed:

# Find public header files in eloq_data_store_service
find store_handler/eloq_data_store_service -path '*/include/*.h*' -type f

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Find all header files in the include directory
find store_handler/eloq_data_store_service/include -type f -name '*.h' -o -name '*.hpp' | head -20

Repository: eloqdata/tx_service

Length of output: 143


🏁 Script executed:

# Check headers that are exposed publicly
ls -la store_handler/eloq_data_store_service/include/

Repository: eloqdata/tx_service

Length of output: 156


🏁 Script executed:

# Search all headers for absl includes
rg 'absl/' store_handler/eloq_data_store_service/include/ 2>/dev/null

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check CMakeLists.txt to understand build configuration
head -100 store_handler/eloq_data_store_service/CMakeLists.txt

Repository: eloqdata/tx_service

Length of output: 3738


🏁 Script executed:

# Find the actual structure of eloq_data_store_service directory
find store_handler/eloq_data_store_service -type d | head -20

Repository: eloqdata/tx_service

Length of output: 148


🏁 Script executed:

# Look at CMakeLists.txt to understand include paths
cat -n store_handler/eloq_data_store_service/CMakeLists.txt | head -50

Repository: eloqdata/tx_service

Length of output: 2130


🏁 Script executed:

# Check what ELOQ_STORE_INCLUDE points to
cd store_handler/eloq_data_store_service && ls -la

Repository: eloqdata/tx_service

Length of output: 3654


🏁 Script executed:

# Check if eloqstore is used publicly by other targets
rg 'target_link_libraries.*eloqstore|PUBLIC.*eloqstore' --glob '*.cmake' --glob 'CMakeLists.txt'

Repository: eloqdata/tx_service

Length of output: 401


🏁 Script executed:

# Check source files to see if they use absl directly
rg '#include.*absl' store_handler/eloq_data_store_service/src/ | head -20

Repository: eloqdata/tx_service

Length of output: 145


🏁 Script executed:

# Check the eloqstore subdirectory
ls -la store_handler/eloq_data_store_service/eloqstore/

Repository: eloqdata/tx_service

Length of output: 173


🏁 Script executed:

# Find all source files
find store_handler/eloq_data_store_service -name '*.cpp' -o -name '*.h' -o -name '*.hpp' | head -30

Repository: eloqdata/tx_service

Length of output: 1870


🏁 Script executed:

# Search for absl includes in all files
rg '#include.*absl' store_handler/eloq_data_store_service/

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check where eloqstore library is linked
rg 'eloqstore' --glob '*.cmake' --glob 'CMakeLists.txt' -A 2 -B 2

Repository: eloqdata/tx_service

Length of output: 6073


🏁 Script executed:

# Check where abseil is added in the root CMakeLists.txt
rg -n 'add_subdirectory.*abseil|find_package.*absl' CMakeLists.txt

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check if abseil is added unconditionally elsewhere
rg -n 'add_subdirectory.*abseil|find_package.*absl'

Repository: eloqdata/tx_service

Length of output: 388


🏁 Script executed:

# Check how WITH_TXSERVICE affects the build and where abseil is handled
cat -n CMakeLists.txt | sed -n '50,150p'

Repository: eloqdata/tx_service

Length of output: 6479


🏁 Script executed:

# Look at the full build_eloq_store.cmake to understand the full context
cat store_handler/eloq_data_store_service/build_eloq_store.cmake

Repository: eloqdata/tx_service

Length of output: 6232


🏁 Script executed:

# Check if eloq-metrics links to abseil
rg 'absl::flat_hash_map|abseil' eloq_metrics/

Repository: eloqdata/tx_service

Length of output: 917


🏁 Script executed:

# Look at eloq_metrics CMakeLists to understand its abseil dependency
head -100 eloq_metrics/CMakeLists.txt

Repository: eloqdata/tx_service

Length of output: 3731


🏁 Script executed:

# Check if any header files in eloq_data_store_service expose absl
rg 'absl' store_handler/eloq_data_store_service/*.h

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check what headers are in store_handler/eloq_data_store_service directory (public API)
rg '^#include.*absl' store_handler/eloq_data_store_service/*.h store_handler/eloq_data_store_service/*.hpp 2>/dev/null

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check if eloq_data_store_service source files use absl
rg 'absl::flat_hash_map|#include.*absl' store_handler/eloq_data_store_service/*.cpp 2>/dev/null

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# See the full CMakeLists.txt section that uses eloqstore
grep -A 20 -B 5 'SET(DATA_SUBSTRATE_LINK_LIBS.*eloqstore' store_handler/eloq_data_store_service/CMakeLists.txt

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check if eloqstore source files actually use absl directly
find store_handler/eloq_data_store_service/eloqstore -name '*.cpp' -o -name '*.h' 2>/dev/null | xargs grep -l 'absl::flat_hash_map\|#include.*absl' 2>/dev/null

Repository: eloqdata/tx_service

Length of output: 47


🏁 Script executed:

# Look for any header files in eloqstore/include or anywhere that might be public
find . -path '*/eloqstore/include*' -o -path '*/eloq_data_store_service/*include*' 2>/dev/null

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check if there are header files that might expose absl
cat store_handler/eloq_data_store_service/data_store.h | head -50

Repository: eloqdata/tx_service

Length of output: 1549


🏁 Script executed:

# Check build context - does WITH_TXSERVICE get set when building with ELOQDSS_ELOQSTORE?
grep -A 5 'ELOQDSS_ELOQSTORE' CMakeLists.txt

Repository: eloqdata/tx_service

Length of output: 2102


🏁 Script executed:

# See if any eloqstore source actually needs absl at all
rg 'flat_hash_map|absl::' --glob '*.cpp' store_handler/eloq_data_store_service/

Repository: eloqdata/tx_service

Length of output: 45


🏁 Script executed:

# Check if eloq-metrics header exposes absl publicly
cat eloq_metrics/include/metrics.h | head -30

Repository: eloqdata/tx_service

Length of output: 1109


🏁 Script executed:

# Verify the build_tx_service.cmake to see if abseil is added globally
sed -n '60,160p' build_tx_service.cmake

Repository: eloqdata/tx_service

Length of output: 3030


🏁 Script executed:

# Check if the eloqstore library headers are used by consumers
grep -r 'include.*data_store\|include.*eloq_store' tx_service/ 2>/dev/null | head -5

Repository: eloqdata/tx_service

Length of output: 443


🏁 Script executed:

# Final check: does anything in eloqstore actually use absl::flat_hash_map?
python3 << 'EOF'
import os
import re

pattern = re.compile(r'absl::|flat_hash_map|#include\s*[<"]absl')

eloqstore_dir = 'store_handler/eloq_data_store_service'
found_absl_usage = False

for root, dirs, files in os.walk(eloqstore_dir):
    for file in files:
        if file.endswith(('.cpp', '.h', '.hpp')):
            filepath = os.path.join(root, file)
            try:
                with open(filepath, 'r') as f:
                    content = f.read()
                    if pattern.search(content):
                        print(f"Found absl usage in: {filepath}")
                        found_absl_usage = True
            except:
                pass

if not found_absl_usage:
    print("No absl usage found in eloq_data_store_service source files")
EOF

Repository: eloqdata/tx_service

Length of output: 122


Change absl::flat_hash_map to PRIVATE in eloqstore linkage.

The eloqstore library itself does not use absl::flat_hash_map directly; only the privately-linked eloq-metrics dependency uses it. Exposing it as PUBLIC creates unnecessary transitive dependencies for consumers of eloqstore. When WITH_TXSERVICE is ON (which is always the case for ELOQDSS_ELOQSTORE builds), Abseil is already available globally via the tx_service build, so the target will be accessible. Change line 130 from PUBLIC absl::flat_hash_map to PRIVATE absl::flat_hash_map.

🤖 Prompt for AI Agents
In `@store_handler/eloq_data_store_service/build_eloq_store.cmake` around lines
128 - 131, The eloqstore target exposes absl::flat_hash_map as a PUBLIC link
dependency even though only the private eloq-metrics dependency requires it,
causing unnecessary transitive exposure; update the target_link_libraries
invocation for target eloqstore to change absl::flat_hash_map from PUBLIC to
PRIVATE (i.e., make absl::flat_hash_map a PRIVATE dependency of eloqstore) so
consumers no longer inherit it—abseil remains available via tx_service when
WITH_TXSERVICE / ELOQDSS_ELOQSTORE is enabled.

@yi-xmu yi-xmu merged commit 89b5d44 into main Feb 3, 2026
4 checks passed
@yi-xmu yi-xmu deleted the fix_backup branch February 3, 2026 07:43
@coderabbitai coderabbitai bot mentioned this pull request Mar 4, 2026
5 tasks
@coderabbitai coderabbitai bot mentioned this pull request Mar 12, 2026
5 tasks
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