Skip to content

Conversation

@ggevay
Copy link
Contributor

@ggevay ggevay commented Nov 21, 2025

This PR makes progress on https://github.com/MaterializeInc/database-issues/issues/9593, implementing real-time recency support in the new peek sequencing, so that we have one less fallback to the old peek sequencing.

I decided to not pull the infra that is need for RTR from the Coordinator to the Frontend, but just added a Coordinator command that the Frontend can use to ask the Coordinator for an RTR timestamp. The roundtrip for this command takes some time and could conceivably be a Coordinator main task bottleneck, but should be ok for now. RTR is quite slow anyway, and GA'ing it is not a high priority at the moment, according to the roadmap item in Notion.

Note that we are reaching into sequencer/inner from the outside (from command_handler.rs), which is not nice. I'd like to resolve this later, when we remove the old peek sequencing code, at which point we'll find some nice place for such currently inner functions that are accessed by the frontend peek sequencing. I've added this to the "Important refactorings" section of https://github.com/MaterializeInc/database-issues/issues/9593

Nightly: https://buildkite.com/materialize/nightly/builds/14153 The failures seem unrelated to this PR.

Note that the PR currently has an extra commit to turn on enable_frontend_peek_sequencing in CI, so that CI tests the new code. I'll remove this commit before merging the PR, as discussed earlier.

@ggevay ggevay added the A-ADAPTER Topics related to the ADAPTER layer label Nov 21, 2025
@ggevay ggevay force-pushed the frontend-peek-rtr branch 2 times, most recently from 8f87429 to fcbd0aa Compare November 21, 2025 18:53

match result {
Ok(Some(fut)) => {
task::spawn(|| "determine real time recent timestamp", async move {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This corresponds to the spawning in the old peek sequencing's peek_real_time_recency.

&self,
source_ids: impl Iterator<Item = GlobalId>,
real_time_recency_timeout: Duration,
) -> Result<Option<BoxFuture<'static, Result<Timestamp, StorageError<Timestamp>>>>, AdapterError>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This big green block is mostly just code movement from the old determine_real_time_recent_timestamp's inner part.

@ggevay ggevay changed the title Add RTR to frontend peek RTR in frontend peek sequencing Nov 22, 2025
@ggevay ggevay marked this pull request as ready for review November 22, 2025 15:46
@ggevay ggevay requested a review from a team as a code owner November 22, 2025 15:46
@ggevay ggevay requested a review from aljoscha November 22, 2025 15:46
@ggevay ggevay changed the title RTR in frontend peek sequencing frontend peek sequencing: RTR Nov 22, 2025
@ggevay ggevay changed the title frontend peek sequencing: RTR Frontend peek sequencing: RTR Nov 22, 2025
@ggevay ggevay changed the title Frontend peek sequencing: RTR Frontend peek sequencing -- RTR Nov 22, 2025
@ggevay ggevay requested review from aljoscha and removed request for aljoscha November 23, 2025 20:54
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.

I think the changes look fine, and I'm counting on tests here to work correctly

----
COMPLETE 0

# TODO(ggevay): I think this is not actually testing real-time recency, because tables don't participate in the
Copy link
Contributor

Choose a reason for hiding this comment

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

🙈

@ggevay ggevay merged commit 7f6dc28 into MaterializeInc:main Nov 24, 2025
125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ADAPTER Topics related to the ADAPTER layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants