Skip to content

Commit b6fbf5a

Browse files
committed
Fix pending deletes timeout log message (#75776)
In 2f0d158 we introduced a message reporting a timeout of 30 seconds when acquiring shard locks in order to delete an index, but in fact the timeout is 30 minutes. This commit fixes the message.
1 parent 4a60b1a commit b6fbf5a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
import org.elasticsearch.cluster.routing.RoutingTable;
2727
import org.elasticsearch.cluster.routing.ShardRouting;
2828
import org.elasticsearch.cluster.service.ClusterService;
29-
import org.elasticsearch.core.Nullable;
3029
import org.elasticsearch.common.component.AbstractLifecycleComponent;
3130
import org.elasticsearch.common.inject.Inject;
3231
import org.elasticsearch.common.settings.Settings;
33-
import org.elasticsearch.core.TimeValue;
3432
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
3533
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
34+
import org.elasticsearch.core.Nullable;
35+
import org.elasticsearch.core.TimeValue;
3636
import org.elasticsearch.env.ShardLockObtainFailedException;
3737
import org.elasticsearch.gateway.GatewayService;
3838
import org.elasticsearch.index.Index;
@@ -73,7 +73,6 @@
7373
import java.util.Objects;
7474
import java.util.Set;
7575
import java.util.concurrent.ConcurrentMap;
76-
import java.util.concurrent.TimeUnit;
7776
import java.util.function.BiConsumer;
7877
import java.util.function.Consumer;
7978

@@ -313,14 +312,15 @@ public void onFailure(Exception e) {
313312

314313
@Override
315314
protected void doRun() throws Exception {
315+
final TimeValue timeout = TimeValue.timeValueMinutes(30);
316316
try {
317317
// we are waiting until we can lock the index / all shards on the node and then we ack the delete of the store
318318
// to the master. If we can't acquire the locks here immediately there might be a shard of this index still
319319
// holding on to the lock due to a "currently canceled recovery" or so. The shard will delete itself BEFORE the
320320
// lock is released so it's guaranteed to be deleted by the time we get the lock
321-
indicesService.processPendingDeletes(index, indexSettings, new TimeValue(30, TimeUnit.MINUTES));
321+
indicesService.processPendingDeletes(index, indexSettings, timeout);
322322
} catch (ShardLockObtainFailedException exc) {
323-
logger.warn("[{}] failed to lock all shards for index - timed out after 30 seconds", index);
323+
logger.warn("[{}] failed to lock all shards for index - timed out after [{}]]", index, timeout);
324324
} catch (InterruptedException e) {
325325
logger.warn("[{}] failed to lock all shards for index - interrupted", index);
326326
}

0 commit comments

Comments
 (0)