Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Remote cluster state download/restore is failing for Data stream #10773

Closed
dhwanilpatel opened this issue Oct 20, 2023 · 0 comments
Closed
Labels
bug Something isn't working untriaged

Comments

@dhwanilpatel
Copy link
Contributor

dhwanilpatel commented Oct 20, 2023

Describe the bug
Remote cluster state download/restore is failing for Data stream. It throws the NPE and kills the process. It is able to sucessfully download the global metadata and index metadata seperatly, it is failing when we combine both in Single Metadata to return. Index Metadata which we got from remote is map of (index uuid -> index metadata). During building metadata of data stream, it finds the index metadata using index name in indices map, which returns null and causes NPE.

[2023-10-19T10:39:18,292][ERROR][o.o.b.Bootstrap          ] [2e85817919de4d9540903aefd5bf46f1] Exception
java.lang.IllegalStateException: Unable to restore remote index metadata
        at org.opensearch.index.recovery.RemoteStoreRestoreService.restore(RemoteStoreRestoreService.java:154)
        at org.opensearch.gateway.GatewayMetaState.start(GatewayMetaState.java:178)
        at org.opensearch.node.Node.start(Node.java:1444)
        at org.opensearch.bootstrap.Bootstrap.start(Bootstrap.java:339)
        at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:413)
        at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:180)
        at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:171)
        at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104)
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
        at org.opensearch.cli.Command.main(Command.java:101)
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:137)
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:103)
Caused by: java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:208)
        at java.base/java.util.ImmutableCollections$List12.<init>(ImmutableCollections.java:556)
        at java.base/java.util.List.of(List.java:1043)
        at java.base/java.util.ImmutableCollections.listCopy(ImmutableCollections.java:172)
        at java.base/java.util.List.copyOf(List.java:1068)
        at org.opensearch.cluster.metadata.IndexAbstraction$DataStream.<init>(IndexAbstraction.java:348)
        at org.opensearch.cluster.metadata.Metadata$Builder.buildIndicesLookup(Metadata.java:1652)
        at org.opensearch.cluster.metadata.Metadata$Builder.buildMetadataWithRecomputedIndicesLookups(Metadata.java:1601)
        at org.opensearch.cluster.metadata.Metadata$Builder.build(Metadata.java:1489)
        at org.opensearch.gateway.remote.RemoteClusterStateService.getLatestMetadata(RemoteClusterStateService.java:734)
        at org.opensearch.index.recovery.RemoteStoreRestoreService.restore(RemoteStoreRestoreService.java:149)
        ... 11 more

Fix
Index Metadata we get from remote store is map of (Index uuid -> Index Metadata). We need to convert it to (Index name -> Index Metadata).

// Fetch Global Metadata
Metadata globalMetadata = getGlobalMetadata(clusterName, clusterUUID, clusterMetadataManifest.get());
// Fetch Index Metadata
Map<String, IndexMetadata> indices = getIndexMetadataMap(clusterName, clusterUUID, clusterMetadataManifest.get());
return Metadata.builder(globalMetadata).indices(indices).build();

Meta issue #10523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

2 participants