Skip to content

Commit

Permalink
[Remote Translog] Fix translog inconsistent generation assertion fail…
Browse files Browse the repository at this point in the history
…ure in ITs (opensearch-project#10985)

Signed-off-by: Shivansh Arora <hishiv@amazon.com>
  • Loading branch information
ashking94 authored and shiv0408 committed Apr 25, 2024
1 parent 04f9563 commit 8af5c8c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,14 @@ public boolean syncNeeded() {
public void close() throws IOException {
assert Translog.calledFromOutsideOrViaTragedyClose() : shardId
+ "Translog.close method is called from inside Translog, but not via closeOnTragicEvent method";
if (closed.compareAndSet(false, true)) {
try (ReleasableLock lock = writeLock.acquire()) {
sync();
} finally {
logger.debug("translog closed");
closeFilesIfNoPendingRetentionLocks();
try (ReleasableLock lock = writeLock.acquire()) {
if (closed.compareAndSet(false, true)) {
try {
sync();
} finally {
logger.debug("translog closed");
closeFilesIfNoPendingRetentionLocks();
}
}
}
}
Expand Down

0 comments on commit 8af5c8c

Please sign in to comment.