-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Create a mode: time_series
option for indices
#75638
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
Closed
Closed
Changes from 25 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
895cb7e
Create a `time_series_mode` option for indices
nik9000 f811ce4
Better support for feature flag
nik9000 45c205f
Merge branch 'master' into tsid_gen
nik9000 0fb8060
build build build
nik9000 b359bef
Merge branch 'master' into tsid_gen
nik9000 fbb1838
Support time series index without dimensions
nik9000 a10c4b6
Split
nik9000 d3c6c9b
Ouch
nik9000 dfe46f2
Merge branch 'master' into tsid_gen
nik9000 95b05bf
Tests
nik9000 1b21962
Merge branch 'master' into tsid_gen
nik9000 159812d
Merge branch 'master' into tsid_gen
nik9000 cbca506
mode=time_series
nik9000 41bbf09
Better names
nik9000 500ec30
fixup
nik9000 930c715
Merge branch 'master' into tsid_gen
nik9000 9075da4
Cleanup
nik9000 424ff61
data stream test
nik9000 b5f7fbb
snapshot/restore
nik9000 2aebff9
Merge branch 'master' into tsid_gen
nik9000 c6c454e
Alias tests
nik9000 a590dfe
Merge branch 'master' into tsid_gen
nik9000 eaebf2f
Merge branch 'master' into tsid_gen
nik9000 8f6e2bc
Remove todo
nik9000 7538327
Moar test
nik9000 bea8d20
Merge branch 'master' into tsid_gen
nik9000 c11b53c
WIP
nik9000 b6f76ac
Merge branch 'master' into tsid_gen
nik9000 e7811e3
WIP
nik9000 b0e734f
WIP
nik9000 2bdd50d
WIP
nik9000 94984b5
Merge branch 'master' into tsid_gen
nik9000 3c303ae
equals/hashCode
nik9000 77a873d
Fail nicely
nik9000 8ec4db6
Fix settings
nik9000 3162b2b
Better
nik9000 7433952
Update tests
nik9000 04bf6d6
javadocs
nik9000 fc11cc5
Revert noops
nik9000 3b5aa95
cleanup
nik9000 4b48ada
Merge branch 'master' into tsid_gen
nik9000 f34890e
More docs
nik9000 9a61279
Merge branch 'master' into tsid_gen
nik9000 7d3b2fe
Merge branch 'master' into tsid_gen
nik9000 134f91c
Merge branch 'master' into tsid_gen
nik9000 d21d889
Merge branch 'master' into tsid_gen
nik9000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
148 changes: 148 additions & 0 deletions
148
plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/50_tsdb.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
--- | ||
"Create a snapshot and then restore it": | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: introduced in 8.0.0 to be backported to 7.15.0 | ||
features: ["allowed_warnings"] | ||
|
||
# Create repository | ||
- do: | ||
snapshot.create_repository: | ||
repository: test_restore_repository | ||
body: | ||
type: hdfs | ||
settings: | ||
uri: "hdfs://localhost:9999" | ||
path: "test/restore" | ||
|
||
# Create index | ||
- do: | ||
indices.create: | ||
index: test_index | ||
body: | ||
settings: | ||
index: | ||
mode: time_series | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
metricset: | ||
type: keyword | ||
dimension: true | ||
k8s: | ||
properties: | ||
pod: | ||
properties: | ||
uid: | ||
type: keyword | ||
dimension: true | ||
name: | ||
type: keyword | ||
ip: | ||
type: ip | ||
network: | ||
properties: | ||
tx: | ||
type: long | ||
rx: | ||
type: long | ||
- do: | ||
bulk: | ||
refresh: true | ||
index: test_index | ||
body: | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2005177954, "rx": 801479970}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2006223737, "rx": 802337279}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.2", "network": {"tx": 2012916202, "rx": 803685721}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434521831, "rx": 530575198}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434577921, "rx": 530600088}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434587694, "rx": 530604797}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434595272, "rx": 530605511}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434521831, "rx": 530575198}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434577921, "rx": 530600088}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434587694, "rx": 530604797}}}}' | ||
- '{"index": {}}' | ||
- '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434595272, "rx": 530605511}}}}' | ||
|
||
|
||
# Wait for green | ||
- do: | ||
cluster.health: | ||
wait_for_status: green | ||
|
||
# Take snapshot | ||
- do: | ||
snapshot.create: | ||
repository: test_restore_repository | ||
snapshot: test_restore_tsdb | ||
wait_for_completion: true | ||
|
||
- match: { snapshot.snapshot: test_restore_tsdb } | ||
- match: { snapshot.state : SUCCESS } | ||
- match: { snapshot.shards.successful: 2 } | ||
- match: { snapshot.shards.failed : 0 } | ||
- is_true: snapshot.version | ||
- gt: { snapshot.version_id: 0} | ||
|
||
# Close index | ||
- do: | ||
indices.close: | ||
index : test_index | ||
allowed_warnings: | ||
- "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour" | ||
|
||
# Restore index | ||
- do: | ||
snapshot.restore: | ||
repository: test_restore_repository | ||
snapshot: test_restore_tsdb | ||
wait_for_completion: true | ||
|
||
# Check recovery stats | ||
- do: | ||
indices.recovery: | ||
index: test_index | ||
|
||
- match: { test_index.shards.0.type: SNAPSHOT } | ||
- match: { test_index.shards.0.stage: DONE } | ||
- match: { test_index.shards.0.index.files.recovered: 1} | ||
- gt: { test_index.shards.0.index.size.recovered_in_bytes: 0} | ||
|
||
# Remove our snapshot | ||
- do: | ||
snapshot.delete: | ||
repository: test_restore_repository | ||
snapshot: test_restore_tsdb | ||
|
||
# Remove our repository | ||
- do: | ||
snapshot.delete_repository: | ||
repository: test_restore_repository | ||
|
||
- do: | ||
search: | ||
index: test_index | ||
body: | ||
fields: | ||
- field: _tsid | ||
query: | ||
query_string: | ||
query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' | ||
|
||
- match: {hits.total.value: 1} | ||
- match: {hits.hits.0.fields._tsid: [{k8s.pod.uid: 947e4ced-1786-4e53-9e0c-5c447e959507, metricset: pod}]} |
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
Oops, something went wrong.
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.
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.
This is the most confusing method in XContentParser :) Good catch!