SOLR-11278: Stopping CDCR should cancel a running bootstrap operation

This commit is contained in:
Shalin Shekhar Mangar 2017-08-30 22:59:30 +05:30
parent 54d760fdbf
commit b4c6bfafdb
3 changed files with 9 additions and 1 deletions

View File

@ -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
---------------------- ----------------------

View File

@ -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() {

View File

@ -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;