chore: enqueue pending_prune_days on inserts#1117
Conversation
- Changed the visibility of the `auto_digest` action from private to public in the `020-digest-actions.sql` migration script, allowing it to be called directly from the CLI for verification purposes.
- Refactored the `insert_record` and `insert_records` actions to utilize a new `insert_records` function for batch processing. - Introduced `helper_enqueue_prune_days` to enqueue days for pruning, ensuring idempotency and filtering out zero values. - Added tests to verify the correct population of `pending_prune_days` during record insertion, maintaining data integrity across multiple inserts.
- Replaced the usage of `get_stream_ids` with `$stream_refs` in the `insert_records` action to ensure correct stream reference handling during pruning. - Added a condition to the `helper_enqueue_prune_days` function to filter out negative event times, enhancing data integrity during pruning operations.
|
Warning Rate limit exceeded@outerlook has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 9 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (6)
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Time Submission Status
|
Description
(stream_ref, day_index)intopending_prune_dayson primitive and truflation batch insertshelper_enqueue_prune_days(stream_refs INT[], event_times INT8[], values NUMERIC[])insert_recorda thin wrapper overinsert_recordsto unify behavior(stream_ref, day_index)PK;day_index >= 0Related Problem
How Has This Been Tested?
tests/streams/pending_prune_days_test.gotruflation_insert_recordsReviewer Pointers (files of interest)
internal/migrations/901-utilities.sql: newhelper_enqueue_prune_days(filtered) and cleanupinternal/migrations/003-primitive-insertion.sql: enqueue on primitiveinsert_records;insert_recordwrapsinternal/migrations/009-truflation-query.sql: enqueue on truflation batch pathinternal/migrations/normalization_migration/02_insert_actions.sql: enqueue for migration-compatible pathtests/streams/pending_prune_days_test.go: minimal high-ROI coverage