Skip to content
Merged
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
24 changes: 16 additions & 8 deletions src/VecSim/vec_sim_tiered_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,22 @@ VecSimDebugInfoIterator *VecSimTieredIndex<DataType, DistType>::debugInfoIterato
.fieldType = INFOFIELD_UINT64,
.fieldValue = {FieldValue{.uintegerValue = info.tieredInfo.bufferLimit}}});

infoIterator->addInfoField(VecSim_InfoField{
.fieldName = VecSimCommonStrings::FRONTEND_INDEX_STRING,
.fieldType = INFOFIELD_ITERATOR,
.fieldValue = {FieldValue{.iteratorValue = this->frontendIndex->debugInfoIterator()}}});
// Acquire shared locks to safely access each sub-index's debug info during background indexing.
// Only hold each lock while accessing its respective index to minimize contention.
{
std::shared_lock<std::shared_mutex> flat_lock(this->flatIndexGuard);
infoIterator->addInfoField(VecSim_InfoField{
.fieldName = VecSimCommonStrings::FRONTEND_INDEX_STRING,
.fieldType = INFOFIELD_ITERATOR,
.fieldValue = {FieldValue{.iteratorValue = this->frontendIndex->debugInfoIterator()}}});
}

infoIterator->addInfoField(VecSim_InfoField{
.fieldName = VecSimCommonStrings::BACKEND_INDEX_STRING,
.fieldType = INFOFIELD_ITERATOR,
.fieldValue = {FieldValue{.iteratorValue = this->backendIndex->debugInfoIterator()}}});
{
std::shared_lock<std::shared_mutex> main_lock(this->mainIndexGuard);
infoIterator->addInfoField(VecSim_InfoField{
.fieldName = VecSimCommonStrings::BACKEND_INDEX_STRING,
.fieldType = INFOFIELD_ITERATOR,
.fieldValue = {FieldValue{.iteratorValue = this->backendIndex->debugInfoIterator()}}});
}
return infoIterator;
};
Loading