mirror of https://github.com/apache/lucene.git
SOLR-11278: Stopping CDCR should cancel a running bootstrap operation
This commit is contained in:
parent
54d760fdbf
commit
b4c6bfafdb
|
@ -114,6 +114,8 @@ Bug Fixes
|
||||||
contrib/ltr OriginalScoreFeature issues in SolrCloud mode.
|
contrib/ltr OriginalScoreFeature issues in SolrCloud mode.
|
||||||
(Yuki Yano, Jonathan Gonzalez, Ryan Yacyshyn, Christine Poerschke)
|
(Yuki Yano, Jonathan Gonzalez, Ryan Yacyshyn, Christine Poerschke)
|
||||||
|
|
||||||
|
* SOLR-11278: Stopping CDCR should cancel a running bootstrap operation. (Amrit Sarkar, shalin)
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -142,6 +143,11 @@ class CdcrReplicatorManager implements CdcrStateManager.CdcrStateObserver {
|
||||||
ExecutorUtil.shutdownAndAwaitTermination(bootstrapExecutor);
|
ExecutorUtil.shutdownAndAwaitTermination(bootstrapExecutor);
|
||||||
}
|
}
|
||||||
this.closeLogReaders();
|
this.closeLogReaders();
|
||||||
|
Callable callable = core.getSolrCoreState().getCdcrBootstrapCallable();
|
||||||
|
if (callable != null) {
|
||||||
|
CdcrRequestHandler.BootstrapCallable bootstrapCallable = (CdcrRequestHandler.BootstrapCallable) callable;
|
||||||
|
IOUtils.closeQuietly(bootstrapCallable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CdcrReplicatorState> getReplicatorStates() {
|
List<CdcrReplicatorState> getReplicatorStates() {
|
||||||
|
|
|
@ -713,7 +713,7 @@ public class CdcrRequestHandler extends RequestHandlerBase implements SolrCoreAw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class BootstrapCallable implements Callable<Boolean>, Closeable {
|
static class BootstrapCallable implements Callable<Boolean>, Closeable {
|
||||||
private final String masterUrl;
|
private final String masterUrl;
|
||||||
private final SolrCore core;
|
private final SolrCore core;
|
||||||
private volatile boolean closed = false;
|
private volatile boolean closed = false;
|
||||||
|
|
Loading…
Reference in New Issue