Skip to content

Commit

Permalink
Bugfix: remove assert on non-empty translog reader list
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
Sachin Kale committed Aug 21, 2023
1 parent 784a473 commit 5bc6f99
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,11 @@ private void deleteStaleRemotePrimaryTerms() {
// are older files that are no longer needed and should be cleaned up. In here, we delete all files that are part
// of older primary term.
if (olderPrimaryCleaned.trySet(Boolean.TRUE)) {
if (readers.isEmpty()) {
logger.info("Translog reader list is empty");
return;
}
// First we delete all stale primary terms folders from remote store
assert readers.isEmpty() == false : shardId + " Expected non-empty readers";
long minimumReferencedPrimaryTerm = readers.stream().map(BaseTranslogReader::getPrimaryTerm).min(Long::compare).get();
translogTransferManager.deletePrimaryTermsAsync(minimumReferencedPrimaryTerm);
}
Expand Down

0 comments on commit 5bc6f99

Please sign in to comment.