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-2838: Rely on index 'IF NOT EXISTS' and idempotent deferred index builds fo… #7161

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bbrks
Copy link
Member

@bbrks bbrks commented Oct 17, 2024

CBG-2838

Rely on index IF NOT EXISTS and idempotent deferred index builds for simpler and lower-overhead index creation.

According to the query docs, this is perfectly fine to do, and eliminates a lot of our manual system:indexes queries and retry/error handling logic?

Now the only system:indexes call we have to make is the final one for each collection, to make sure all of the indexes are finished building and are online.

Integration Tests

Copy link
Collaborator

@torcolvin torcolvin left a comment

Choose a reason for hiding this comment

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

As discussed offline, some improvements to this PR should be made:

  • look for IsIndexerRetryIndexError usage as that is where we are taking action on a retryable error. Potentially with CREATE INDEX .. IF NOT EXISTS this error type will not be returned.
  • test this on CBS <7.1 which does not have IF NOT EXISTS

db/indexes.go Outdated Show resolved Hide resolved
…ation, handle not found error case in deferred build, swallow `ErrIndexBackgroundRetry` where we can fall back to collection-scoped wait
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