[MOD-11910]Fix thread count report in SVS Tiered index debug info & [MOD-11913] Increase threads' reservation timeout #808
+284
−22
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.
MOD-11910 Fix SVS Tiered index debug info thread count
Background
When SVS adds vectors in a multi-threaded environment:
updateSVSIndex
is called with the number of successfully reserved threads (which may be fewer than the total pool capacity)setNumThreads()
for theaddVectors
operationCurrent Behavior
debugInfo()
reports the thread count viagetNumThreads()
, which might have been modified by the lastaddVectors
operation, instead of the actual thread pool capacity.The Fix
numThreads
field: Now populated viagetThreadPoolCapacity()
, which reflects the configured capacity and not the temporarily modified valuelastReservedThreads
field: New field that reports the number of threads that were successfully reserved by the last ingestion operation, populated viagetNumThreads()
MOD-11913 Increase threads' reservation timeout
Increased
SVS_DEFAULT_UPDATE_JOB_WAIT_TIME
: Changed from 0.1 ms to 5 ms to improve thread reservation reliability in multi-threaded scenarios[Additional] Thread Management API Contract Enforcement For
addVector
/addVectors
APIBackground
The original SVS implementation had inconsistent thread management behavior:
addVector
) would temporarily set thread count to 1, then restore to the previous valueThe Changes
addVectorsImpl
: Eliminated the logic that automatically set thread count to 1 for single vector operations and then restored itaddVector()
: Now requiresnumThreads == 1
, enforced by assertionaddVectors()
: Prohibits calling withn=1
whennumThreads > 1
, enforced by assertionnumThreads = 1
before callingaddVector()
setNumThreads()
callsCreateTieredSVSIndex
to defaultnumThreads = 1
, allowing tests to call SVS methods directly while maintaining the single-thread contract