mirror of https://github.com/apache/lucene.git
LUCENE-8232: Write and Checkpoint DV updates seperately if we drop a reader
This commit is contained in:
parent
acb3c37942
commit
ca02e637ff
|
@ -604,10 +604,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
|
|||
if (!poolReaders && rld.refCount() == 1 && readerMap.containsKey(rld.info)) {
|
||||
// This is the last ref to this RLD, and we're not
|
||||
// pooling, so remove it:
|
||||
boolean changed = rld.writeLiveDocs(directory);
|
||||
changed |= rld.writeFieldUpdates(directory, globalFieldNumberMap, bufferedUpdatesStream.getCompletedDelGen(), infoStream);
|
||||
|
||||
if (changed) {
|
||||
if (rld.writeLiveDocs(directory)) {
|
||||
// Make sure we only write del docs for a live segment:
|
||||
assert assertInfoLive == false || assertInfoIsLive(rld.info);
|
||||
// Must checkpoint because we just
|
||||
|
@ -619,6 +616,9 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
|
|||
// did was move the state to disk:
|
||||
checkpointNoSIS();
|
||||
}
|
||||
if (rld.writeFieldUpdates(directory, globalFieldNumberMap, bufferedUpdatesStream.getCompletedDelGen(), infoStream)) {
|
||||
checkpointNoSIS();
|
||||
}
|
||||
if (rld.getNumDVUpdates() == 0) {
|
||||
rld.dropReaders();
|
||||
readerMap.remove(rld.info);
|
||||
|
|
Loading…
Reference in New Issue