Expose system index metadata in CAT indices - #11201
Conversation
…temIndexPlugin.getSystemIndexDescriptors Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Compatibility status:Checks if related components are compatible with change 7ad8bc7 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/performance-analyzer.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git] |
|
❌ Gradle check result for 4af2dd5: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 8b35852: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
❌ Gradle check result for 7ad8bc7: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
This PR is stalled because it has been open for 30 days with no activity. |
|
@cwperks Thanks for creating this PR, but I don't think this is the right kind of change. AFAIK OpenSearch doesn't expose the notion of system index in any of the other APIs so only exposing it via a filtering parameter on cat indices it. To move forward with this change can you map out all the externally facing places that should be updated and this change would be part of that whole. IMO the first incremental change should be to return the property as part of the index settings then plumb it elsewhere. I'm going to close this PR, after creating an issue that lays out how this would work as a whole feel free to reopen. |
|
I will draft up an issue for this to solicit comments. There's been a lot of discussion around system indices and I was surprised to find that there wasn't any way to list out all system indices and their descriptors that are defined by |
PR Reviewer Guide 🔍(Review updated until commit 3b04ea1)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 3b04ea1 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 27195f6
Suggestions up to commit 92dfbd8
|
|
❌ Gradle check result for 92dfbd8: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Craig Perkins <craig5008@gmail.com>
/_cat/indices to only list system indices from SystemIndexPlugin.getSystemIndexDescriptors|
Persistent review updated to latest commit 27195f6 |
|
❌ Gradle check result for 27195f6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 3b04ea1 |
|
❌ Gradle check result for 3b04ea1: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
Adds system-index discovery to
/_cat/indicesusing the system metadata and descriptors already maintained by OpenSearch.The
systemquery parameter filters results:/_cat/indices?system=truereturns only system indices./_cat/indices?system=falsereturns only non-system indices.systempreserves the existing behavior and returns both.The response supports two columns:
system(sys): whetherIndexMetadata.isSystem()is true.system.description(sysdesc): the description from the matchingSystemIndexDescriptor, when available.These columns do not change the default output when
systemis omitted. They can be selected explicitly withh=system,system.description, and are shown by default when thesystemfilter is specified.Rationale
OpenSearch previously had no API for operators to identify indices registered through
SystemIndexPlugin.getSystemIndexDescriptors()or inspect their descriptions without reading plugin source.Since this PR was originally opened, OpenSearch added and maintains
IndexMetadata.isSystem(). This update uses that metadata as the filtering source of truth, addressing the earlier review concern that system status should first be represented in index metadata. The descriptor registry remains the source for the human-readable description.This reports OpenSearch Core's system-index classification. Security-plugin protection and authorization remain separate concerns and continue to determine which indices a caller may access.
Changes
systemas a supported CAT response/query parameter.IndexMetadata.isSystem()for consistent cluster-state behavior.systemandsystem.descriptioncolumns.main.Testing
All listed checks pass locally.
Checklist