opensearch-project / dashboards-query-workbench

The OpenSearch Dashboards Query Workbench enables you to query your OpenSearch data using either SQL or PPL
Apache License 2.0
7 stars 30 forks source link

[Bug]+[FEATURE] Query Workbench should have an implementation to support cross cluster redirection #403

Open RyanL1997 opened 1 month ago

RyanL1997 commented 1 month ago

Problem to solve

Under the MDS environment, when the redirection from datasource management to query workbench happens, there is a cluster selection mismatch.

BackGround

With the support of MDS in 2.14+, query workbench itself has the ability to consume the remote cluster api calls for query the remote content, since it has a global data picker for cluster selection. However, when other plugins, such as, data source management, is trying to redirect into the query workbench, it doesn't has the mechanism to point the query to a specific cluster.

The above issue gets surfaced up, since the original global datasource picker in data source management that introduced in PR:

was removed in PR:

According to this, when redirection to query workbench happens in data source management, query workbench will always treat as the targeting cluster as the the current global value of the current cluster, which in the above case, the global value is not being setup, so it will always select the default cluster.

Here is a video of how to reproduce the issue:

  1. Enable MDS and connect to a remote cluster.
  2. Get a flint setup domain on local cluster
  3. Go to Datasource management page and select the flint datasource in the "direct query connections" tab for the local cluster
  4. Click into the detailed connection page, and click on the "Create Acceleration" card/button, so that it will pop up the Flint acceleration creation flow as a flyout.
  5. Try to filling the required field, for a creation of Skipping/MV/CV/
  6. Select "Preview SQL Definition" and click on "Edit in query workbench"
  7. When the redirection happens, even the query that generated in datasource management for local cluster's flint datasource is pasted in query workbench,. However, the cluster picker in query workbench shows the user is querying in the remote cluster, since that is the default cluster.

https://github.com/user-attachments/assets/0fceb520-d4df-48e7-a482-36bb02bcf8a7

How to resolve this issue

dblock commented 2 weeks ago

[Catch All Triage - 1, 2]