Disallow negative TimeValues#53913
Merged
AthenaEryma merged 21 commits intoelastic:masterfrom Mar 26, 2020
Merged
Conversation
This commit causes negative TimeValues, other than -1 which is sometimes used as a sentinel value, to be rejected during parsing.
Collaborator
|
Pinging @elastic/es-core-infra (:Core/Infra/Core) |
Collaborator
|
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
jasontedor
reviewed
Mar 24, 2020
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/monitor/jvm/JvmGcMonitorService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/search/stats/SearchStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/search/stats/SearchStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/search/stats/SearchStats.java
Outdated
Show resolved
Hide resolved
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.
Contributor
|
Nice catch, @gwbrown . Unfortunately, reindex used |
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
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.
dakrone
approved these changes
Mar 25, 2020
Member
dakrone
left a comment
There was a problem hiding this comment.
LGTM assuming CI is happy, thanks for addressing this Gordon
libs/core/src/main/java/org/elasticsearch/common/unit/TimeValue.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
All the tests passed but I'm going to run one more time to be sure, as many of the failures previously were due to random values, which are only sometimes negative. @elasticmachine test this please |
Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com>
AthenaEryma
added a commit
to AthenaEryma/elasticsearch
that referenced
this pull request
Mar 26, 2020
This commit causes negative TimeValues, other than -1 which is sometimes used as a sentinel value, to be rejected during parsing. Also introduces a hack to allow ILM to load policies which were written to the cluster state with a negative min_age, treating those values as 0, which should match the behavior of prior versions.
AthenaEryma
added a commit
to AthenaEryma/elasticsearch
that referenced
this pull request
Mar 26, 2020
This commit causes negative TimeValues, other than -1 which is sometimes used as a sentinel value, to be rejected during parsing. Also introduces a hack to allow ILM to load policies which were written to the cluster state with a negative min_age, treating those values as 0, which should match the behavior of prior versions.
AthenaEryma
added a commit
that referenced
this pull request
Mar 26, 2020
This commit causes negative TimeValues, other than -1 which is sometimes used as a sentinel value, to be rejected during parsing. Also introduces a hack to allow ILM to load policies which were written to the cluster state with a negative min_age, treating those values as 0, which should match the behavior of prior versions.
AthenaEryma
added a commit
that referenced
this pull request
Mar 26, 2020
This commit causes negative TimeValues, other than -1 which is sometimes used as a sentinel value, to be rejected during parsing. Also introduces a hack to allow ILM to load policies which were written to the cluster state with a negative min_age, treating those values as 0, which should match the behavior of prior versions.
AthenaEryma
added a commit
to AthenaEryma/elasticsearch
that referenced
this pull request
Mar 26, 2020
This commit causes negative TimeValues, other than -1 which is sometimes used as a sentinel value, to be rejected during parsing. Also introduces a hack to allow ILM to load policies which were written to the cluster state with a negative min_age, treating those values as 0, which should match the behavior of prior versions.
AthenaEryma
added a commit
that referenced
this pull request
Mar 27, 2020
* Disallow negative TimeValues (#53913) This commit causes negative TimeValues, other than -1 which is sometimes used as a sentinel value, to be rejected during parsing. Also introduces a hack to allow ILM to load policies which were written to the cluster state with a negative min_age, treating those values as 0, which should match the behavior of prior versions. * Re-apply IndexLifecycleRunner changes lost in merge * Make SnapshotStatsTests generate more realistic times * Fix negative TimeValue in deprecation test * Re-apply CcrStatsResponseTests fix lost in merge
This was referenced Apr 17, 2020
tlrx
added a commit
that referenced
this pull request
Apr 17, 2020
tlrx
added a commit
that referenced
this pull request
Apr 17, 2020
tlrx
added a commit
that referenced
this pull request
Apr 17, 2020
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.
This commit causes negative TimeValues, other than -1 which is sometimes used as
a sentinel value, to be rejected during parsing.
Also introduces a hack to allow ILM to load policies which were written to the
cluster state with a negative
min_age, treating those values as 0, which shouldmatch the behavior of prior versions.
Fixes #54041