SOLR-8203: reject updates if core container is shutting down

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1712034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2015-11-02 14:58:28 +00:00
parent 07202b9a42
commit 368d19a2b9
1 changed files with 8 additions and 0 deletions

View File

@ -1443,6 +1443,14 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
}
private void zkCheck() {
// Streaming updates can delay shutdown and cause big update reorderings (new streams can't be
// initiated, but existing streams carry on). This is why we check if the CC is shutdown.
// See SOLR-8203 and loop HdfsChaosMonkeyNothingIsSafeTest (and check for inconsistent shards) to test.
if (req.getCore().getCoreDescriptor().getCoreContainer().isShutDown()) {
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "CoreContainer is shutting down.");
}
if ((updateCommand.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.PEER_SYNC)) != 0) {
// for log reply or peer sync, we don't need to be connected to ZK
return;