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

Reindex negative TimeValue fix #54057

Merged

Conversation

henningandersen
Copy link
Contributor

@henningandersen henningandersen commented 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.

The 6.8 backport is likely a redo (but this was a simple change), since the structure changed in 7.x

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.
@henningandersen henningandersen added >bug v8.0.0 :Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down v7.7.0 labels Mar 24, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Reindex)

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM.

@henningandersen henningandersen merged commit 2a67bee into elastic:master Mar 24, 2020
@@ -247,16 +247,16 @@ public void start() {
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);
Copy link
Member

Choose a reason for hiding this comment

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

This was interesting anyway since this constructor TimeValue(long) is intended to be passed a value that represents milliseconds, which System#nanoTime does not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.
@henningandersen
Copy link
Contributor Author

henningandersen commented Mar 24, 2020

Backport to 6.8 missingdone (#54133)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down v6.8.9 v7.7.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants