Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
Signed-off-by: bansvaru <[email protected]>
  • Loading branch information
linuxpi committed Oct 18, 2023
1 parent 8a1fbec commit a59c5d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,9 @@ public Builder initializeAsRemoteStoreRestore(
}
IndexShardRoutingTable.Builder indexShardRoutingBuilder = new IndexShardRoutingTable.Builder(shardId);
IndexShardRoutingTable indexShardRoutingTable = indexShardRoutingTableMap.get(shardId);
if (forceRecoverAllPrimaries
|| indexShardRoutingTable == null
|| indexShardRoutingTable.primaryShard().unassigned()
if (forceRecoverAllPrimaries || indexShardRoutingTable == null || indexShardRoutingTable.primaryShard().unassigned()
// When remote indices are restored via remote metadata,
// the shards are left in INITIALIZING state with unassigned Reason as still CLUSTER_RECOVERED
|| (indexShardRoutingTable.primaryShard().initializing()
&& indexShardRoutingTable.primaryShard().unassignedInfo().getReason() == UnassignedInfo.Reason.CLUSTER_RECOVERED)) {
// Primary shard to be recovered from remote store.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3533,7 +3533,12 @@ public void startRecovery(
executeRecovery("from store", recoveryState, recoveryListener, this::recoverFromStore);
break;
case REMOTE_STORE:
// When remote indices are restored via remote metadata,
// the recovery source is REMOTE_STORE and unassigned Reason is CLUSTER_RECOVERED
// During remote index restore from local disk metadata, the unassigned Reason is still CLUSTER_RECOVERED
// but the RecoverySource is not REMOTE_STORE but EXISTING_STORE
if (shardRouting.unassignedInfo().getReason() == UnassignedInfo.Reason.CLUSTER_RECOVERED) {
// At this stage the shard is in INITIALIZING state
logger.info("Cannot start recovery yet!");
} else {
executeRecovery("from remote store", recoveryState, recoveryListener, l -> restoreFromRemoteStore(l));
Expand Down

0 comments on commit a59c5d3

Please sign in to comment.