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

changefeedccl: only checkpoint leading spans above lead threshold #138790

Conversation

andyyang890
Copy link
Collaborator

See individual commits


Fixes #137857

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@andyyang890 andyyang890 force-pushed the 20250109-checkpoint-lead-threshold branch 8 times, most recently from 11daf77 to 8644262 Compare January 13, 2025 22:59
@andyyang890 andyyang890 changed the title changefeedccl: add changefeed.checkpoint.inclusion_threshold setting changefeedccl: only checkpoint leading spans above lead threshold Jan 13, 2025
This patch renames `changefeed.frontier_checkpoint_max_bytes` to
`changefeed.span_checkpoint.max_bytes` for consistency.

Release note: None
@andyyang890 andyyang890 force-pushed the 20250109-checkpoint-lead-threshold branch from 8644262 to d2d3f8f Compare January 13, 2025 23:30
This patch renames `changefeed.frontier_checkpoint_frequency` to
`changefeed.span_checkpoint.interval` for consistency.

Release note: None
@andyyang890 andyyang890 force-pushed the 20250109-checkpoint-lead-threshold branch from d2d3f8f to 8ec98be Compare January 14, 2025 02:42
@andyyang890 andyyang890 marked this pull request as ready for review January 14, 2025 02:46
@andyyang890 andyyang890 requested a review from a team as a code owner January 14, 2025 02:46
@andyyang890 andyyang890 requested review from asg0451 and wenyihu6 and removed request for a team January 14, 2025 02:46
Copy link
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

I haven't looked closely so take this with a grain of salt, but I think this is the kind of change were we would benefit from the "painful elaboration of the obvious" in the commit message so that in a few months anyone partially familiar with changefeeds can understand we expect this change to do.

@andyyang890 andyyang890 force-pushed the 20250109-checkpoint-lead-threshold branch 2 times, most recently from c7d49f2 to f07beab Compare January 14, 2025 17:26
@andyyang890
Copy link
Collaborator Author

I haven't looked closely so take this with a grain of salt, but I think this is the kind of change were we would benefit from the "painful elaboration of the obvious" in the commit message so that in a few months anyone partially familiar with changefeeds can understand we expect this change to do.

Thanks for the feedback, added a longer explanation in the commit message.

…reshold setting

This patch renames
`changefeed.frontier_highwater_lag_checkpoint_threshold`
to `changefeed.span_checkpoint.lead_threshold` for consistency.

Release note (ops change): The cluster setting
`changefeed.frontier_highwater_lag_checkpoint_threshold` has been
renamed to `changefeed.span_checkpoint.lead_threshold`. The old name
remains available for backwards-compatibility.
This patch updates the span-level checkpointing code to only checkpoint
spans that are above the lead threshold (formerly lag threshold) so that
we can at least maintain some minimal level of progress for spans that
we go through the effort of checkpointing.

Longer explanation: We create span-level checkpoints (at the configured
interval) if we are either in a backfill or there's at least one span
that is more than the lag/lead threshold ahead of the frontier min ts.
Before this change, in the latter case, we would checkpoint all spans
that are above the frontier min ts regardless of whether they are at
least the lag/lead threshold ahead. This change makes it so that when
we are creating a span-level checkpoint due to the lag/lead threshold,
we will only include spans that are ahead of the frontier min ts by at
least the lag/lead threshold so that we can maintain some minimal level
of progress for the spans that we checkpoint.

Release note: None
@andyyang890 andyyang890 force-pushed the 20250109-checkpoint-lead-threshold branch from f07beab to bdd0cd4 Compare January 14, 2025 20:17
@andyyang890
Copy link
Collaborator Author

We discussed this change offline and decided the risks associated with this change aren't worth it given the planned work to improve span-level checkpoints. I pulled the first 3 commits renaming settings into a separate PR (#139064) and I'll close this PR soon.

@andyyang890 andyyang890 deleted the 20250109-checkpoint-lead-threshold branch January 15, 2025 03:24
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.

changefeedccl: only checkpoint spans a certain threshold ahead of highwater
4 participants