-
Notifications
You must be signed in to change notification settings - Fork 1
fix key count check #195
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
fix key count check #195
Conversation
WalkthroughThe changes update the shell command logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant K8sRepository
participant RedisPod
User->>K8sRepository: restoreLocalBackup(aofEnabled)
K8sRepository->>RedisPod: Move backup folder (path depends on aofEnabled)
RedisPod-->>K8sRepository: Command result
K8sRepository->>K8sRepository: deleteLocalBackup()
K8sRepository-->>User: Log success or error
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
backend/services/db-importer-worker/src/repositories/k8s/K8sRepository.ts
(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: load-stack-matrix
- GitHub Check: build
- GitHub Check: build-and-push-docker (db-importer-worker)
- GitHub Check: build-and-push-docker (db-importer)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (actions)
- GitHub Check: push
🔇 Additional comments (6)
backend/services/db-importer-worker/src/repositories/k8s/K8sRepository.ts (6)
392-394
: Improved empty response detection logic.The use of
grep -q
for detecting "(empty array)" patterns and the expanded empty response checks are good improvements that make the detection more robust.
414-414
: Good addition of response logging.Adding logging for the raw response will help with debugging key count issues.
819-819
: Accurate log message update.Changing "Copying" to "Restoring" better reflects what the operation is actually doing.
832-839
: Good addition of cleanup after restoration.Adding the cleanup call after successful restoration is a good practice to prevent leaving temporary backup files on the pods.
841-841
: Consistent error message update.The error message now consistently uses "restoring" terminology, which aligns with the operation being performed.
830-830
:❌ Incorrect review comment
Verify the destination path change for AOF backups.
The destination path changed from
/data/appendonlydir
to/data
whenaofEnabled
is true. This could potentially move the backup folder to the wrong location, replacing the entire data directory instead of restoring the appendonlydir contents.Please verify this change aligns with the intended backup restoration behavior:
🏁 Script executed:
#!/bin/bash # Description: Check how the backup folder is structured and where appendonlydir should be restored # Search for backup creation logic to understand the expected structure rg -A 10 -B 5 "appendonlydir.*backup|backup.*appendonlydir" # Look for other references to appendonlydir restoration ast-grep --pattern 'appendonlydir'Length of output: 7396
🏁 Script executed:
#!/bin/bash # Show the restore logic around the mv command in K8sRepository.ts rg -n -A5 -B5 "mv -f" backend/services/db-importer-worker/src/repositories/k8s/K8sRepository.tsLength of output: 97
🏁 Script executed:
#!/bin/bash # Search for any mv usage in the restore logic rg -n "mv" backend/services/db-importer-worker/src/repositories/k8s/K8sRepository.ts -A5 -B5 # Search specifically for the array form with mv -f rg -n '"mv", "-f"' backend/services/db-importer-worker/src/repositories/k8s/K8sRepository.ts -A5 -B5Length of output: 590
Ignore AOF restore path concern
Moving the AOF backup directory into
/data
is intentional and correct:
• WhenbackupPath
is/data/backup/appendonlydir
,
mv -f /data/backup/appendonlydir /data
yields/data/appendonlydir
, preserving the directory name.
• The restore logic thus places the appendonlydir back under/data
as expected.No changes required here.
Likely an incorrect or invalid review comment.
backend/services/db-importer-worker/src/repositories/k8s/K8sRepository.ts
Show resolved
Hide resolved
Tofu Plan Output - observability_stack_ctrl_plane_k8s
|
Tofu Plan Output - observability_stack_ctrl_plane_infra
|
fix #172
Summary by CodeRabbit
Bug Fixes
Documentation