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

[IMPROVED] Bumped inflight updates to 16 and move one lock to rlock. #4621

Merged
merged 2 commits into from Oct 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions server/jetstream_cluster.go
Expand Up @@ -7722,8 +7722,8 @@ func (mset *stream) isCurrent() bool {
return mset.node.Current() && !mset.catchup
}

// Maximum requests for the whole server that can be in flight.
const maxConcurrentSyncRequests = 8
// Maximum requests for the whole server that can be in flight at the same time.
const maxConcurrentSyncRequests = 16

var (
errCatchupCorruptSnapshot = errors.New("corrupt stream snapshot detected")
Expand Down Expand Up @@ -7900,11 +7900,11 @@ RETRY:

// Grab sync request again on failures.
if sreq == nil {
mset.mu.Lock()
mset.mu.RLock()
var state StreamState
mset.store.FastState(&state)
sreq = mset.calculateSyncRequest(&state, snap)
mset.mu.Unlock()
mset.mu.RUnlock()
if sreq == nil {
return nil
}
Expand Down