Improved update of target vector configs #4322
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's being changed:
TLDR: fixes "shard is read-only" error while updating target vectors' configs.
Previously update of target vectors' configs on shard was performed for each target vector separately, starting with changing shard's state to
read-only
, then running update on vector index, then switching state back toready
mode.As vector index update may be async it was undetermined when state will be set to
ready
again, causing update of vector index for next target vector to fail while trying to change shard's state toread-only
.Now single transition of shard's state is made. First state is changed to
read-only
, then updates of vector indexes of all target vectors are executed, then shard's state is changed back toready
when last (slowest) of updates finishes.Review checklist