Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/unreleased/SOLR-18334-prs-creation-waitForState.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: >
PRS based collection creation returns too early; can cause restore failure.
type: fixed
authors:
- name: David Smiley
links:
- name: SOLR-18334
url: https://issues.apache.org/jira/browse/SOLR-18334
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,17 @@ public void call(AdminCmdContext adminCmdContext, ZkNodeProps message, NamedList
clusterState = clusterState.copyWith(collectionName, command.collection);
newColl = command.collection;
ccc.submitIntraProcessMessage(new RefreshCollectionMessage(collectionName));

// ensure the local ZkStateReader sees the collection before returning, so callers get the
// same "collection exists" guarantee as the non-PRS path
try {
zkStateReader.waitForState(collectionName, 30, TimeUnit.SECONDS, Objects::nonNull);
} catch (TimeoutException e) {
throw new SolrException(
SolrException.ErrorCode.SERVER_ERROR,
"Could not fully create collection: " + collectionName,
e);
}
} else {
if (ccc.getDistributedClusterStateUpdater().isDistributedStateUpdate()) {
// The message has been crafted by CollectionsHandler.CollectionOperation.CREATE_OP and
Expand Down
Loading