Skip to content
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

_forcemerge API erroneously accepts JSON payloads and returns ambiguously positive response #29584

Closed
deepybee opened this issue Apr 18, 2018 · 1 comment · Fixed by #30792
Closed
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities

Comments

@deepybee
Copy link
Contributor

Elasticsearch version (bin/elasticsearch --version): 6.2.3

Plugins installed: [X-Pack 6.2.3]

JVM version (java -version): OpenJDK Runtime Environment (build 1.8.0_161-b14)

OS version (uname -a if on a Unix-like system): Linux 44e7bb4d9f24 4.9.87-linuxkit-aufs #1 SMP Fri Mar 16 18:16:33 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux (Official Docker image running on MacOS 10.13.4)

Description of the problem including expected versus actual behavior: When attempting to execute a force merge operation passing the accepted parameters as a JSON payload, a response is returned to the user which ambiguously suggests the requested operation was successful. However, inspection of <index_name>/_segments shows no merge having taken place.

By contrast, when passing the parameter as a URL parameter, the merge takes place as expected.

Steps to reproduce:

  1. Trigger a force merge with a JSON payload of the desired parameters
POST <index_name>/_forcemerge
{
   "max_num_segments": 1
}
  1. Receive positive looking response
{
  "_shards": {
    "total": 102,
    "successful": 102,
    "failed": 0
  }
}
  1. Check the status
GET <index_name>/_segments

alternatively view Segment Count in X-Pack Monitoring

In order to actually trigger the merge, do the following:

POST <index_name>/_forcemerge?max_num_segments=1

Then verify with

GET <index_name>/_segments
@deepybee deepybee added the >bug label Apr 18, 2018
@dnhatn dnhatn added the :Core/Infra/REST API REST infrastructure and utilities label Apr 18, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

rjernst added a commit to rjernst/elasticsearch that referenced this issue May 22, 2018
This commit adds validation to forcemerge rest requests which contain a
body. All parameters to force merge must be part of http params.

closes elastic#29584
rjernst added a commit that referenced this issue Jun 18, 2018
This commit adds validation to forcemerge rest requests which contain a
body. All parameters to force merge must be part of http params.

closes #29584
rjernst added a commit that referenced this issue Jun 18, 2018
This commit adds validation to forcemerge rest requests which contain a
body. All parameters to force merge must be part of http params.

closes #29584
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants