Skip to content

CBG-4636: have check for skipped sequences on recent sequence handling #7530

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 4 commits into
base: main
Choose a base branch
from

Conversation

gregns1
Copy link
Contributor

@gregns1 gregns1 commented May 13, 2025

CBG-4636

We need to check if its possible that a recent_sequence got pushed to skipped on recent sequence handing, when pending gets to max or is flushed due to age we move the next expected sequence at the cache to the oldest pending sequence. Hence this loop was not running on some sequences that were in recent sequences on a doc but were also present in skipped sequences. This meant skipped would grow exponentially with no prospect of ever removing the sequences until we abandoned them. This lead to high sequence stable being stuck until abandoned sequences job was run.

I chose not to do an actual check in skipped given this is done inside processEntry and it would be less expensive to just check if seq in recent sequence is less than current sequence and it is greater than or equal to the oldest skipped sequence.

Before changes high_seq_stable:
high_seq_stable_pre

After changes high_seq_stable:
high_seq_stable_post

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Integration Tests

@gregns1 gregns1 assigned torcolvin and bbrks and unassigned torcolvin May 14, 2025
Copy link
Member

@bbrks bbrks left a comment

Choose a reason for hiding this comment

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

Have a question about how this change interacts when we don't have any skipped sequences but do have recent sequences present on a doc

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.

4 participants