Skip to content

Move invalidations on refresh only if no policy #8191

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkindahl
Copy link
Member

If no move policy is defined, a continuous aggregate refresh will not move invalidations (not even try to move invalidations) and assumes that the process hypertable invalidation policies fully decide how to process hypertable invalidations.

If you provide the force option to the refresh policy, it is assumed that there are hypertable invalidations that need to be processed and the processing is done.

If no move policy is defined, a continuous aggregate refresh will not
move invalidations (not even try to move invalidations) and assumes
that the process hypertable invalidation policies fully decide how to
process hypertable invalidations.

If you provide the `force` option to the refresh policy, it is assumed
that there are hypertable invalidations that need to be processed and
the processing is done.
Comment on lines +384 to +389
/* See if there is a move hypertable invalidations policy defined */
List *jobs =
ts_bgw_job_find_by_proc_and_hypertable_id(POLICY_PROCESS_HYPER_INVAL_PROC_NAME,
FUNCTIONS_SCHEMA_NAME,
policy_data.cagg->data.raw_hypertable_id);
bool has_move_policy = list_length(jobs) > 0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to add a GUC to allow this to be configured so that the default behavior is to always process the hypertable invalidations but it can be enabled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use the existing force option

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is what the code currently does, but that means you have to pass it explicitly with each call.

I am thinking that you might want to set it up in one of three different ways:

  1. Always do an invalidations move when running a refresh
  2. Never do an invalidation move when running a refresh
  3. Do an invalidation move when there is no move policy defined.

Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.38%. Comparing base (8f0fa91) to head (9f85cd5).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8191      +/-   ##
==========================================
+ Coverage   82.29%   82.38%   +0.08%     
==========================================
  Files         256      256              
  Lines       47934    47915      -19     
  Branches    12077    12075       -2     
==========================================
+ Hits        39448    39474      +26     
- Misses       3643     3654      +11     
+ Partials     4843     4787      -56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +668 to +674
if (!force)
{
List *jobs = ts_bgw_job_find_by_proc_and_hypertable_id(POLICY_PROCESS_HYPER_INVAL_PROC_NAME,
FUNCTIONS_SCHEMA_NAME,
cagg->data.raw_hypertable_id);
move_hypertable_invalidations = list_length(jobs) == 0;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to have a separate option so that you can force-refresh a range but not process hypertable invalidations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for now a manual refresh should always move the invalidations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide option to not process hypertable invalidations when refreshing
2 participants