Skip to content

Commit

Permalink
Fix read/write method for Diff Manifest in case Shard diff file is null
Browse files Browse the repository at this point in the history
Signed-off-by: Shailendra Singh <[email protected]>
  • Loading branch information
Shailendra Singh committed Jul 24, 2024
1 parent 7673a77 commit 7f00ba4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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();
}
}

0 comments on commit 7f00ba4

Please sign in to comment.