Skip to content

Commit 71f6aa1

Browse files
author
Andrey Ershov
committed
BWC
1 parent 0e956ae commit 71f6aa1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ public void writeTo(StreamOutput out) throws IOException {
8989
if (out.getVersion().onOrAfter(MULTIPLE_REPOSITORIES_SUPPORT_ADDED)) {
9090
out.writeStringArray(repositories);
9191
} else {
92+
if (repositories.length != 1) {
93+
throw new IllegalArgumentException("Requesting snapshots from multiple repositories is not supported in versions prior " +
94+
"to " + MULTIPLE_REPOSITORIES_SUPPORT_ADDED.toString());
95+
}
9296
out.writeString(repositories[0]);
9397
}
9498
out.writeStringArray(snapshots);

server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ public void writeTo(StreamOutput out) throws IOException {
208208
}
209209
} else {
210210
if (successfulResponses.size() + failedResponses.size() != 1) {
211-
throw new IllegalArgumentException("snapshots from more than one repository are requested");
211+
throw new IllegalArgumentException("Requesting snapshots from multiple repositories is not supported in versions prior " +
212+
"to " + GetSnapshotsRequest.MULTIPLE_REPOSITORIES_SUPPORT_ADDED.toString());
212213
}
213214

214215
if (successfulResponses.size() == 1) {

0 commit comments

Comments
 (0)