Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private void startNewSnapshots(SnapshotsInProgress snapshotsInProgress) {
// due to CS batching we might have missed the INIT state and straight went into ABORTED
// notify cluster-manager that abort has completed by moving to FAILED
if (shard.getValue().state() == ShardState.ABORTED && localNodeId.equals(shard.getValue().nodeId())) {
notifyFailedSnapshotShard(snapshot, shard.getKey(), shard.getValue().reason());
notifyFailedSnapshotShard(snapshot, shard.getKey(), shard.getValue().reason(), shard.getValue().generation());
}
} else {
snapshotStatus.abortIfNotCompleted("snapshot has been aborted");
Expand Down Expand Up @@ -314,7 +314,7 @@ public void onFailure(Exception e) {
logger.warn(() -> new ParameterizedMessage("[{}][{}] failed to snapshot shard", shardId, snapshot), e);
}
snapshotStatus.moveToFailed(threadPool.absoluteTimeInMillis(), failure);
notifyFailedSnapshotShard(snapshot, shardId, failure);
notifyFailedSnapshotShard(snapshot, shardId, failure, snapshotStatus.generation());
}
}
);
Expand Down Expand Up @@ -594,10 +594,15 @@ private void notifySuccessfulSnapshotShard(final Snapshot snapshot, final ShardI

/** Notify the cluster-manager node that the given shard failed to be snapshotted **/
private void notifyFailedSnapshotShard(final Snapshot snapshot, final ShardId shardId, final String failure) {
notifyFailedSnapshotShard(snapshot, shardId, failure, null);
}

/** Notify the cluster-manager node that the given shard failed to be snapshotted **/
private void notifyFailedSnapshotShard(final Snapshot snapshot, final ShardId shardId, final String failure, String generation) {
sendSnapshotShardUpdate(
snapshot,
shardId,
new ShardSnapshotStatus(clusterService.localNode().getId(), ShardState.FAILED, failure, null)
new ShardSnapshotStatus(clusterService.localNode().getId(), ShardState.FAILED, failure, generation)
);
}

Expand Down
Loading