Skip to content

Reindex - requests_per_second causes scroll to use fractional time value #23945

@zpapez

Description

@zpapez

Elasticsearch version: 5.3

Plugins installed: []

JVM version: 1.8

OS version: MacOS

Description of the problem including expected versus actual behavior:
Remote reindex sends an invalid request to the source ES when requests_per_second is specified.

Problem is most likely in org.elasticsearch.index.reindex.remote.RemoteRequestBuilders.java method scrollParams calls keepAlive.toString() on TimeValue object.
But TimeValue.toString comment says:

Note that this method might produce fractional time values (ex 1.6m) which cannot be parsed by method like ...

Steps to reproduce:

  1. start a remote reindex with parameter requests_per_second specified
  2. source database responses with HTTP 200 but includes error "fractional time values are not supported"

EXPECTED - remote reindex should run ok

Provide logs (if relevant):

{
    "completed": true, 
    "error": {
        "caused_by": {
            "reason": "POST https://company.com:443/_search/scroll?scroll=5.1m: HTTP/1.1 400 Bad Request\n{\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"failed to parse [5.1m], fractional time values are not supported\"}],\"type\":\"parse_exception\",\"reason\":\"failed to parse [5.1m], fractional time values are not supported\",\"caused_by\":{\"type\":\"number_format_exception\",\"reason\":\"For input string: \\\"5.1\\\"\"}},\"status\":400}", 
            "type": "response_exception"
        }, 
        "reason": "body={\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"failed to parse [5.1m], fractional time values are not supported\"}],\"type\":\"parse_exception\",\"reason\":\"failed to parse [5.1m], fractional time values are not supported\",\"caused_by\":{\"type\":\"number_format_exception\",\"reason\":\"For input string: \\\"5.1\\\"\"}},\"status\":400}", 
        "type": "status_exception"
    }, 
    "task": {
        "action": "indices:data/write/reindex", 
        "cancellable": true, 
        "description": "reindex from [scheme=https host=company.com port=443 query={\n  \"match_all\" : {\n    \"boost\" : 1.0\n  }\n}][index1] to [index1]", 
        "id": 25587, 
        "node": "7LvaOqfdSZGsfRWElVkqIA", 
        "running_time_in_nanos": 10876439850, 
        "start_time_in_millis": 1491479089618, 
        "status": {
            "batches": 1, 
            "created": 0, 
            "deleted": 0, 
            "noops": 0, 
            "requests_per_second": 100.0, 
            "retries": {
                "bulk": 0, 
                "search": 0
            }, 
            "throttled_millis": 0, 
            "throttled_until_millis": 0, 
            "total": 19433, 
            "updated": 0, 
            "version_conflicts": 1000
        }, 
        "type": "transport"
    }
}

Metadata

Metadata

Assignees

Labels

:Distributed/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.>bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions