mirror of https://github.com/apache/lucene.git
LUCENE-3031: setFlushPending fails if we concurrently hit a aborting exception
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/realtime_search@1092625 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b95a78384c
commit
95b0aa44da
|
@ -167,12 +167,14 @@ public final class DocumentsWriterFlushControl {
|
|||
*/
|
||||
public synchronized void setFlushPending(ThreadState perThread) {
|
||||
assert !perThread.flushPending;
|
||||
assert perThread.perThread.getNumDocsInRAM() > 0;
|
||||
perThread.flushPending = true; // write access synced
|
||||
final long bytes = perThread.perThreadBytes;
|
||||
flushBytes += bytes;
|
||||
activeBytes -= bytes;
|
||||
numPending++; // write access synced
|
||||
if (perThread.perThread.getNumDocsInRAM() > 0) {
|
||||
perThread.flushPending = true; // write access synced
|
||||
final long bytes = perThread.perThreadBytes;
|
||||
flushBytes += bytes;
|
||||
activeBytes -= bytes;
|
||||
numPending++; // write access synced
|
||||
} // don't assert on numDocs since we could hit an abort excp. while selecting that dwpt for flushing
|
||||
|
||||
}
|
||||
|
||||
synchronized void doOnAbort(ThreadState state) {
|
||||
|
|
|
@ -132,7 +132,6 @@ public abstract class FlushPolicy {
|
|||
}
|
||||
}
|
||||
}
|
||||
assert maxRamUsingThreadState.perThread.getNumDocsInRAM() > 0;
|
||||
assert writer.get().message(
|
||||
"set largest ram consuming thread pending on lower watermark");
|
||||
return maxRamUsingThreadState;
|
||||
|
|
Loading…
Reference in New Issue