Exclude system indices from remote cluster state#22333
Conversation
PR Reviewer Guide 🔍(Review updated until commit ea66c85)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to ea66c85 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 910631b
Suggestions up to commit b1bc906
Suggestions up to commit e551f2f
Suggestions up to commit a90841e
|
|
❌ Gradle check result for a90841e: 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 e551f2f |
|
❌ Gradle check result for e551f2f: 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? |
e551f2f to
b1bc906
Compare
|
Persistent review updated to latest commit b1bc906 |
b1bc906 to
910631b
Compare
Remote cluster state publication failed when system indices were present because manifest verification counted all cluster indices instead of only those published remotely. Apply the same system index filter during verification and add an integration test for issue opensearch-project#21043. Signed-off-by: MdTanwer <tanw9004167@gmail.com>
|
Persistent review updated to latest commit 910631b |
910631b to
ea66c85
Compare
|
Persistent review updated to latest commit ea66c85 |
|
❌ Gradle check result for ea66c85: 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? |
Summary
Exclude system indices from remote cluster state publish, restore, and manifest verification using the existing
SystemIndicesregistry.Fixes #21043.
Problem
Remote cluster state persists index metadata only — not index documents. System indices such as
.opendistro_securitystore their configuration as documents on local disk.When remote cluster state was enabled, system index metadata was uploaded alongside user indices. After a node restart with empty local storage (e.g. Kubernetes
emptyDir), OpenSearch restored that metadata from remote while the on-disk documents were gone. Plugins like security then saw the index as already existing (ResourceAlreadyExistsException) and never finished initialization (OpenSearch Security not initialized).Solution
Introduce
RemoteClusterStateIndexFilter, backed bySystemIndices, and apply it consistently across remote cluster state paths:writeFullMetadata): skip system index metadata and routing on uploadwriteIncrementalMetadata): skip system indices from upload/diff computation; strip them from the previous manifest map used for incremental updatesgetClusterStateForManifest,getClusterStateUsingDiff): filter system indices out of downloaded manifests before rebuilding cluster stateverifyManifestMatchesClusterState): compare manifest entries against the filtered set of cluster indices so publication succeeds when system indices are present locallyGatewayMetaState.RemotePersistedStatedelegates manifest checks toRemoteClusterStateService, andNodewiresSystemIndicesinto the service constructor.