Skip to content

Commit

Permalink
More tests and more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gbbafna committed Nov 22, 2022
1 parent b304f1d commit e21ce2d
Show file tree
Hide file tree
Showing 4 changed files with 843 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ public void close() throws IOException {
: "Translog.close method is called from inside Translog, but not via closeOnTragicEvent method";
if (closed.compareAndSet(false, true)) {
try (ReleasableLock lock = writeLock.acquire()) {
prepareAndUpload(primaryTermSupplier.getAsLong(), null);
if (current.syncNeeded()) {
prepareAndUpload(primaryTermSupplier.getAsLong(), null);
}
} finally {
logger.debug("translog closed");
closeFilesIfNoPendingRetentionLocks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public boolean uploadTranslog(TransferSnapshot translogCheckpointTransferSnapsho
toUpload.addAll(exclusionFilter.apply(translogCheckpointTransferSnapshot.getCheckpointFileSnapshots()));
if (toUpload.isEmpty()) {
logger.warn("Nothing to upload for transfer size {}", translogCheckpointTransferSnapshot.getTransferSize());
translogTransferListener.onUploadComplete(translogCheckpointTransferSnapshot);
return true;
}
final CountDownLatch latch = new CountDownLatch(toUpload.size());
Expand Down
Loading

0 comments on commit e21ce2d

Please sign in to comment.