private void releaseReadLockOnUsedIndex(PlanInfo planInfo) {
    List inds = planInfo.indexes;
    for (Object obj : inds) {
      Index index = (Index) obj;
      Index prIndex = ((AbstractIndex) index).getPRIndex();
      if (prIndex != null) {
        ((PartitionedIndex) prIndex).releaseIndexReadLockForRemove();
      } else {
        ((AbstractIndex) index).releaseIndexReadLockForRemove();
      }
    }
  }
The index is locked during query to prevent it from being removed by another thread. So we have
to release the lock only after whole query is finished as one query can use an index multiple
times.
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledSelect.java