Skip to content

broker: limit concurrent primary fragment persists#460

Merged
williamhbaker merged 1 commit intomasterfrom
wb/persist-sema
Feb 18, 2026
Merged

broker: limit concurrent primary fragment persists#460
williamhbaker merged 1 commit intomasterfrom
wb/persist-sema

Conversation

@williamhbaker
Copy link
Copy Markdown
Contributor

Add a semaphore to Persister that bounds concurrent primary persist goroutines.

When many journals share an epoch-aligned flush_interval, they all roll their fragments simultaneously, spawning a potentially large number of concurrent cloud uploads which may allocate significant per-upload buffers and cause memory issues.

This semaphore will prevent unbounded memory growth when persisting many journals.

Add a semaphore to Persister that bounds concurrent primary persist goroutines.

When many journals share an epoch-aligned flush_interval, they all roll their
fragments simultaneously, spawning a potentially large number of concurrent
cloud uploads which may allocate significant per-upload buffers and cause memory
issues.

This semaphore will prevent unbounded memory growth when persisting many
journals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@jgraettinger jgraettinger left a comment

Choose a reason for hiding this comment

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

LGTM

@williamhbaker williamhbaker merged commit 50458f1 into master Feb 18, 2026
1 check passed
@williamhbaker williamhbaker deleted the wb/persist-sema branch February 18, 2026 18:54
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