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)
  • Loading branch information
ashking94 authored and rayshrey committed Mar 18, 2024
1 parent b64254b commit 1da7157
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 1da7157

Please sign in to comment.