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.
This commit is contained in:
Jason Tedor 2019-02-18 15:06:54 -05:00
parent bbb61002ba
commit d43ac8fe11
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5

View File

@ -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.SegmentInfos;
@ -2015,7 +2016,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());