From 629d9004503931db38067d400b4add9f83301944 Mon Sep 17 00:00:00 2001 From: acarbonetto Date: Tue, 22 Aug 2023 09:33:09 -0700 Subject: [PATCH] Update getDataSourceMetadata to get for initial state Signed-off-by: acarbonetto --- .../storage/OpenSearchDataSourceMetadataStorage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java b/datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java index 0ee5b82bca..632aa78c0e 100644 --- a/datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java +++ b/datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java @@ -80,7 +80,7 @@ public OpenSearchDataSourceMetadataStorage( @Override public List getDataSourceMetadata() { - if (this.clusterService.state() == null) { + if (!this.clusterService.getClusterApplierService().isInitialClusterStateSet()) { return Collections.emptyList(); } if (!this.clusterService.state().routingTable().hasIndex(DATASOURCE_INDEX_NAME)) {