Skip to content

Conversation

@simolus3
Copy link
Contributor

This adds a download_size column to ps_buckets. It is initialized to 0, the sync client increments it whenever it receives a data line for a particular bucket.

This also helps with #155: By tracking this in the Rust client, SDKs won't have to decode lines to correlate buckets with original message sizes.

@simolus3 simolus3 requested a review from rkistner January 26, 2026 19:47
Copy link
Contributor

@rkistner rkistner left a comment

Choose a reason for hiding this comment

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

I'm happy with tracking this in the ps_buckets table.

Do we already have something similar to track the number of operations we have downloaded for the bucket? I know we have count_at_last / count_since_last, but I believe those are reset when the checkpoint completes, so not quite the same?

We should also keep in mind there are some differences in tracking it here versus the current diagnostics client logic:

  1. Diagnostics client tracks empty buckets using the checkpoint data, this only tracks buckets when it has data. Empty buckets can be useful to see to distinguish parameter query / subquery issues from data query issues.
  2. The diagnostics client keeps the bucket download history around when removing buckets, while the ps_buckets row can be deleted (and potentially re-created) when the bucket is removed, or when there is a checksum failure.

op_checksum = (op_checksum + ?4) & 0xffffffff,
count_since_last = count_since_last + ?5
count_since_last = count_since_last + ?5,
download_size = download_size + ?6
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick, but can we name the downloaded_size to make it clear it is tracking the data already downloaded, not future download size?

(I realize I'm that one that originally named it download_size in the diagnostics client...)

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