Skip to content
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

storage: make probe intervals runtime configurable #31125

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

teskje
Copy link
Contributor

@teskje teskje commented Jan 21, 2025

This PR makes it possible to change the tick interval of the upstream frontier probes without a source restart.

To simplify things I've added a first (currently second) commit that moves the Kafka interval configuration into dyncfg and starts ignoring the user-defined per-source interval (which is to be removed in https://github.com/MaterializeInc/database-issues/issues/8887).

The first commit is from #31072 and can be ignored here.

Motivation

  • This PR adds a known-desirable feature.

Closes https://github.com/MaterializeInc/database-issues/issues/8886

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@teskje teskje force-pushed the dynamic-upstream-fetch-intervals branch from b9884a2 to 4348ff6 Compare January 21, 2025 18:02
This commit ensures that probe timestamps, and therefore timestamps used
for minting new bindings, are rounded down to the probe interval
(typically 1s). This is to reduce the amount of distinct timestamps
flowing through a dataflow joining multiple sources. Each distinct
timestamp induces some amount of overhead, so forcing the timestamps of
individual sources to the same values is more efficient.
This commit removes the `KAFKA_DEFAULT_METADATA_FETCH_INTERVAL` legacy
config and replaces it with a `KAFKA_METADATA_FETCH_INTERVAL` dyncfg.
Like `{PG,MYSQL}_OFFSET_KNOWN_INTERVAL`, this makes it possible to
dynamically observe updates to this interval through a `ConfigSet`,
apart from removing some boilerplate.

The flag also loses its "default" part and is now the only thing
determining the probe ticker interval. This is the first step in
removing the user-visible option to configure the Kafka source metadata
fetch interval and is done here because it simplifies dynamically
updating the probe ticker interval in the next commit.
This commit makes it possible to change the tick interval of the
upstream frontier probes without a source restart. To this end, the
`probe::Ticker` receives a closure with which it can request the current
interval, which it calls between ticks. The various source
implementations implement the closure to read their respective dyncfgs.
@teskje teskje force-pushed the dynamic-upstream-fetch-intervals branch from 4348ff6 to 02a39cd Compare January 22, 2025 10:10
@teskje teskje marked this pull request as ready for review January 22, 2025 10:10
@teskje teskje requested review from a team as code owners January 22, 2025 10:10
@teskje teskje requested a review from ParkMyCar January 22, 2025 10:10
Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@@ -18,7 +20,6 @@ import "service/src/params.proto";
import "tracing/src/params.proto";

message ProtoStorageParameters {
reserved 1, 2, 3, 25, 12, 16, 26, 31, 39;
Copy link
Member

Choose a reason for hiding this comment

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

We could re-use the small identifiers, they have a more efficient proto encoding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, might as well clean up the ids here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done that and also reordered the proto fields to match the order in Rust.

The protobuf types in this file are only used in the storage protocol
and never used across Mz versions.
@teskje teskje force-pushed the dynamic-upstream-fetch-intervals branch from 02a39cd to 2ba022c Compare January 22, 2025 10:42
Copy link
Contributor

@aljoscha aljoscha left a comment

Choose a reason for hiding this comment

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

looks good! 🙌

@@ -59,9 +59,6 @@ ALTER SYSTEM SET kafka_default_metadata_fetch_interval = '1s'
ALTER SYSTEM SET pg_offset_known_interval = '1s'
ALTER SYSTEM SET mysql_offset_known_interval = '1s'

> ALTER CLUSTER test SET (REPLICATION FACTOR 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

mostly just curious: why are these removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They existed because applying the changed intervals needed a source restart before this PR, but it doesn't need one now!

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.

3 participants