File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
core/src/main/java/org/elasticsearch/index/translog Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -425,10 +425,10 @@ public Location add(final Operation operation) throws IOException {
425425 ensureOpen ();
426426 location = current .add (bytes , operation .seqNo ());
427427 }
428- try ( ReleasableLock ignored = writeLock . acquire ( )) {
429- if ( shouldFoldGeneration ( this ) && foldingGeneration . compareAndSet ( false , true )) {
430- // we have to check the condition again lest we could fold twice in a race
431- if ( shouldFoldGeneration ( this )) {
428+ if ( shouldFoldGeneration ( this ) && foldingGeneration . compareAndSet ( false , true )) {
429+ // we have to check the condition again lest we could fold twice in a race
430+ if ( shouldFoldGeneration ( this )) {
431+ try ( ReleasableLock ignored = writeLock . acquire ( )) {
432432 this .foldGeneration (current .getGeneration ());
433433 }
434434 final boolean wasFoldingGeneration = foldingGeneration .getAndSet (false );
You can’t perform that action at this time.
0 commit comments