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: only messages should drive generator capability #21499

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/storage/src/source/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ impl SourceRender for LoadGeneratorSourceConnection {
let Some(resume_offset) = resume_upper.into_option() else {
return
};
cap.downgrade(&resume_offset);

let mut rows = as_generator(&self.load_generator, self.tick_micros).by_seed(
mz_ore::now::SYSTEM_TIME.clone(),
Expand All @@ -139,7 +138,14 @@ impl SourceRender for LoadGeneratorSourceConnection {
}
Event::Progress(Some(offset)) => {
cap.downgrade(&offset);
tokio::time::sleep(tick).await;
// We only sleep if we have surpassed the resume offset so that we can
// quickly go over any historical updates that a generator might choose to
// emit.
// TODO(petrosagg): Remove the sleep below and make generators return an
// async stream so that they can drive the rate of production directly
if resume_offset < offset {
tokio::time::sleep(tick).await;
}
}
Event::Progress(None) => return,
}
Expand Down