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.
@@ -21,6 +21,7 @@ package org.elasticsearch.index.shard;
import com.carrotsearch.hppc.ObjectLongMap;
import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.message.ParameterizedMessage;
import org.apache.lucene.index.CheckIndex;
import org.apache.lucene.index.IndexCommit;
import org.apache.lucene.index.IndexOptions;
@@ -2051,7 +2052,12 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl
retentionLeaseSyncer.sync(
shardId,
retentionLeases.v2(),
- ActionListener.wrap(r -> {}, e -> logger.warn("failed to sync retention leases after expiration check", e)));
+ ActionListener.wrap(
+ r -> {},
+ e -> logger.warn(new ParameterizedMessage(
+ "failed to sync retention leases [{}] after expiration check",
+ retentionLeases),
+ e)));
} else {
logger.trace("background syncing retention leases [{}] after expiration check", retentionLeases.v2());
retentionLeaseSyncer.backgroundSync(shardId, retentionLeases.v2());
