Fixing the error message to report the number of docs correctly for each node (#22515)
There is a bug in the error message that is thrown if the number of docs differs between the source and target shards when recovering a shard with a syncId. The source and target doc counts are swapped around. Closes #21893
This commit is contained in:
parent
dc81afd4f8
commit
72ec3d2661
|
@ -222,7 +222,7 @@ public class RecoverySourceHandler {
|
|||
final long numDocsSource = recoverySourceMetadata.getNumDocs();
|
||||
if (numDocsTarget != numDocsSource) {
|
||||
throw new IllegalStateException("try to recover " + request.shardId() + " from primary shard with sync id but number " +
|
||||
"of docs differ: " + numDocsTarget + " (" + request.sourceNode().getName() + ", primary) vs " + numDocsSource
|
||||
"of docs differ: " + numDocsSource + " (" + request.sourceNode().getName() + ", primary) vs " + numDocsTarget
|
||||
+ "(" + request.targetNode().getName() + ")");
|
||||
}
|
||||
// we shortcut recovery here because we have nothing to copy. but we must still start the engine on the target.
|
||||
|
|
Loading…
Reference in New Issue