mirror of
https://github.com/apache/lucene.git
synced 2025-03-01 13:59:12 +00:00
LUCENE-9408: roll back only called once enforcement
This commit is contained in:
parent
59efe22ac2
commit
9524cc4233
@ -252,13 +252,16 @@ public abstract class MergePolicy {
|
|||||||
public void mergeInit() throws IOException {
|
public void mergeInit() throws IOException {
|
||||||
mergeProgress.setMergeThread(Thread.currentThread());
|
mergeProgress.setMergeThread(Thread.currentThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Exception originalClosed;
|
||||||
/** Called by {@link IndexWriter} after the merge is done and all readers have been closed.
|
/** Called by {@link IndexWriter} after the merge is done and all readers have been closed.
|
||||||
* @param success true iff the merge finished successfully ie. was committed */
|
* @param success true iff the merge finished successfully ie. was committed */
|
||||||
public void mergeFinished(boolean success) throws IOException {
|
public void mergeFinished(boolean success) throws IOException {
|
||||||
if (mergeCompleted.complete(success) == false) {
|
mergeCompleted.complete(success);
|
||||||
throw new IllegalStateException("merge has already finished");
|
// https://issues.apache.org/jira/browse/LUCENE-9408
|
||||||
}
|
// if (mergeCompleted.complete(success) == false) {
|
||||||
|
// throw new IllegalStateException("merge has already finished", originalClosed);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Wrap the reader in order to add/remove information to the merged segment. */
|
/** Wrap the reader in order to add/remove information to the merged segment. */
|
||||||
|
@ -110,6 +110,7 @@ public class TestMergePolicy extends LuceneTestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/LUCENE-9408")
|
||||||
public void testFinishTwice() throws IOException {
|
public void testFinishTwice() throws IOException {
|
||||||
try (Directory dir = newDirectory()) {
|
try (Directory dir = newDirectory()) {
|
||||||
MergePolicy.MergeSpecification spec = createRandomMergeSpecification(dir, 1);
|
MergePolicy.MergeSpecification spec = createRandomMergeSpecification(dir, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user