Add analyze-db.sh script for post-restore database warmup#3790
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mstaeble The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
Warning Review limit reached
Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
WalkthroughAdds a configurable ChangesDatabase analysis workflow
Backfill argument validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant AnalyzeScript
participant KubernetesPod
participant PostgreSQL
Operator->>AnalyzeScript: invoke analysis options
AnalyzeScript->>KubernetesPod: delete and create analysis pod
KubernetesPod->>PostgreSQL: run ANALYZE VERBOSE through psql
PostgreSQL-->>KubernetesPod: return analysis results
KubernetesPod-->>AnalyzeScript: complete pod command
🚥 Pre-merge checks | ✅ 20 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (20 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/analyze-db.sh`:
- Around line 40-54: Add the required top-level --image option to the oc run
invocation using the same PostgreSQL image already specified in the overrides,
and retain --rm so the temporary pod is removed automatically.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: f4078982-680e-4550-8e87-5535d4197238
📒 Files selected for processing (3)
README.mdscripts/analyze-db.shscripts/backfill-summaries.sh
After cloning or restoring the production database to staging, query performance is degraded because PostgreSQL lacks fresh planner statistics. This script runs ANALYZE VERBOSE via a one-shot pod to fix that. Also adds argument validation to backfill-summaries.sh to produce clear error messages when a flag value is missing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8399b4d to
2391d59
Compare
|
Scheduling required tests: |
|
@mstaeble: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
scripts/analyze-db.shto runANALYZE VERBOSEon the sippy database via a one-shot pod after cloning/restoring the production database to stagingscripts/backfill-summaries.shfor missing flag valuesREADME.mdTest plan
./scripts/analyze-db.sh --dry-runto verify dry-run output./scripts/analyze-db.shagainst staging to verify ANALYZE completes./scripts/backfill-summaries.sh --table(no value) to verify the new error message🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation