Fix missing backup_files field when FetchBackup#157
Conversation
WalkthroughReplaces a compile-time guard from ROCKSDB_CLOUD_FS_TYPE to two new feature flags (DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_S3 and DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS) to control when a backup snapshot is created for shared storage. Runtime logic and error handling paths remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant SM as SnapshotManager
participant SS as SharedStorage (conditional)
C->>SM: requestSnapshot()
alt Compiled with S3/GCS flags
note over SM,SS: New compile-time guard path
SM->>SS: createBackupSnapshot()
SS-->>SM: result (success/error)
SM-->>C: return status
else Not compiled with flags
note over SM: Skip shared-storage snapshot path
SM-->>C: return status (no shared backup)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (3 warnings)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/store/snapshot_manager.cpp (2)
449-468: Critical: Variable shadowing causes backup_files to be empty.Line 452 declares a local
snapshot_filesvariable that shadows the outer variable declared on line 445. WhenCreateSnapshotForBackuppopulates this local variable, the outersnapshot_filesremains empty. Subsequently, line 470 callsUpdateBackupTaskStatuswith the outer (empty)snapshot_files, resulting in no backup files being stored in the task. This causesGetBackupStatus(lines 677-680) to return an empty file list, directly contradicting the PR title "Fix missing backup_files field when FetchBackup".Apply this diff to fix the variable 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);
483-483: Fix typo: "snpashot" → "snapshot".Apply this diff:
- LOG(ERROR) << "Failed to create snpashot for backup"; + LOG(ERROR) << "Failed to create snapshot for backup";
🧹 Nitpick comments (1)
src/store/snapshot_manager.cpp (1)
443-444: Consider updating the comment for accuracy.The comment states "For shared storage, need user to call storage to create snapshot", but the code within the feature flag block (lines 451-465) now creates the snapshot automatically. This comment may need updating to reflect the current behavior, or clarify that it applies only when the feature flags are not defined.
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