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 (#10985)

(cherry picked from commit b01e483)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Nov 12, 2023
1 parent 7ff594c commit c85c8c0
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 c85c8c0

Please sign in to comment.