Repository navigation
Conversation
With skip_unavailable set, a cross-cluster search that cannot reach a remote cluster skips it and still returns 200. The skipped cluster's shards are never collected, so _shards looks complete and the PARTIAL_RESULT warning, which only read _shards, stayed silent while that cluster's rows were missing. The skip is visible only in _clusters. Read _clusters too, and report a skipped cluster the same way as a missing shard: "Results are partial: 1 of 6 clusters was skipped." Signed-off-by: Kai Huang <ahkcs@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (63.68%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #5851 +/- ##
============================================
+ Coverage 63.64% 63.68% +0.04%
- Complexity 9017 9029 +12
============================================
Files 958 959 +1
Lines 40806 40855 +49
Branches 4632 4638 +6
============================================
+ Hits 25971 26019 +48
Misses 13964 13964
- Partials 871 872 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mengweieric
left a comment
There was a problem hiding this comment.
The change looks correct to me. Checking clusters.skipped() catches the case where a skipped cluster leaves the shard counts looking complete, and local or fully healthy cross-cluster searches are unaffected. The doc comment on ShardStats is the one change I would ask for before merge. The two test comments are optional.
The red build-linux (25, integration) check is unrelated to this change. It is the known locale flake in CalciteFlattenCommandIT.testFlattenNullField, which #5793 fixes.
| * search returns 200 once any shard responds, so four outcomes make a result partial: a shard | ||
| * failed, a shard had no available copy, the search timed out, or a remote cluster was skipped. |
There was a problem hiding this comment.
This now lists a fourth cause, but the PPL protocol doc still lists three. Could you update the PARTIAL_RESULT row and the detail description in protocol.md to cover skipped remote clusters and the new _clusters segment?
It would also help to note what controls this case. The doc's advice to set search.default_allow_partial_results to false does not make these searches fail. Setting cluster.remote.<alias>.skip_unavailable to false does.
There was a problem hiding this comment.
Updated the PARTIAL_RESULT row and detail description, and noted that skip_unavailable: false is what makes these fail.
| updateClusterSettings( | ||
| new ClusterSetting("persistent", "cluster.remote.offline.seeds", "127.0.0.1:1")); | ||
| updateClusterSettings( | ||
| new ClusterSetting("persistent", "cluster.remote.offline.skip_unavailable", "true")); |
There was a problem hiding this comment.
Could both settings updates move inside the try? If the second one fails, finally never runs and the dead seed stays configured for the rest of the class.
There was a problem hiding this comment.
Moved both inside the try.
| "source=%s,offline:%s | stats count() as n", HEALTHY_INDEX, HEALTHY_INDEX)); | ||
|
|
||
| verifyDataRows(result, rows(3)); | ||
| JSONObject warning = result.getJSONArray("warnings").getJSONObject(0); |
There was a problem hiding this comment.
Could this check the warning count first, as missingShardAttachesWarningNamingTheCounts does with assertEquals(1, warnings.length())? Then an unexpected extra warning would fail the test.
There was a problem hiding this comment.
Added the count check.
Name skipped remote clusters as a partial-result cause in the protocol doc, and that cluster.remote.<alias>.skip_unavailable, not search.default_allow_partial_results, controls them. Move the remote settings inside the try so a failed update is still cleaned up, and check the warning count. Signed-off-by: Kai Huang <ahkcs@amazon.com>
Description
With
skip_unavailable: trueon a remote, a cross-cluster search that can't reach that remote skips it and still answers 200. The skipped cluster's shards are never collected, so_shardslooks complete, and the skip shows up only in_clusters:The
PARTIAL_RESULTwarning from #5807 reads only_shards, so PPL returned five clusters' rows as the whole answer with no warning. This reads_clusterstoo and reports a skipped cluster like a missing shard:skip_unavailablefalse(default)trueA shard failure still leads the message when both happen; the skipped cluster stays in the detail.
_clustersonly carries counts, so the warning can't name the cluster that was skipped.Testing
ShardStatsTest: one and several skipped clusters, a cross-cluster search that reached every cluster, and a shard failure together with a skipped cluster.CalcitePartialResultOnShardFailureIT: registers a remote whose only seed refuses connections, withskip_unavailable: true, and queries the local index plus that remote. It returns the local rows with the warning above.Related Issues
Follow-up to #5807 (#5687).
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.