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 Nov 12, 2023
1 parent 0452d14 commit b01e483
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 b01e483

Please sign in to comment.