Skip to content

Commit 0f27264

Browse files
authored
Merge branch 'main' into jdk-24-unsupported-ciphers
2 parents 3d44b1c + c7e7dbe commit 0f27264

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

docs/changelog/123569.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 123569
2+
summary: Abort pending deletion on `IndicesService` close
3+
area: Store
4+
type: enhancement
5+
issues: []

muted-tests.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ tests:
254254
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
255255
method: test {yaml=snapshot.delete/10_basic/Delete a snapshot asynchronously}
256256
issue: https://github.com/elastic/elasticsearch/issues/122102
257-
- class: org.elasticsearch.datastreams.TSDBPassthroughIndexingIT
258-
issue: https://github.com/elastic/elasticsearch/issues/121716
259257
- class: org.elasticsearch.smoketest.SmokeTestMonitoringWithSecurityIT
260258
method: testHTTPExporterWithSSL
261259
issue: https://github.com/elastic/elasticsearch/issues/122220
@@ -286,15 +284,9 @@ tests:
286284
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
287285
method: test {yaml=reference/snapshot-restore/apis/get-snapshot-api/line_408}
288286
issue: https://github.com/elastic/elasticsearch/issues/122681
289-
- class: org.elasticsearch.xpack.autoscaling.storage.ReactiveStorageIT
290-
method: testScaleWhileShrinking
291-
issue: https://github.com/elastic/elasticsearch/issues/122119
292287
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
293288
method: testSearchWithRandomDisconnects
294289
issue: https://github.com/elastic/elasticsearch/issues/122707
295-
- class: org.elasticsearch.snapshots.DedicatedClusterSnapshotRestoreIT
296-
method: testRestoreShrinkIndex
297-
issue: https://github.com/elastic/elasticsearch/issues/121717
298290
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
299291
method: test {yaml=reference/cat/allocation/cat-allocation-example}
300292
issue: https://github.com/elastic/elasticsearch/issues/121976

server/src/main/java/org/elasticsearch/indices/IndicesService.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public class IndicesService extends AbstractLifecycleComponent
255255
private final Map<String, IndexStorePlugin.RecoveryStateFactory> recoveryStateFactories;
256256
private final IndexStorePlugin.IndexFoldersDeletionListener indexFoldersDeletionListeners;
257257
final AbstractRefCounted indicesRefCount; // pkg-private for testing
258+
private final CountDownLatch stopLatch = new CountDownLatch(1);
258259
private final CountDownLatch closeLatch = new CountDownLatch(1);
259260
private volatile boolean idFieldDataEnabled;
260261
private volatile boolean allowExpensiveQueries;
@@ -403,6 +404,7 @@ public ClusterService clusterService() {
403404

404405
@Override
405406
protected void doStop() {
407+
stopLatch.countDown();
406408
clusterService.removeApplier(timestampFieldMapperService);
407409
timestampFieldMapperService.doStop();
408410

@@ -1440,7 +1442,15 @@ public void processPendingDeletes(Index index, IndexSettings indexSettings, Time
14401442
}
14411443
if (remove.isEmpty() == false) {
14421444
logger.warn("{} still pending deletes present for shards {} - retrying", index, remove.toString());
1443-
Thread.sleep(sleepTime);
1445+
if (stopLatch.await(sleepTime, TimeUnit.MILLISECONDS)) {
1446+
logger.info(
1447+
"Indices service stopped. {} aborting pending deletes after [{}] for shards {}",
1448+
index,
1449+
TimeValue.timeValueNanos(System.nanoTime() - startTimeNS),
1450+
remove.toString()
1451+
);
1452+
break;
1453+
}
14441454
sleepTime = Math.min(maxSleepTimeMs, sleepTime * 2); // increase the sleep time gradually
14451455
logger.debug("{} schedule pending delete retry after {} ms", index, sleepTime);
14461456
}

server/src/test/java/org/elasticsearch/reservedstate/service/FileSettingsServiceTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.apache.logging.log4j.Level;
1313
import org.apache.logging.log4j.LogManager;
1414
import org.apache.logging.log4j.Logger;
15+
import org.apache.lucene.tests.util.LuceneTestCase;
1516
import org.elasticsearch.action.ActionListener;
1617
import org.elasticsearch.cluster.ClusterChangedEvent;
1718
import org.elasticsearch.cluster.ClusterName;
@@ -84,6 +85,7 @@
8485
import static org.mockito.Mockito.times;
8586
import static org.mockito.Mockito.verify;
8687

88+
@LuceneTestCase.SuppressFileSystems("ExtrasFS")
8789
public class FileSettingsServiceTests extends ESTestCase {
8890
private static final Logger logger = LogManager.getLogger(FileSettingsServiceTests.class);
8991
private Environment env;

0 commit comments

Comments
 (0)