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

Fix throttled reindex_from_remote #23953

Merged
merged 4 commits into from
Apr 7, 2017
Merged

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Apr 6, 2017

reindex_from_remote was using TimeValue#toString to generate the
scroll timeout which is bad because that generates fractional
time values that are useful for people but bad for Elasticsearch
which doesn't like to parse them. This switches it to using
TimeValue#getStringRep which spits out whole time values.

Closes to #23945

Makes #23828 even more desirable.

reindex_from_remote was using `TimeValue#toString` to generate the
scroll timeout which is bad because that generates fractional
time values that are useful for people but bad for Elasticsearch
which doesn't like to parse them. This switches it to using
`TimeValue#getStringRep` which spits out whole time values.

Closes to elastic#23945

Makes elastic#23828 even more desirable
@nik9000 nik9000 requested a review from dakrone April 6, 2017 20:06
@nik9000 nik9000 changed the title Fix throttle reindex_from_remote Fix throttled reindex_from_remote Apr 6, 2017
@dakrone
Copy link
Member

dakrone commented Apr 6, 2017

It seems strange that this is tested with a REST test, is there any way we could extract the scroll calculation into a (maybe static) method where it could be tested independently of the full reindex pipeline? (It'd also be good to keep the REST test too of course)

@nik9000
Copy link
Member Author

nik9000 commented Apr 6, 2017 via email

@dakrone
Copy link
Member

dakrone commented Apr 6, 2017

Yeah, it'd be nice if there was something like

public void testCalculationThingys() throws Exception {
    assertThat(ReindexCalculationThing.calculateTime(90, TimeUnit.SECONDS), equalTo("2m")); // instead of "1.5m"
}

So this was a little more well encapsulated

That should make it more clear that the parsing is what is what
the other side is going to do so it is what has to work.
@nik9000
Copy link
Member Author

nik9000 commented Apr 7, 2017

@dakrone I pushed some more changes - 2 unit test tweaks and another place where I was calling toString.

I can push a concrete (rather than randomized) example too if you'd like. Right now the scroll tests are still embedded with the rest of the request building tests. I think splitting them out would make the whole thing more brittle.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for changing the tests

@nik9000 nik9000 merged commit de6837b into elastic:master Apr 7, 2017
@nik9000
Copy link
Member Author

nik9000 commented Apr 7, 2017

Thanks for reviewing @dakrone!

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Apr 8, 2017
* master:
  Discovery EC2: Remove region setting (elastic#23991)
  AWS Plugins: Remove signer type setting (elastic#23984)
  Settings: Disallow secure setting to exist in normal settings (elastic#23976)
  Add registration of new discovery settings
  Settings: Migrate ec2 discovery sensitive settings to elasticsearch keystore (elastic#23961)
  Fix throttled reindex_from_remote (elastic#23953)
  Add comment why we check for null fetch results during merge
nik9000 added a commit that referenced this pull request Apr 10, 2017
reindex_from_remote was using `TimeValue#toString` to generate the
scroll timeout which is bad because that generates fractional
time values that are useful for people but bad for Elasticsearch
which doesn't like to parse them. This switches it to using
`TimeValue#getStringRep` which spits out whole time values.

Closes to #23945

Makes #23828 even more desirable
@silashansen
Copy link

I think this has caused our remote reindexing to fail.
I am reindexing from 1.4.5 to 5.4.0 and I am now receiving this error:

"POST http://xxx.xxx.xxx.xxx:9200/_search/scroll?scroll=300000000000nanos: HTTP/1.1 400 Bad Request\n{\"error\":\"ElasticsearchParseException[Failed to parse [300000000000nanos]]; nested: NumberFormatException[For input string: \\\"300000000000nano\\\"]; \",\"status\":400}"

Indicating that our 1.4.5 server is not too happy about the "nanos".

Is there a workaround that can I can deploy until it's fixed?

@jasontedor
Copy link
Member

@silashansen That's a duplicate of #24520.

@nik9000 nik9000 deleted the remote_throttle branch June 7, 2017 14:52
@lcawl lcawl added :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. and removed :Reindex API labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. v5.4.0 v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants