Skip to content

#9275 refactor to batch compare and append for one shard in persist sink #32509

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

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

Conversation

ptravers
Copy link
Contributor

Motivation

https://github.com/MaterializeInc/database-issues/issues/9275

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.

@ptravers ptravers changed the title #9275 refactor to amortize the cost of batch updates to a shard #9275 refactor to batch compare and append for one shard in persist sink May 15, 2025
@ptravers ptravers marked this pull request as ready for review May 20, 2025 15:03
@ptravers ptravers requested a review from a team as a code owner May 20, 2025 15:03
@ptravers ptravers force-pushed the 9275-amortize-caa-persist-sink branch from eb09eed to 8b969a6 Compare May 21, 2025 00:04
@ptravers ptravers requested a review from a team as a code owner May 27, 2025 18:42
@@ -484,6 +503,18 @@ where

let lower = expected_upper.clone();
let upper = new_upper;

if let (Some(max_upper), Some(min_lower)) = (max_upper, min_lower) {
if max_upper.lt(&upper) || min_lower.gt(&lower) {
Copy link
Contributor Author

@ptravers ptravers May 27, 2025

Choose a reason for hiding this comment

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

unclear that the min_lower check is valid but it does replicate the behaviour tested for here.

Copy link
Contributor Author

@ptravers ptravers May 27, 2025

Choose a reason for hiding this comment

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

removed the min_lower check as the kafka-rtr tests and others started failing. I am concerned that we are not really gathering the set of batches as a batch that would have been previously written.

EDIT: concern is that we are dropping batches that would have been written. I will add a counter or warn log for this issue to aid profiling.

@ptravers ptravers force-pushed the 9275-amortize-caa-persist-sink branch from 9aac9cd to dcf5ad9 Compare May 28, 2025 20:26
@ptravers ptravers force-pushed the 9275-amortize-caa-persist-sink branch from dcf5ad9 to 3b5d25c Compare May 28, 2025 20:45
@ptravers ptravers force-pushed the 9275-amortize-caa-persist-sink branch from 3b5d25c to b18c329 Compare May 29, 2025 18:48
@ptravers ptravers force-pushed the 9275-amortize-caa-persist-sink branch from 5a7f5ff to 219dd42 Compare May 29, 2025 19:09
@ptravers ptravers force-pushed the 9275-amortize-caa-persist-sink branch from 219dd42 to a44810f Compare May 29, 2025 19:15
@@ -1360,6 +1358,8 @@ where
);
anyhow::bail!("collection concurrently modified. Ingestion dataflow will be restarted");
}

break;
Copy link
Contributor Author

@ptravers ptravers May 29, 2025

Choose a reason for hiding this comment

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

I am concerned that none of the above behaviour (everything in the Err(mismatch) arm) is ever actuated by a test.

@ptravers ptravers requested review from petrosagg and bkirwi May 29, 2025 21:11
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.

1 participant