You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
144677: vecindex: improve concurrency test and fix bugs it found r=drewkimball a=andy-kimball
#### cspann: fix searcher bugs
Fix a couple of bugs in the tree searcher code found by the concurrency
test:
- When the tree has more than 5 levels, we were resizing the searcher
levels slice, but without copying the root level to the resized slice.
This caused an unexpected error during search.
- The searcher logic was sometimes exiting too early, before it had
considered all available parent results. This was causing deletions to
sometimes miss finding vectors in the tree.
Epic: CRDB-42943
Release note: None
#### cspann: fix race condition in vector delete code.
The deletion code had a race where it would sometimes attempt to delete
a vector from a partition that disallowed deletes. The fix is to convert
the Delete and SearchForDelete code paths to use the same retry pattern
as Insert and SearchForInsert do. The searchForInsertHelper method has
been generalized into a searchForUpdateHelper method that handles both
insert and delete cases.
Epic: CRDB-42943
Release note: None
#### cspann: update TestIndexConcurrency test to delete vectors
This commit modifies the TestIndexConcurrency test to delete one vector
in each inserted batch. The test interleaves concurrent inserts, deletes,
searches, and splits on multiple goroutines in order to find concurrency
bugs. The modification found multiple issues that are fixed in subsequent
commits.
Epic: CRDB-42943
Release note: None
#### vecindex: improve vecindex concurrency test
Increase the coverage of the vecindex concurrency test by adding
foreground querying while the load is happening in the background. Also
add deletes during the load (though disabled due to a bug it found).
Increase the number of iterations and the insert block size. Use a small
partition size and build beam size to increase the frequency of splits.
Fix an efficiency issue the test found: when searching for a deletion
vector, set the MatchKey field in the searcher so that we don't bother
buffering up vectors which can never match.
Epic: CRDB-42943
Release note: None
#### vecindex: suppress partition not found error in SearchPartitions
The SearchPartitions method is spec'd to return InvalidLevel for any partition
that is not found in the tree. However, the vecstore was instead returning
ErrPartitionNotFound, which was causing occasional insertion failures under
stress. This commit updates the vecstore to suppress ErrPartitionNotFound,
mapping it to a PartitionToSearch value of InvalidLevel, MissingState and
Count=0.
Epic: CRDB-42943
Release note: None
Co-authored-by: Andrew Kimball <[email protected]>
0 commit comments