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

[3.1.9 backport] CBG-4016 Refresh sequence allocator before incr during nextSequenceGreaterThan #6960

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

adamcfraser
Copy link
Collaborator

@adamcfraser adamcfraser commented Jul 12, 2024

CBG-4016, backports CBG-4015

When nextSequenceGreaterThan requires a sequence larger than what’s already present in the allocator’s batch size, fetch the current _sync:seq before computing the require increment size, to account for variable allocation rates by other allocators.

Integration Tests

…eaterThan

When nextSequenceGreaterThan requires a sequence larger than what’s already present in the allocator’s batch size, fetch the current _sync:seq before computing the require increment size, to account for variable allocation rates by other allocators.
releasedCount += numReleased
currentSequence = nextSequence
}
currentSequence = nextSequence
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: have currentSequence = nextSequence twice here

require.NoError(t, err, "nextSequenceGreaterThan error: %v", err)
log.Printf("allocator %d released %d sequences because next < current (%d < %d)", numReleased, allocatorIndex, prevNext, currentSequence)
// At most clientAllocator should only need to release the current batch
assert.LessOrEqual(t, numReleased, clientAllocator.sequenceBatchSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should include the test fix in #6951

@adamcfraser adamcfraser requested a review from gregns1 July 15, 2024 22:08
@gregns1 gregns1 merged commit 4f53ee2 into release/3.1.9 Jul 16, 2024
24 checks passed
@gregns1 gregns1 deleted the CBG-4016 branch July 16, 2024 13:09
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.

2 participants