Skip to content

Conversation

@danielmitterdorfer
Copy link
Member

With this commit we cleanup hand-coded duplicate checks in XContent
parsing. They were necessary previously but since we reconfigured the
underlying parser in #22073 and #22225, these checks are obsolete and
were also ineffective unless an undocumented system property has been
set. As we also remove this escape hatch, we can remove the additional
checks as well.

Closes #22253

With this commit we cleanup hand-coded duplicate checks in XContent
parsing. They were necessary previously but since we reconfigured the
underlying parser in elastic#22073 and elastic#22225, these checks are obsolete and
were also ineffective unless an undocumented system property has been
set. As we also remove this escape hatch, we can remove the additional
checks as well.

Closes elastic#22253
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@danielmitterdorfer
Copy link
Member Author

Note to reviewers: I intentionally kept tests so we check that duplicates are indeed detected.

@jasontedor
Copy link
Member

Note to reviewers: I intentionally kept tests so we check that duplicates are indeed detected.

I don't think we need to do this. This effectively amounts to unit tests of Jackson now that we defer to its behavior. I think a single test that each of the XContent parsers reject duplicates is sufficient, but we don't need to go to the individual uses of XContent parsers to test for duplicates.

@danielmitterdorfer
Copy link
Member Author

danielmitterdorfer commented Oct 18, 2018

Note to reviewers: I intentionally kept tests so we check that duplicates are indeed detected.

I don't think we need to do this.

Fine for me. Then I'll remove these tests soon. For reference, the test that covers this is BaseXContentTestCase#testChecksForDuplicates().

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM2!

@danielmitterdorfer
Copy link
Member Author

@elasticmachine test this please

@danielmitterdorfer danielmitterdorfer merged commit dbb6fe5 into elastic:master Oct 19, 2018
@danielmitterdorfer danielmitterdorfer deleted the no-manual-duplicate-checks branch October 19, 2018 08:13
kcm pushed a commit that referenced this pull request Oct 30, 2018
With this commit we cleanup hand-coded duplicate checks in XContent
parsing. They were necessary previously but since we reconfigured the
underlying parser in #22073 and #22225, these checks are obsolete and
were also ineffective unless an undocumented system property has been
set. As we also remove this escape hatch, we can remove the additional
checks as well.

Closes #22253
Relates #34588
williamrandolph added a commit to williamrandolph/elasticsearch that referenced this pull request Oct 8, 2020
The setting es.xcontent.strict_duplicate_detection was removed in 7.0
(see elastic#34588). It was an undocumented setting, but enough users relied
on it that its absence is causing problems during upgrades. This commit
adds a message to the deprecation log if this setting is present at
startup.
williamrandolph added a commit that referenced this pull request Dec 18, 2020
#63500)

* Add deprecation warning for removed setting

The setting es.xcontent.strict_duplicate_detection was removed in 7.0
(see #34588). It was an undocumented setting, but enough users relied
on it that its absence is causing problems during upgrades. This commit
adds a message to the deprecation log if this setting is present at
startup.

* Spotless formatting

* Avoid forbidden API

* Reset between custom config tests

* Spotless apply

* Access system properties consistently

* Revert changes to ConfigurationTests setup

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants