-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fixed match only text block loader not working when a keyword multi field is present #134582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @Kubik42, I've created a changelog YAML for you. |
...per-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/TextFieldTypeTests.java
Show resolved
Hide resolved
Upon diving a bit deeper, I found that this BWC works differently for different release versions. More specifically:
This explains why 8.18 / 9.0 -> 9.2 BWC tests pass while 8.19 / 9.1 -> 9.2 fail. I've also checked what release versions we test against and they're as follows:
From above, 9.0 and 8.18 don't need a backport and will work. 9.1 and 8.19 will receive a backport as I've described. This just leaves 7.17, which doesn't even support synthetic source or have block loaders, so it should pass as well. What this ultimately means is that we don't need a version gate anywhere in this test. All we need to do is backport the fix to 9.1 and 8.19. |
muted-tests.yml
Outdated
method: test {csv-spec:fork.FiveFork} | ||
issue: https://github.com/elastic/elasticsearch/issues/134560 | ||
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT | ||
issue: https://github.com/elastic/elasticsearch/issues/134097 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preemptively muting this test as it'll fail until the backport is completed. I've ran this test locally and it passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we don't manually mute tests.
I think the way this is normally addressed, you'd add a cluster feature representing this change (or use the built-in cluster features representing release versions), then add an assumeTrue
gating the test on the presence of that feature.
Line 74 in 0dff3aa
assumeTrue("requires storing leaf array offsets", oldClusterHasFeature("gte_v9.1.0")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if this is temporary? My idea was to mute this test now, backport the fix, and then unmute the test. Without that, the test will fail against previous versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention is to use a node feature for this. Tests are muted for genuine test failures.
So let's add a node feature for this (in MapperFeatures#getTestFeatures(...)
). The upside it is that the test can be back ported without having think about older versions not having this change (e.g. when changes to MatchOnlyTextRollingUpgradeIT
in this PR land in 8.19 branch).
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a few comments, but the overall direction looks good
...per-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java
Show resolved
Hide resolved
...-extras/src/test/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldTypeTests.java
Outdated
Show resolved
Hide resolved
muted-tests.yml
Outdated
method: test {csv-spec:fork.FiveFork} | ||
issue: https://github.com/elastic/elasticsearch/issues/134560 | ||
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT | ||
issue: https://github.com/elastic/elasticsearch/issues/134097 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we don't manually mute tests.
I think the way this is normally addressed, you'd add a cluster feature representing this change (or use the built-in cluster features representing release versions), then add an assumeTrue
gating the test on the presence of that feature.
Line 74 in 0dff3aa
assumeTrue("requires storing leaf array offsets", oldClusterHasFeature("gte_v9.1.0")); |
...-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/MatchOnlyTextRollingUpgradeIT.java
Outdated
Show resolved
Hide resolved
…pper/extras/MatchOnlyTextFieldTypeTests.java Co-authored-by: Jordan Powers <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment around muted tests and node features, LGTM otherwise
muted-tests.yml
Outdated
method: test {csv-spec:fork.FiveFork} | ||
issue: https://github.com/elastic/elasticsearch/issues/134560 | ||
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT | ||
issue: https://github.com/elastic/elasticsearch/issues/134097 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention is to use a node feature for this. Tests are muted for genuine test failures.
So let's add a node feature for this (in MapperFeatures#getTestFeatures(...)
). The upside it is that the test can be back ported without having think about older versions not having this change (e.g. when changes to MatchOnlyTextRollingUpgradeIT
in this PR land in 8.19 branch).
💔 Backport failed
You can use sqren/backport to manually backport by running |
…ield is present (elastic#134582) * Fixed match only text block loader not working when a keyword multi field is present * Update docs/changelog/134582.yaml * Preemptively mute this test * [CI] Auto commit changes from spotless * Addressed feedback * Update modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldTypeTests.java Co-authored-by: Jordan Powers <[email protected]> * Preemptively mute this test * Fixed copyright * Gate tests on feature presence * [CI] Auto commit changes from spotless * Revert muted-tests to main --------- Co-authored-by: elasticsearchmachine <[email protected]> Co-authored-by: Jordan Powers <[email protected]>
…ield is present (elastic#134582) * Fixed match only text block loader not working when a keyword multi field is present * Update docs/changelog/134582.yaml * Preemptively mute this test * [CI] Auto commit changes from spotless * Addressed feedback * Update modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldTypeTests.java Co-authored-by: Jordan Powers <[email protected]> * Preemptively mute this test * Fixed copyright * Gate tests on feature presence * [CI] Auto commit changes from spotless * Revert muted-tests to main --------- Co-authored-by: elasticsearchmachine <[email protected]> Co-authored-by: Jordan Powers <[email protected]> (cherry picked from commit 86227fb) # Conflicts: # server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java
…ield is present (elastic#134582) * Fixed match only text block loader not working when a keyword multi field is present * Update docs/changelog/134582.yaml * Preemptively mute this test * [CI] Auto commit changes from spotless * Addressed feedback * Update modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldTypeTests.java Co-authored-by: Jordan Powers <[email protected]> * Preemptively mute this test * Fixed copyright * Gate tests on feature presence * [CI] Auto commit changes from spotless * Revert muted-tests to main --------- Co-authored-by: elasticsearchmachine <[email protected]> Co-authored-by: Jordan Powers <[email protected]> (cherry picked from commit 86227fb) # Conflicts: # modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java # qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/MatchOnlyTextRollingUpgradeIT.java # server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…ulti field is present (#134582) (#135025) * Fixed match only text block loader not working when a keyword multi field is present (#134582) * Fixed match only text block loader not working when a keyword multi field is present * Update docs/changelog/134582.yaml * Preemptively mute this test * [CI] Auto commit changes from spotless * Addressed feedback * Update modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldTypeTests.java Co-authored-by: Jordan Powers <[email protected]> * Preemptively mute this test * Fixed copyright * Gate tests on feature presence * [CI] Auto commit changes from spotless * Revert muted-tests to main --------- Co-authored-by: elasticsearchmachine <[email protected]> Co-authored-by: Jordan Powers <[email protected]> (cherry picked from commit 86227fb) # Conflicts: # server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java * Removed non existent line in 9.1
…multi field is present (#134582) (#135027) * Fixed match only text block loader not working when a keyword multi field is present (#134582) * Fixed match only text block loader not working when a keyword multi field is present * Update docs/changelog/134582.yaml * Preemptively mute this test * [CI] Auto commit changes from spotless * Addressed feedback * Update modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldTypeTests.java Co-authored-by: Jordan Powers <[email protected]> * Preemptively mute this test * Fixed copyright * Gate tests on feature presence * [CI] Auto commit changes from spotless * Revert muted-tests to main --------- Co-authored-by: elasticsearchmachine <[email protected]> Co-authored-by: Jordan Powers <[email protected]> (cherry picked from commit 86227fb) # Conflicts: # modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java # qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/MatchOnlyTextRollingUpgradeIT.java # server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java * Removed BWC test since its missing way too many dependencies
This addresses #134097.
This PR:
MatchOnlyTextFieldMapper
to now correctly delegate to a keyword multi field, if one is presentMatchOnlyTextRollingUpgradeIT
to be similar toTextRollingUpgradeIT
. This means, the correct template is now used for the test + other quality of life improvementsDue to the nature of this bug fix, the BWC test
MatchOnlyTextRollingUpgradeIT
will start to fail if this PR is merged. This is because this bug is still present in 8.19 and 9.1. To overcome that, I've preemptively muted the test. Once this change is merged and backported into 8.19 and 9.1, I'll open another PR that unmutes the test and backport that.