mirror of https://github.com/apache/lucene.git
LUCENE-7887: don't clear BufferedUpdatesStream on abort
This commit is contained in:
parent
cabb1fa366
commit
c9c0121d93
|
@ -175,11 +175,14 @@ class BufferedUpdatesStream implements Accountable {
|
||||||
// TODO: would be a bit more memory efficient to track this per-segment, so when each segment writes it writes all packets finished for
|
// TODO: would be a bit more memory efficient to track this per-segment, so when each segment writes it writes all packets finished for
|
||||||
// it, rather than only recording here, across all segments. But, more complex code, and more CPU, and maybe not so much impact in
|
// it, rather than only recording here, across all segments. But, more complex code, and more CPU, and maybe not so much impact in
|
||||||
// practice?
|
// practice?
|
||||||
|
assert packet.applied.getCount() == 1: "packet=" + packet;
|
||||||
|
|
||||||
packet.applied.countDown();
|
packet.applied.countDown();
|
||||||
|
|
||||||
updates.remove(packet);
|
updates.remove(packet);
|
||||||
numTerms.addAndGet(-packet.numTermDeletes);
|
numTerms.addAndGet(-packet.numTermDeletes);
|
||||||
|
assert numTerms.get() >= 0: "numTerms=" + numTerms + " packet=" + packet;
|
||||||
|
|
||||||
bytesUsed.addAndGet(-packet.bytesUsed);
|
bytesUsed.addAndGet(-packet.bytesUsed);
|
||||||
|
|
||||||
finishedSegment(packet.delGen());
|
finishedSegment(packet.delGen());
|
||||||
|
|
|
@ -299,7 +299,6 @@ class FrozenBufferedUpdates {
|
||||||
if (infoStream.isEnabled("BD")) {
|
if (infoStream.isEnabled("BD")) {
|
||||||
infoStream.message("BD", "packet matches no segments");
|
infoStream.message("BD", "packet matches no segments");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,10 +421,7 @@ class FrozenBufferedUpdates {
|
||||||
throw new IllegalArgumentException("gen is not yet set; call BufferedUpdatesStream.push first");
|
throw new IllegalArgumentException("gen is not yet set; call BufferedUpdatesStream.push first");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (applied.getCount() == 0) {
|
assert applied.getCount() != 0;
|
||||||
// already done
|
|
||||||
return totalDelCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (privateSegment != null) {
|
if (privateSegment != null) {
|
||||||
assert segStates.length == 1;
|
assert segStates.length == 1;
|
||||||
|
|
|
@ -2364,8 +2364,6 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
|
||||||
// set it to false before calling rollbackInternal
|
// set it to false before calling rollbackInternal
|
||||||
mergeScheduler.close();
|
mergeScheduler.close();
|
||||||
|
|
||||||
bufferedUpdatesStream.clear();
|
|
||||||
|
|
||||||
docWriter.close(); // mark it as closed first to prevent subsequent indexing actions/flushes
|
docWriter.close(); // mark it as closed first to prevent subsequent indexing actions/flushes
|
||||||
docWriter.abort(this); // don't sync on IW here
|
docWriter.abort(this); // don't sync on IW here
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
|
|
Loading…
Reference in New Issue