Skip to content

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

@deepybee

Description

@deepybee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions