lucene icon indicating copy to clipboard operation
lucene copied to clipboard

Why we don't drop changes in pendingDVUpdates here?

Open iamorchid opened this issue 3 years ago • 1 comments

https://github.com/apache/lucene/blob/84cae4f27cfd3feb3bb42d5a9f7ce034f7a31573/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java#L264

  public synchronized void dropChanges() {
    // Discard (don't save) changes when we are dropping
    // the reader; this is used only on the sub-readers
    // after a successful merge.  If deletes had
    // accumulated on those sub-readers while the merge
    // is running, by now we have carried forward those
    // deletes onto the newly merged segment, so we can
    // discard them on the sub-readers:
    pendingDeletes.dropChanges();
    dropMergingUpdates();
  }

For the code above, why we don't drop changes in pendingDVUpdates ? Otherwise, for merged away segment, DV updates could still be written into disk here https://github.com/apache/lucene/blob/84cae4f27cfd3feb3bb42d5a9f7ce034f7a31573/lucene/core/src/java/org/apache/lucene/index/ReaderPool.java#L184

iamorchid avatar Sep 04 '22 10:09 iamorchid

I think this looks like a bug (but probably not hurting a lot? Because the segment is dropping anyway?) but I'm not 100% sure. @mikemccand do you have any ideas?

zhaih avatar Oct 06 '22 02:10 zhaih