Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.16] Fix read/write in stream method for Diff Manifest when shard diff file is null #14950

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public ClusterStateDiffManifest(
clusterStateCustomUpdated = new ArrayList<>(clusterStateCustomDiff.getDiffs().keySet());
clusterStateCustomUpdated.addAll(clusterStateCustomDiff.getUpserts().keySet());
clusterStateCustomDeleted = clusterStateCustomDiff.getDeletes();
List<String> indicie1s = indicesRoutingUpdated;
}

public ClusterStateDiffManifest(
Expand Down Expand Up @@ -190,7 +189,7 @@ public ClusterStateDiffManifest(StreamInput in) throws IOException {
this.hashesOfConsistentSettingsUpdated = in.readBoolean();
this.clusterStateCustomUpdated = in.readStringList();
this.clusterStateCustomDeleted = in.readStringList();
this.indicesRoutingDiffPath = in.readString();
this.indicesRoutingDiffPath = in.readOptionalString();
}

@Override
Expand Down Expand Up @@ -535,7 +534,8 @@ public int hashCode() {
indicesRoutingDeleted,
hashesOfConsistentSettingsUpdated,
clusterStateCustomUpdated,
clusterStateCustomDeleted
clusterStateCustomDeleted,
indicesRoutingDiffPath
);
}

Expand All @@ -562,7 +562,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(hashesOfConsistentSettingsUpdated);
out.writeStringCollection(clusterStateCustomUpdated);
out.writeStringCollection(clusterStateCustomDeleted);
out.writeString(indicesRoutingDiffPath);
out.writeOptionalString(indicesRoutingDiffPath);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public long getIndexRoutingFilesCleanupAttemptFailedCount() {
}

public void indicesRoutingDiffFileCleanupAttemptFailed() {
indexRoutingFilesCleanupAttemptFailedCount.incrementAndGet();
indicesRoutingDiffFilesCleanupAttemptFailedCount.incrementAndGet();
}

public long getIndicesRoutingDiffFileCleanupAttemptFailedCount() {
return indexRoutingFilesCleanupAttemptFailedCount.get();
return indicesRoutingDiffFilesCleanupAttemptFailedCount.get();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public void testIndicesRoutingDiffFilesCleanupFailureStats() throws Exception {
assertEquals(0, remoteClusterStateCleanupManager.getStats().getIndicesRoutingDiffFileCleanupAttemptFailedCount());
});

doThrow(IOException.class).when(remoteRoutingTableService).deleteStaleIndexRoutingPaths(any());
doThrow(IOException.class).when(remoteRoutingTableService).deleteStaleIndexRoutingDiffPaths(any());
remoteClusterStateCleanupManager.deleteClusterMetadata(clusterName, clusterUUID, activeBlobs, inactiveBlobs);
assertBusy(() -> {
// wait for stats to get updated
Expand Down
Loading