Reindex negative TimeValue fix#54057
Merged
henningandersen merged 2 commits intoelastic:masterfrom Mar 24, 2020
Merged
Conversation
Reindex would use timeValueNanos(System.nanoTime()). The intended use for TimeValue is as a duration, not as absolute time. In particular, this could result in negative TimeValue's, being unsupported in elastic#53913.
Collaborator
|
Pinging @elastic/es-distributed (:Distributed/Reindex) |
jasontedor
reviewed
Mar 24, 2020
| void onScrollResponse(ScrollableHitSource.AsyncResponse asyncResponse) { | ||
| // lastBatchStartTime is essentially unused (see WorkerBulkByScrollTaskState.throttleWaitTime. Leaving it for now, since it seems | ||
| // like a bug? | ||
| onScrollResponse(new TimeValue(System.nanoTime()), this.lastBatchSize, asyncResponse); |
Member
There was a problem hiding this comment.
This was interesting anyway since this constructor TimeValue(long) is intended to be passed a value that represents milliseconds, which System#nanoTime does not.
Contributor
Author
There was a problem hiding this comment.
Yeah, I double checked that and I introduced that "bug" when refactoring this last year. It never showed up, since the variable ends up unused anyway...
henningandersen
added a commit
that referenced
this pull request
Mar 24, 2020
Reindex would use timeValueNanos(System.nanoTime()). The intended use for TimeValue is as a duration, not as absolute time. In particular, this could result in negative TimeValue's, being unsupported in #53913. Modified to use the bare long nano-second value.
henningandersen
added a commit
to henningandersen/elasticsearch
that referenced
this pull request
Mar 24, 2020
Reindex would use timeValueNanos(System.nanoTime()). The intended use for TimeValue is as a duration, not as absolute time. In particular, this could result in negative TimeValue's, being unsupported in elastic#53913. Modified to use the bare long nano-second value.
Contributor
Author
|
Backport to 6.8 |
henningandersen
added a commit
that referenced
this pull request
Mar 25, 2020
Reindex would use timeValueNanos(System.nanoTime()). The intended use for TimeValue is as a duration, not as absolute time. In particular, this could result in negative TimeValue's, being unsupported in #53913. Modified to use the bare long nano-second value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reindex would use timeValueNanos(System.nanoTime()). The intended use
for TimeValue is as a duration, not as absolute time. In particular,
this could result in negative TimeValue's, being unsupported in #53913.
Modified to use the bare long nano-second value.
The 6.8 backport is likely a redo (but this was a simple change), since the structure changed in 7.x