Repository navigation
Conversation
Index pruning keeps the indices a field caps probe with the query's time range reports as matching. An index whose shards could not be checked was missing from that answer just like an index with nothing in range, so it was pruned and its documents were lost without any sign of it. With field caps reporting such indices as failures, keep them: the search then reaches the unavailable shards and reports the gap. Also stop pruning an expression that names a remote cluster, since field caps omits an unreachable remote without reporting it. Signed-off-by: Kai Huang <[email protected]>
PR Reviewer Guide 🔍(Review updated until commit 66650a7)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 66650a7
Previous suggestionsSuggestions up to commit 4b4996c
|
Signed-off-by: Kai Huang <[email protected]>
|
Persistent review updated to latest commit b9a524a |
OpenSearch now lists an unreachable remote cluster under failures as the expression asked of it, so keeping failed indices keeps it too and cross-cluster expressions no longer need to skip pruning. Signed-off-by: Kai Huang <[email protected]>
|
Persistent review updated to latest commit 66650a7 |
Description
Index pruning (#5766) keeps the indices that
_field_capswith the query's time range asindex_filterreports as matching. Today an index whose shards couldn't be checked is missing from that answer exactly like an index with nothing in range, so it gets pruned and its documents are lost with no warning (#5808).The core change makes field caps report such an index under a new
failuressection instead of leaving it out. This PR keeps those indices, so the search reaches the unavailable shards and #5807'sPARTIAL_RESULTwarning reports the gap:An unreachable remote cluster is covered the same way: #23262 lists it under
failuresas the expression asked of it, such asremote:logs-*, so it's kept and the search appliesskip_unavailable. Without that,local-*,remote:logs-*narrowed to the local indices and dropped the remote silently, so cross-cluster expressions need no special case.One limit: a reachable remote on a version before the core change can't report its own unchecked indices, so those can still be pruned.
Compared with #5819
#5819 fixes the same bug without a core change, by sending a second, unfiltered field caps probe and keeping indices absent from both. This version:
#5819 stays open until the core change is settled.
Testing
IndexPrunerTest(33): kept failed index, kept unreachable remote, nothing left to prune, and nothing matched. Run against a locally built core with the change.FieldCapabilitiesITcovers an index with no available shard (with and without a filter) and one with a single unavailable shard.Related Issues
Resolves #5808
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.