Fix/collision of indexpatterns#20702
Conversation
PR Reviewer Guide 🔍(Review updated until commit 2f4111c)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 2f4111c Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 91dc415
Suggestions up to commit f004a33
|
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
f004a33 to
1eeb3f7
Compare
|
Persistent review updated to latest commit 1eeb3f7 |
PR Code Suggestions ✨No code suggestions found for the PR. |
|
❌ Gradle check result for 1eeb3f7: 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? |
|
@ThyTran1402, can you please run We're getting the following build failure: |
rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml
Show resolved
Hide resolved
server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml
Show resolved
Hide resolved
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
|
Persistent review updated to latest commit 5e0ac20 |
Hi @msfroh I just pushed the changes. Can you review it again please? Thank you. |
|
❌ Gradle check result for 5e0ac20: 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? |
|
Thanks, @ThyTran1402 -- I think I'm starting to understand. The build is still failing, but that's just because it tries to check backward compatibility by running every test in a mixed-version cluster. In this case, because the change is going into OpenSearch 3.6.0, it doesn't work when mixed with OpenSearch 3.5 nodes or OpenSearch 2.19 nodes. In your YamlRestTest, you just need to add a |
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
|
Persistent review updated to latest commit f0cd178 |
Yup. Thank you for guiding me through this test checks. |
|
❌ Gradle check result for f0cd178: 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? |
|
Hi @msfroh Can you please review it? Thank you. |
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
|
Persistent review updated to latest commit 91dc415 |
|
❌ Gradle check result for 91dc415: 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? |
|
Hi @msfroh Do you know why it still failed some of the gradle check for jenkins? 😭 |
Let me look into this today. I got working on some other stuff and somehow convinced myself that this had already been merged. |
Please let me know if there're other test files or docs that I can look at to fix the tests 😭 . |
Signed-off-by: Michael Froh <msfroh@apache.org>
|
Persistent review updated to latest commit 2f4111c |
|
❌ Gradle check result for 2f4111c: 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 2f4111c: 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? |
|
It still did not pass jenkins. Is there anything that I should do from my side to pass the gradle jenkins tests? @msfroh |
|
@ThyTran1402 Nothing needed from your part, I think. We do have a lot of flaky tests. I'll keep retrying after confirming that the test failures are not related to your PR. (They probably aren't, but it helps to check.) |
|
❌ Gradle check result for 2f4111c: 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? |
Is there a way that I can take a look or we can reduce the flaky tests? @msfroh |
So, @andrross has actually just recently created a new dashboard for the flakiest of tests: https://metrics.opensearch.org/_dashboards/app/dashboards#/view/87737cf0-1409-11f1-a611-eb8fce42240d He's been picking them off one-by-one, starting with the worst offenders. |
|
❕ Gradle check result for 2f4111c: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20702 +/- ##
============================================
+ Coverage 73.25% 73.29% +0.04%
- Complexity 72164 72210 +46
============================================
Files 5794 5794
Lines 329946 329953 +7
Branches 47620 47624 +4
============================================
+ Hits 241693 241838 +145
+ Misses 68855 68681 -174
- Partials 19398 19434 +36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Oh this is awesome 💯 . I have not checked or seen this new dashboard before. I think it helped a lot for catching flaky tests. Thank you for your suggestion. |
|
Oh -- looks like this finally passed on Friday evening. I spent the weekend sleeping off a nasty cold and didn't notice it. Thank you @ThyTran1402 for fixing this issue! And a big thank you to @andrross for cleaning up so many of the flaky tests recently. |
Description
Root cause: the previous implementation used a full Lucene automaton intersection (Operations.intersection) to decide whether two pattern sets conflict. This is correct since the string app-test--some_other--some- does technically satisfy both patterns simultaneously, but such a string would never appear as a real index name. Because * absorbs any characters (including - and _), wildcards in one pattern can "swap roles" to cover literal segments of the other, producing false conflicts for any two multi-wildcard patterns that share a common literal prefix before the first *
Fix: Replace the automaton intersection with a minimum-string heuristic. For each pattern, every * is substituted with "" to produce its minimum matching string. If that string matches any pattern in the other set (using the existing Regex.simpleMatch), the two sets are considered conflicting. This restricts conflict detection to cases where naturally named index names would match both templates.
The heuristic still catches genuine conflicts like baz vs baz*, or logs-* vs logs-prod-* while correctly accepting patterns that are distinguishable by literal segments placed after wildcards.
Related Issues
Resolves #837
Check List
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.