-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
TSDB: add index timestamp range check #78291
Conversation
Pinging @elastic/es-analytics-geo (Team:Analytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. You already did the end time only getting bigger. It's just the down time.
Could you make sure the setting aren't set-able without being in time series mode? I think right now they are behind the feature flag but not behind enabling the mode. I probably didn't mention that when we typed at each other earlier.
ok, I will add the time_series mode check |
Thanks!
…On Sun, Sep 26, 2021, 07:45 weizijun ***@***.***> wrote:
Could you make sure the setting aren't set-able without being in time
series mode? I think right now they are behind the feature flag but not
behind enabling the mode. I probably didn't mention that when we typed at
each other earlier.
ok, I will add the time_series mode check
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#78291 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUXIWO5LTNGPVRDQH2UG3UD4BVNANCNFSM5EWKXGYA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
server/src/main/java/org/elasticsearch/index/IndexSettings.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/IndexSettingsTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/IndexSettings.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nik9000 let's discuss the timestamp issue.
server/src/main/java/org/elasticsearch/index/IndexSettings.java
Outdated
Show resolved
Hide resolved
This reverts commit b4a68c3.
This reverts commit 63e552c.
* upstream/master: (521 commits) Migrate custom role providers to licensed feature (elastic#79127) Remove stale AwaitsFix in InternalEngineTests (elastic#79323) Fix errors in RefreshListenersTests (elastic#79324) Reeable BwC Tests after elastic#79318 (elastic#79320) Mute BwC Tests for elastic#79318 (elastic#79319) Reenable BwC Tests after elastic#79308 (elastic#79313) Disable BwC Tests for elastic#79308 (elastic#79310) Adjust BWC for node-level field cap requests (elastic#79301) Allow total memory to be overridden (elastic#78750) Fix SnapshotBasedIndexRecoveryIT#testRecoveryIsCancelledAfterDeletingTheIndex (elastic#79269) Disable BWC tests Mute GeoIpDownloaderCliIT.testStartWithNoDatabases (elastic#79299) Add alias support to fleet search API (elastic#79285) Create a coordinating node level reader for tsdb (elastic#79197) Route documents to the correct shards in tsdb (elastic#77731) Inject migrate action regardless of allocate action (elastic#79090) Migrate to data tiers should always ensure a TIER_PREFERENCE is set (elastic#79100) Skip building of BWC distributions when building release artifacts (elastic#79180) Default ENFORCE_DEFAULT_TIER_PREFERENCE to true (elastic#79275) Deprecation of transient cluster settings (elastic#78794) ... # Conflicts: # rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/10_settings.yml # server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java # server/src/main/java/org/elasticsearch/common/settings/Setting.java # server/src/main/java/org/elasticsearch/index/IndexMode.java # server/src/test/java/org/elasticsearch/index/TimeSeriesModeTests.java
@elasticmachine test this please |
@imotov After #79136 Merged, I will change the timestamp check in DataStreamTimestampFieldMapper |
There are test failing here. I am not sure if you can see them.
|
I'm trying to fix it. If I have any questions, I will ask your help. |
* upstream/master: (209 commits) Enforce license expiration (elastic#79671) TSDB: Automatically add timestamp mapper (elastic#79136) [DOCS] `_id` is required for bulk API's `update` action (elastic#79774) EQL: Add optional fields and limit joining keys on non-null values only (elastic#79677) [DOCS] Document range enrich policy (elastic#79607) [DOCS] Fix typos in 8.0 security migration (elastic#79802) Allow listing older repositories (elastic#78244) [ML] track inference model feature usage per node (elastic#79752) Remove IncrementalClusterStateWriter & related code (elastic#79738) Reuse previous indices lookup when possible (elastic#79004) Reduce merging in PersistedClusterStateService (elastic#79793) SQL: Adjust JDBC docs to use milliseconds for timeouts (elastic#79628) Remove endpoint for freezing indices (elastic#78918) [ML] add timeout parameter for DELETE trained_models API (elastic#79739) [ML] wait for .ml-state-write alias to be readable (elastic#79731) [Docs] Update edgengram-tokenizer.asciidoc (elastic#79577) [Test][Transform] fix UpdateTransformActionRequestTests failure (elastic#79787) Limit CS Update Task Description Size (elastic#79443) Apply the reader wrapper on can_match source (elastic#78988) [DOCS] Adds new transform limitation item and a note to the tutorial (elastic#79479) ... # Conflicts: # server/src/main/java/org/elasticsearch/index/IndexMode.java # server/src/test/java/org/elasticsearch/index/TimeSeriesModeTests.java
@imotov I fixed the bwc failed tests. The reason for the failure is that the latest version is 8.1.0, and the settings skip version is before 8.0.0. I fixed it. |
@elasticmachine test this please |
if (value >= endTime) { | ||
throw new IllegalArgumentException("time series index @timestamp value [" + value + "] must be smaller than " + endTime); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I wrote this, but on further reading, I think maybe it makes sense to just move it all to DataStreamTimestampFieldMapper
. I thought I was being clever, but all of this code should be able to run just fine from there and it'd be nice that DateFieldMapper
doesn't need to care about the validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with moving this logic to DataStreamTimestampFieldMapper
, since there there is already validation for the @timestamp
field (whether it exists and whether a single value has been specified). And I think at least initially, tsdb will work only with data streams.
/** | ||
* End time of the time_series index. | ||
*/ | ||
private volatile Instant timeSeriesEndTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried that right now these can't be null
so all indices are going to validate the range. I wonder if we can convert these to null
for the defaults so we disable the validation when it isn't set.
@elasticmachine, test this please |
@elasticmachine, test this please |
1 similar comment
@elasticmachine, test this please |
@elasticmachine, test this please |
Nice |
Thanks for all that back and for @weizijun ! I've merged master in and merged it. |
index.time_series.start_time
andindex.time_series.end_time
setting to time series indices and reject documents with @timestamp outside the range