-
Notifications
You must be signed in to change notification settings - Fork 9
feat: pass shard_id to eloqstore #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -425,7 +425,7 @@ bool DataStoreService::ConnectAndStartDataStore(uint32_t data_shard_id, | |
| return false; | ||
| } | ||
|
|
||
| res = shard_ref.data_store_->StartDB(term); | ||
| res = shard_ref.data_store_->StartDB(term, data_shard_id); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Find all StartDB call sites to verify they pass the shard_id parameter
# Expect: All call sites should pass two parameters (term and shard_id), or the factories should be excluded from this PR intentionally
echo "=== All StartDB call sites ==="
rg -n --type=cpp 'StartDB\s*\(' -A2 -B2
echo ""
echo "=== Calls with only one parameter (potential issues) ==="
rg -n --type=cpp '->StartDB\s*\([^,)]+\)\s*;'Repository: eloqdata/tx_service Length of output: 7594 🏁 Script executed: # Check the RocksDBDataStore::StartDB implementation
echo "=== RocksDBDataStore::StartDB implementation ==="
sed -n '85,110p' store_handler/eloq_data_store_service/rocksdb_data_store.cpp
echo ""
echo "=== RocksDBCloudDataStore::StartDB implementation ==="
sed -n '263,290p' store_handler/eloq_data_store_service/rocksdb_cloud_data_store.cpp
echo ""
echo "=== Check base class interface ==="
sed -n '60,70p' store_handler/eloq_data_store_service/data_store.hRepository: eloqdata/tx_service Length of output: 2277 Update RocksDBDataStore and RocksDBCloudDataStore signatures to match the base interface. The change at line 428 correctly passes
The base class interface defines: This will cause method resolution failures when factories for these implementations (rocksdb_data_store_factory.h, rocksdb_cloud_data_store_factory.h) create and initialize data stores from line 428. 🤖 Prompt for AI Agents |
||
| if (!res) | ||
| { | ||
| LOG(ERROR) << "Failed to start db instance in data store service"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,9 +177,10 @@ class EloqStoreDataStore : public DataStore | |
|
|
||
| bool Initialize() override; | ||
|
|
||
| bool StartDB(int64_t term) override | ||
| bool StartDB(int64_t term, uint32_t data_shard_id = 0) override | ||
| { | ||
| ::eloqstore::KvError res = eloq_store_service_->Start(term); | ||
| ::eloqstore::KvError res = | ||
| eloq_store_service_->Start(term, data_shard_id); | ||
|
Comment on lines
+180
to
+183
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== StartDB declarations/definitions =="
rg -n --type=cpp -C2 '\bStartDB\s*\('
echo
echo "== Potential one-argument StartDB invocations (missing shard_id) =="
rg -nP --type=cpp '\bStartDB\s*\(\s*[^,()]+\s*\)' -g '!**/build/**' -g '!**/dist/**'
echo
echo "Expected:"
echo "- No remaining one-argument call sites for StartDB."
echo "- Consistent signatures between DataStore and overrides."Repository: eloqdata/tx_service Length of output: 8177 Remove the default argument from Line 180 has Suggested fix- bool StartDB(int64_t term, uint32_t data_shard_id = 0) override
+ bool StartDB(int64_t term, uint32_t data_shard_id) override🤖 Prompt for AI Agents |
||
| if (res != ::eloqstore::KvError::NoError) | ||
| { | ||
| LOG(ERROR) << "EloqStore start failed with error code: " | ||
|
|
||
| +23 −15 | include/async_io_manager.h | |
| +20 −4 | include/eloq_store.h | |
| +5 −0 | include/kv_options.h | |
| +19 −0 | include/storage/mem_index_page.h | |
| +24 −6 | include/storage/object_store.h | |
| +2 −0 | include/storage/shard.h | |
| +9 −0 | include/types.h | |
| +64 −72 | src/async_io_manager.cpp | |
| +262 −107 | src/eloq_store.cpp | |
| +8 −9 | src/file_gc.cpp | |
| +6 −0 | src/kv_options.cpp | |
| +24 −2 | src/storage/index_page_manager.cpp | |
| +9 −3 | src/storage/object_store.cpp | |
| +28 −7 | src/storage/shard.cpp | |
| +52 −0 | tests/cloud.cpp | |
| +11 −26 | tests/cloud_term.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: eloqdata/tx_service
Length of output: 2179
Update
RocksDBDataStoreandRocksDBCloudDataStoreto match the newStartDBsignature.The base class signature changed to
StartDB(int64_t term, uint32_t shard_id), butrocksdb_data_store.h:51androcksdb_cloud_data_store.h:65still declareStartDB(int64_t term) override. The corresponding definitions in.cppfiles also use the old signature. This mismatch breaks the override contract and causes compilation failure. Update both the header declarations and.cppimplementations in both files.🤖 Prompt for AI Agents