Skip to content

Remove @UpdateForV9 annotation from ReindexRequest#failOnSizeSpecified #122729

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

Merged
merged 6 commits into from
Feb 17, 2025

Conversation

arteam
Copy link
Contributor

@arteam arteam commented Feb 17, 2025

We do need this check to make sure we don't silently accept requests with ignored size parameter specified since max_docs is optional. We want to notify users that they must use max_docs and specifying size is a mistake.

This behaviour is tested in the reindex/20_validation/specifying size fails test.

The size parameter hasn't been accepted since 8.0, end users should use max_docs and if the user specify it, we can defer to the standard error message produced by the parser.

…fied`

We do need this check to make sure we don't silently accept requests
with ignored `size` parameter specified since `max_docs` is optional.
We want to notify users that they must use `max_docs` and specifying `size`
is a mistake.

This behaviour is tested in the `reindex/20_validation/specifying size fails` test.
@arteam arteam added >non-issue :Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down labels Feb 17, 2025
@elasticsearchmachine elasticsearchmachine added Team:Distributed Indexing Meta label for Distributed Indexing team v9.1.0 labels Feb 17, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

@arteam arteam added backport auto-backport Automatically create backport pull requests when merged v9.0.1 and removed backport labels Feb 17, 2025
@arteam arteam requested review from Tim-Brooks, henningandersen and DaveCTurner and removed request for henningandersen February 17, 2025 13:37
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

This doesn't actually address the task tho. We haven't supported size for all of 8.x, see #43373. I don't think we need to treat this parameter specially any more, we can just reject it as if it were any other unknown parameter.

@arteam arteam added the WIP label Feb 17, 2025
@arteam arteam force-pushed the remove-updatev9-reindex-request branch from 3da329b to 495b0fd Compare February 17, 2025 14:27
@arteam arteam force-pushed the remove-updatev9-reindex-request branch from 495b0fd to 9914525 Compare February 17, 2025 14:29
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Please don't force-push to branches once they're under review, it makes it really hard to keep track of comments etc.

body: { "text": "test" }

- do:
catch: /invalid parameter \[size\], use \[max_docs\] instead/
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we instead keep the test but generalize this regex to handle both the old specialized message and the new general one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I've updated it!

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM

@arteam arteam removed auto-backport Automatically create backport pull requests when merged v9.0.1 labels Feb 17, 2025
@arteam arteam added auto-backport Automatically create backport pull requests when merged v9.0.1 and removed WIP labels Feb 17, 2025
@@ -167,3 +167,7 @@ if (OS.current() == OS.WINDOWS) {
}
}
}

tasks.named("yamlRestCompatTestTransform").configure { task ->
task.skipTest("reindex/20_validation/specifying size fails", "size is rejected in 9.0")
Copy link
Contributor Author

@arteam arteam Feb 17, 2025

Choose a reason for hiding this comment

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

Can't check the compatibility mode for the parameter rejected by the parser, so the compatibility test

./gradlew ":modules:reindex:yamlRestCompatTest" --tests "org.elasticsearch.index.reindex.ReindexClientYamlTestSuiteIT.test {yaml=reindex/20_validation/specifying size fails}"

fails if we don't mute it.

@arteam arteam requested a review from DaveCTurner February 17, 2025 17:27
@DaveCTurner
Copy link
Contributor

LGTM still

@arteam arteam merged commit e702edc into elastic:main Feb 17, 2025
17 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0

arteam added a commit to arteam/elasticsearch that referenced this pull request Feb 17, 2025
…fied` (elastic#122729)

The size parameter hasn't been accepted since 8.0, end users should use max_docs and if the user specify it, we can defer to the standard error message produced by the parser.
elasticsearchmachine pushed a commit that referenced this pull request Feb 17, 2025
…fied` (#122729) (#122798)

The size parameter hasn't been accepted since 8.0, end users should use max_docs and if the user specify it, we can defer to the standard error message produced by the parser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down >non-issue Team:Distributed Indexing Meta label for Distributed Indexing team v9.0.1 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants