Skip to content

Commit c792773

Browse files
committed
Include in log retention leases that failed to sync
When retention leases fail to sync after an expiration check, we emit a log message about this. This commit adds the retention leases that failed to sync.
1 parent e3004e4 commit c792773

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/src/main/java/org/elasticsearch/index/shard/IndexShard.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.carrotsearch.hppc.ObjectLongMap;
2323
import org.apache.logging.log4j.Logger;
24+
import org.apache.logging.log4j.message.ParameterizedMessage;
2425
import org.apache.lucene.index.CheckIndex;
2526
import org.apache.lucene.index.IndexCommit;
2627
import org.apache.lucene.index.SegmentInfos;
@@ -2014,7 +2015,12 @@ public void syncRetentionLeases() {
20142015
retentionLeaseSyncer.sync(
20152016
shardId,
20162017
retentionLeases.v2(),
2017-
ActionListener.wrap(r -> {}, e -> logger.warn("failed to sync retention leases after expiration check", e)));
2018+
ActionListener.wrap(
2019+
r -> {},
2020+
e -> logger.warn(new ParameterizedMessage(
2021+
"failed to sync retention leases [{}] after expiration check",
2022+
retentionLeases),
2023+
e)));
20182024
} else {
20192025
logger.trace("background syncing retention leases [{}] after expiration check", retentionLeases.v2());
20202026
retentionLeaseSyncer.backgroundSync(shardId, retentionLeases.v2());

0 commit comments

Comments
 (0)