Skip to content

DedicatedClusterSnapshotRestoreIT#testRestoreShrinkIndex fails #38845

@DaveCTurner

Description

@DaveCTurner

Possibly relates #38256, at least this is the same test that still seems to be failing in latest master (cacf81a).

The actual issue seems to be here:

  1> java.lang.NullPointerException: null
  1>    at org.elasticsearch.common.settings.IndexScopedSettings.<init>(IndexScopedSettings.java:187) ~[main/:?]
  1>    at org.elasticsearch.common.settings.IndexScopedSettings.copy(IndexScopedSettings.java:191) ~[main/:?]
  1>    at org.elasticsearch.index.IndexSettings.<init>(IndexSettings.java:434) ~[main/:?]
  1>    at org.elasticsearch.index.IndexSettings.<init>(IndexSettings.java:423) ~[main/:?]
  1>    at org.elasticsearch.indices.IndicesService.buildIndexSettings(IndicesService.java:940) ~[main/:?]
  1>    at org.elasticsearch.indices.IndicesService.verifyIndexIsDeleted(IndicesService.java:882) ~[main/:?]
  1>    at org.elasticsearch.indices.cluster.IndicesClusterStateService.deleteIndices(IndicesClusterStateService.java:338) ~[main/:?]
  1>    at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyClusterState(IndicesClusterStateService.java:258) ~[main/:?]
  1>    at org.elasticsearch.cluster.service.ClusterApplierService.lambda$callClusterStateAppliers$5(ClusterApplierService.java:472) ~[main/:?]
  1>    at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
  1>    at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:470) ~[main/:?]
  1>    at org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:459) ~[main/:?]
  1>    at org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:413) [main/:?]
  1>    at org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:164) [main/:?]
  1>    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:681) [main/:?]
  1>    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [main/:?]
  1>    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [main/:?]
  1>    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
  1>    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
  1>    at java.lang.Thread.run(Thread.java:834) [?:?]

The trouble being, I think, that there's a race in which the index directory exists without any metadata, so we get a null here rather than an exception:

metaData = metaStateService.loadIndexState(index);

I think we should throw something there rather than passing null to buildIndexSettings(metaData); a few lines further down.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions