Skip to content

Commit

Permalink
Skipping upload when no diff
Browse files Browse the repository at this point in the history
Signed-off-by: Bukhtawar Khan <[email protected]>
  • Loading branch information
Bukhtawar committed Aug 4, 2024
1 parent 607317a commit 4607c5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ public void getAsyncIndexRoutingDiffWriteAction(
term,
version
);

if (remoteRoutingTableDiff.getDiffs().isEmpty()) {
logger.info("No index routing diff found, completing request");
latchedActionListener.onResponse(null);
return;
}
ActionListener<Void> completionListener = ActionListener.wrap(
resp -> latchedActionListener.onResponse(remoteRoutingTableDiff.getUploadedMetadata()),
ex -> latchedActionListener.onFailure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ List<ClusterMetadataManifest.UploadedIndexMetadata> getAllUploadedIndicesRouting
List<String> indicesRoutingToDelete
);

public void deleteStaleIndexRoutingPaths(List<String> stalePaths) throws IOException;
void deleteStaleIndexRoutingPaths(List<String> stalePaths) throws IOException;

public void deleteStaleIndexRoutingDiffPaths(List<String> stalePaths) throws IOException;
void deleteStaleIndexRoutingDiffPaths(List<String> stalePaths) throws IOException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public void testTimeoutWhileWritingManifestFile() throws IOException {
anyMap(),
anyBoolean(),
anyList(),
anyMap()
any(RoutingTable.class)
)
).thenReturn(new RemoteClusterStateUtils.UploadedMetadataResults());
RemoteStateTransferException ex = expectThrows(
Expand Down Expand Up @@ -687,7 +687,7 @@ public void testWriteIncrementalMetadataSuccess() throws IOException {
eq(Collections.emptyMap()),
eq(false),
eq(Collections.emptyList()),
eq(Collections.emptyMap())
eq(clusterState.getRoutingTable())
);

assertThat(manifestInfo.getManifestFileName(), notNullValue());
Expand Down Expand Up @@ -768,7 +768,7 @@ public void testWriteIncrementalMetadataSuccessWhenPublicationEnabled() throws I
eq(Collections.emptyMap()),
eq(true),
anyList(),
eq(Collections.emptyMap())
eq(clusterState.getRoutingTable())
);

assertThat(manifestInfo.getManifestFileName(), notNullValue());
Expand Down

0 comments on commit 4607c5d

Please sign in to comment.