Avoid forcing checkpoint flush when data sync memory quota is full#162
Conversation
WalkthroughRemoved a proactive memory flush call in DataSyncMemoryController::AllocateFlushDataMemQuota, shifting memory management to rely solely on wait loops rather than immediate flushing when memory shortage occurs. Also applied minor whitespace formatting in snapshot manager code. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant Controller as DataSyncMemoryController
participant Shards as LocalCcShards
participant Wait as Wait Loop
rect rgba(255, 220, 150, 0.3)
Note over Controller: Old Behavior
App->>Controller: AllocateFlushDataMemQuota()
alt Memory Available
Controller-->>App: Success
else Memory Shortage
Controller->>Shards: FlushCurrentFlushBuffer()
Shards-->>Controller: Flush Complete
Controller->>Wait: Wait for Memory
Wait-->>Controller: Memory Available
Controller-->>App: Success
end
end
rect rgba(180, 220, 150, 0.3)
Note over Controller: New Behavior
App->>Controller: AllocateFlushDataMemQuota()
alt Memory Available
Controller-->>App: Success
else Memory Shortage
Controller->>Wait: Wait for Memory
Wait-->>Controller: Memory Available
Controller-->>App: Success
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
eb199ef to
aec150c
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/store/snapshot_manager.cpp (1)
447-476: Consider eliminating variable shadowing for snapshot_files.At line 452,
snapshot_filesis redeclared inside the preprocessor conditional, shadowing the outer declaration from line 445. While this appears to work correctly (the inner one is used in the cloud storage path, outer one in the non-cloud path), it's confusing and error-prone—future maintainers might mistakenly assume the outer vector is being populated throughout this block.Recommend reusing the outer
snapshot_fileswithout redeclaring it at line 452 to improve clarity.Consider applying this diff to eliminate shadowing:
#if (defined(DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_S3) || \ defined(DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS)) // For shared storage with cloud filesystem enabled, create snapshot - std::vector<std::string> snapshot_files; bool res = store_hd_->CreateSnapshotForBackup( backup_name, snapshot_files, last_ckpt_ts);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
include/cc/local_cc_shards.h(0 hunks)src/store/snapshot_manager.cpp(1 hunks)
💤 Files with no reviewable changes (1)
- include/cc/local_cc_shards.h
🔇 Additional comments (1)
src/store/snapshot_manager.cpp (1)
449-450: Preprocessor formatting appears appropriate.The line continuation and indentation for the cloud storage backend check looks clean. Assuming this is the only formatting change in this section, it aligns with the PR objective of a minor whitespace adjustment.
Here are some reminders before you submit the pull request
fixes eloqdb/tx_service#issue_id./mtr --suite=mono_main,mono_multi,mono_basicSummary by CodeRabbit
Refactor
Style