Repository navigation
fix: include Query field in CDC lazy recovery nar.URL - #1095
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical issue in the CDC lazy chunking recovery process where stuck NAR files were not being correctly recovered. The problem stemmed from the Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Documentation Updates 1 document(s) were updated by changes in this PR: Cache and Storage Configuration FlagsView Changes@@ -212,8 +212,8 @@
- `--cache-cdc-lazy-recovery-schedule` (string): Cron schedule for recovering stuck NARs in lazy chunking mode. Default: `@every 5m`
- Environment variable: `CACHE_CDC_LAZY_RECOVERY_SCHEDULE`
- YAML key: `cache.cdc.lazy-recovery-schedule`
- - Helm value: `config.cdc.lazyRecoverySchedule`
- - Purpose: Controls the schedule for a background recovery mechanism that automatically re-triggers chunking for NARs that became stuck when ncps restarted before background chunking completed. Accepts `@every X` format (e.g., `@every 5m`, `@every 10m`) or standard cron expressions. This job uses distributed locking to prevent duplicate processing across instances.
+ - Helm value: `config.cdc.lazyRecoverySchedule` (should be properly quoted in YAML configurations)
+ - Purpose: Controls the schedule for a background recovery mechanism that automatically re-triggers chunking for NARs that became stuck when ncps restarted before background chunking completed. The recovery process correctly handles NAR records that include query string parameters (such as `?fakesize=123`) by parsing and including the Query field from the database record. Accepts `@every X` format (e.g., `@every 5m`, `@every 10m`) or standard cron expressions. This job uses distributed locking to prevent duplicate processing across instances.
- `--cache-cdc-lazy-recovery-batch-size` (integer): Maximum number of stuck NARs to process per recovery cron run. Default: `100`
- Environment variable: `CACHE_CDC_LAZY_RECOVERY_BATCH_SIZE` |
There was a problem hiding this comment.
Code Review
This pull request addresses a bug in the CDC lazy recovery cron job where the Query field was missing from the nar.URL for stuck NAR files, causing lookup failures. The main change in pkg/cache/cache.go correctly parses the query string from the database and populates the nar.URL. Supporting changes include adding quoting to string values in the Helm chart for robustness and setting default CDC recovery flags in the development script. The changes appear correct and effectively resolve the described issue.
The CDC lazy chunking recovery cron job was failing to recover stuck NAR files because it wasn't passing the Query field when constructing nar.URL. This caused BackgroundMigrateNarToChunks to not find the stuck record (which has a query string like ?fakesize=123), and instead incorrectly fall back to finding a DIFFERENT record that's already chunked, resulting in 'nar already chunked' errors. The fix parses the Query string from the database record and includes it in the nar.URL structure passed to BackgroundMigrateNarToChunks.
1acc555 to
311efcb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1095 +/- ##
=====================================
Coverage 5.04% 5.04%
=====================================
Files 6 6
Lines 436 436
=====================================
Hits 22 22
Misses 410 410
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The CDC lazy chunking recovery cron job was failing to recover stuck NAR files because it wasn't passing the Query field when constructing nar.URL. This caused BackgroundMigrateNarToChunks to not find the stuck record (which has a query string like ?fakesize=123), and instead incorrectly fall back to finding a DIFFERENT record that's already chunked, resulting in 'nar already chunked' errors.
The fix parses the Query string from the database record and includes it in the nar.URL structure passed to BackgroundMigrateNarToChunks.