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

CBG-4453: Retry index creation for longer #7347

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion base/collection_n1ql_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ func BuildDeferredIndexes(ctx context.Context, s N1QLStore, indexSet []string) e
}
return err != nil, err, nil
}
sleeper := CreateDoublingSleeperDurationFunc(500, time.Second*30)
// Initial retry 1 seconds, max wait 30s, waits up to 10m
sleeper := CreateMaxDoublingSleeperFunc(20, 1000, 30000)
err, _ := RetryLoop(ctx, "BuildDeferredIndexes", worker, sleeper)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions db/indexes.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ func (i *SGIndex) createIfNeeded(ctx context.Context, bucket base.N1QLStore, opt
IndexTombstones: i.shouldIndexTombstones(options.UseXattrs),
}

// Initial retry 500ms, max wait 1s, waits up to ~15s
sleeper := base.CreateMaxDoublingSleeperFunc(15, 500, 1000)
// Initial retry 1 seconds, max wait 30s, waits up to 10m
sleeper := base.CreateMaxDoublingSleeperFunc(20, 1000, 30000)

// start a retry loop to create index,
worker := func() (shouldRetry bool, err error, value interface{}) {
Expand Down