File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
server/src/main/java/org/elasticsearch/index/seqno Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,10 @@ public synchronized void updateRetentionLeasesOnReplica(final RetentionLeases re
343
343
* @throws IOException if an I/O exception occurs reading the retention leases
344
344
*/
345
345
public RetentionLeases loadRetentionLeases (final Path path ) throws IOException {
346
- final RetentionLeases retentionLeases = RetentionLeases .FORMAT .loadLatestState (logger , NamedXContentRegistry .EMPTY , path );
346
+ final RetentionLeases retentionLeases ;
347
+ synchronized (retentionLeasePersistenceLock ) {
348
+ retentionLeases = RetentionLeases .FORMAT .loadLatestState (logger , NamedXContentRegistry .EMPTY , path );
349
+ }
347
350
348
351
// TODO after backporting we expect this never to happen in 8.x, so adjust this to throw an exception instead.
349
352
assert Version .CURRENT .major <= 8 : "throw an exception instead of returning EMPTY on null" ;
You can’t perform that action at this time.
0 commit comments