Skip to content

Commit 1089a0e

Browse files
Revert "Snapshot Stability Fixes (#39502)" (#39549)
This reverts commit 4b725e0.
1 parent 4b725e0 commit 1089a0e

File tree

4 files changed

+441
-444
lines changed

4 files changed

+441
-444
lines changed

server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
2525
import org.elasticsearch.Version;
2626
import org.elasticsearch.cluster.ClusterState.Custom;
27-
import org.elasticsearch.common.Nullable;
2827
import org.elasticsearch.common.collect.ImmutableOpenMap;
2928
import org.elasticsearch.common.io.stream.StreamInput;
3029
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -94,11 +93,9 @@ public static class Entry {
9493
private final ImmutableOpenMap<String, List<ShardId>> waitingIndices;
9594
private final long startTime;
9695
private final long repositoryStateId;
97-
@Nullable private final String failure;
9896

9997
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices,
100-
long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards,
101-
String failure) {
98+
long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) {
10299
this.state = state;
103100
this.snapshot = snapshot;
104101
this.includeGlobalState = includeGlobalState;
@@ -113,26 +110,15 @@ public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, Sta
113110
this.waitingIndices = findWaitingIndices(shards);
114111
}
115112
this.repositoryStateId = repositoryStateId;
116-
this.failure = failure;
117-
}
118-
119-
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices,
120-
long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) {
121-
this(snapshot, includeGlobalState, partial, state, indices, startTime, repositoryStateId, shards, null);
122113
}
123114

124115
public Entry(Entry entry, State state, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) {
125116
this(entry.snapshot, entry.includeGlobalState, entry.partial, state, entry.indices, entry.startTime,
126-
entry.repositoryStateId, shards, entry.failure);
127-
}
128-
129-
public Entry(Entry entry, State state, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards, String failure) {
130-
this(entry.snapshot, entry.includeGlobalState, entry.partial, state, entry.indices, entry.startTime,
131-
entry.repositoryStateId, shards, failure);
117+
entry.repositoryStateId, shards);
132118
}
133119

134120
public Entry(Entry entry, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) {
135-
this(entry, entry.state, shards, entry.failure);
121+
this(entry, entry.state, shards);
136122
}
137123

138124
public Snapshot snapshot() {
@@ -171,10 +157,6 @@ public long getRepositoryStateId() {
171157
return repositoryStateId;
172158
}
173159

174-
public String failure() {
175-
return failure;
176-
}
177-
178160
@Override
179161
public boolean equals(Object o) {
180162
if (this == o) return true;
@@ -455,21 +437,14 @@ public SnapshotsInProgress(StreamInput in) throws IOException {
455437
if (in.getVersion().onOrAfter(REPOSITORY_ID_INTRODUCED_VERSION)) {
456438
repositoryStateId = in.readLong();
457439
}
458-
final String failure;
459-
if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
460-
failure = in.readOptionalString();
461-
} else {
462-
failure = null;
463-
}
464440
entries[i] = new Entry(snapshot,
465441
includeGlobalState,
466442
partial,
467443
state,
468444
Collections.unmodifiableList(indexBuilder),
469445
startTime,
470446
repositoryStateId,
471-
builder.build(),
472-
failure);
447+
builder.build());
473448
}
474449
this.entries = Arrays.asList(entries);
475450
}
@@ -501,9 +476,6 @@ public void writeTo(StreamOutput out) throws IOException {
501476
if (out.getVersion().onOrAfter(REPOSITORY_ID_INTRODUCED_VERSION)) {
502477
out.writeLong(entry.repositoryStateId);
503478
}
504-
if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
505-
out.writeOptionalString(entry.failure);
506-
}
507479
}
508480
}
509481

server/src/main/java/org/elasticsearch/snapshots/SnapshotException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public SnapshotException(final Snapshot snapshot, final String msg, final Throwa
5151
}
5252
}
5353

54+
public SnapshotException(final String repositoryName, final SnapshotId snapshotId, final String msg) {
55+
this(repositoryName, snapshotId, msg, null);
56+
}
57+
5458
public SnapshotException(final String repositoryName, final SnapshotId snapshotId, final String msg, final Throwable cause) {
5559
super("[" + repositoryName + ":" + snapshotId + "] " + msg, cause);
5660
this.repositoryName = repositoryName;

0 commit comments

Comments
 (0)