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

Sync batch coalescing #690

Merged
merged 4 commits into from
Oct 3, 2024
Merged

Sync batch coalescing #690

merged 4 commits into from
Oct 3, 2024

Conversation

gruuya
Copy link
Contributor

@gruuya gruuya commented Oct 1, 2024

What

Coalesce sync batches when enqueuing them. This ensures we stay below the max_syncs_per_url for longer, ultimately enabling us to accumulate/dump more rows per flush.

How

When enqueuing sync batches, if they share the same schema as a previous entry just append them to it, instead of creating a new entry.

Why

Whereas the existing implementation has been optimized for a high volume/saturating use case, this is not the case for the opposite, i.e. batches with a low number of rows. Consequently this leads to poor throughput rates, and ultimately slows down the transaction processing speed for the entire cluster.

Copy link
Collaborator

@lizardoluis lizardoluis left a comment

Choose a reason for hiding this comment

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

My comments were all about naming to improve readability. It looks good to me, but I think we need unittests on all these functions, giving the complexity of these algorithms.

src/sync/schema/mod.rs Outdated Show resolved Hide resolved
src/sync/utils.rs Outdated Show resolved Hide resolved
src/sync/writer.rs Outdated Show resolved Hide resolved
@gruuya gruuya merged commit e144a8b into main Oct 3, 2024
2 checks passed
@gruuya gruuya deleted the sync-batch-merging branch October 3, 2024 15:06
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