瀏覽代碼

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
henakamaMSFT 8 年之前
父節點
當前提交
72ec3d2661
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/src/main/java/org/elasticsearch/indices/recovery/RecoverySourceHandler.java

+ 1 - 1
core/src/main/java/org/elasticsearch/indices/recovery/RecoverySourceHandler.java

@@ -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.