SOLR-9029: fix rare ZkStateReader visibility race during collection state format update

This commit is contained in:
Scott Blum 2016-04-25 21:15:02 -04:00
parent 922265b478
commit 89c65af2a6
2 changed files with 5 additions and 6 deletions

View File

@ -150,6 +150,8 @@ Bug Fixes
* SOLR-8992: Restore Schema API GET method functionality removed in 6.0 (noble, Steve Rowe)
* SOLR-9029: fix rare ZkStateReader visibility race during collection state format update (Scott Blum, hossman)
Optimizations
----------------------
* SOLR-8722: Don't force a full ZkStateReader refresh on every Overseer operation.

View File

@ -263,9 +263,9 @@ public class ZkStateReader implements Closeable {
}
ClusterState.CollectionRef ref = clusterState.getCollectionRef(collection);
if (ref == null) {
// We don't know anything about this collection, maybe it's new?
// First try to update the legacy cluster state.
if (ref == null || legacyCollectionStates.containsKey(collection)) {
// We either don't know anything about this collection (maybe it's new?) or it's legacy.
// First update the legacy cluster state.
refreshLegacyClusterState(null);
if (!legacyCollectionStates.containsKey(collection)) {
// No dice, see if a new collection just got created.
@ -283,9 +283,6 @@ public class ZkStateReader implements Closeable {
}
// Edge case: if there's no external collection, try refreshing legacy cluster state in case it's there.
refreshLegacyClusterState(null);
} else if (legacyCollectionStates.containsKey(collection)) {
// Exists, and lives in legacy cluster state, force a refresh.
refreshLegacyClusterState(null);
} else if (watchedCollectionStates.containsKey(collection)) {
// Exists as a watched collection, force a refresh.
DocCollection newState = fetchCollectionState(collection, null);