Skip to content

Scheduled reducer: use timestamp from reducer params for next run#5574

Open
Shubham8287 wants to merge 2 commits into
masterfrom
shub/fix-schedule-ts
Open

Scheduled reducer: use timestamp from reducer params for next run#5574
Shubham8287 wants to merge 2 commits into
masterfrom
shub/fix-schedule-ts

Conversation

@Shubham8287

@Shubham8287 Shubham8287 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

We are scheduling using Timestamp::now() instead of last run timestamp. It causes any interval reducer which has non-negligible execution time to gradually drift.

I fixed it once back :| - #3657.

API and ABI breaking changes

NA

Expected complexity level and risk

1

Testing

I want to add a test for it, but I don't know how to add non-flaky test for it.

@sephirith

Copy link
Copy Markdown

Please deploy this in 2.7.0 Especially if it is a regression.

@cloutiertyler

Copy link
Copy Markdown
Contributor

I want to add a test for it, but I don't know how to add non-flaky test for it.

@Shubham8287 maybe a use case for DST?

@bfops

bfops commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Please deploy this in 2.7.0 Especially if it is a regression.

The 2.7.0 release is already cut and tested, so this will likely not make it in. We may decide to do a patch release, but otherwise this will make it in to next week's release instead.

Comment on lines -608 to +619
let reschedule = delete_scheduled_function_row(module_info, db, id, None, None, inst_common, inst);
let reschedule = delete_scheduled_function_row(module_info, db, id, None, reschedule_from, inst_common, inst);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the absence of a test, could we change the type signature to always take an explicit timestamp instead of an option?

db: &RelationalDB,
id: Option<ScheduledFunctionId>,
mut tx: MutTxId,
reschedule_from: Option<(Timestamp, Instant)>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same question/suggestion here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants