agent: limit frequency of controller publications #1532
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Fixes #1520
We've observed a scenario where there's a very large capture with hundreds of collections all using schema inference. Among all of the collections, publications due to inferred schema updates are quite frequent. Because each collection publication results in a subsequent publication of the capture and materialization, it results in extremely frequent publications of those tasks, which has two important consequences:
PublicationSuperceded
orExpectPubIdNotMatched
errors.So we've decided to slow down the rate of controller-initiated publications to try to alleviate those symptoms. This introduces two new fields to the publication status:
last_publication_time
andmin_publication_interval
. Controllers will now wait at leastmin_publication_interval
since thelast_publication_time
before publishing a spec in response to publication of dependencies.The default value of
min_publication_interval
is 30 minutes, which is somewhat arbitrary, but aligns with the defaultupdate_delay
of materializations. Since this value is part of the controller status, we can update it on a per-task basis.This change is