-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add min_* conditions to rollover (#83345)
- Loading branch information
1 parent
55c0d1a
commit 539434d
Showing
50 changed files
with
1,892 additions
and
179 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
pr: 83345 | ||
summary: Add min_* conditions to rollover | ||
area: ILM+SLM | ||
type: enhancement | ||
issues: [] |
This file contains 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
48 changes: 48 additions & 0 deletions
48
...c/src/yamlRestTest/resources/rest-api-spec/test/indices.rollover/50_min_age_condition.yml
This file contains 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,48 @@ | ||
--- | ||
"Rollover with min_age condition": | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: introduced in 8.4.0 | ||
|
||
# create index with alias and replica | ||
- do: | ||
indices.create: | ||
index: logs-1 | ||
wait_for_active_shards: 1 | ||
body: | ||
aliases: | ||
logs_search: {} | ||
|
||
# index first document and wait for refresh | ||
- do: | ||
index: | ||
index: logs-1 | ||
id: "1" | ||
body: { "foo": "hello world" } | ||
refresh: true | ||
|
||
# perform alias rollover with no result | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_age: "7d" | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_age: 7d]": false } } | ||
- match: { rolled_over: false } | ||
|
||
# perform alias rollover | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_age: "0s" | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_age: 0s]": true } } | ||
- match: { rolled_over: true } |
48 changes: 48 additions & 0 deletions
48
.../src/yamlRestTest/resources/rest-api-spec/test/indices.rollover/55_min_docs_condition.yml
This file contains 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,48 @@ | ||
--- | ||
"Rollover with min_docs condition": | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: introduced in 8.4.0 | ||
|
||
# create index with alias and replica | ||
- do: | ||
indices.create: | ||
index: logs-1 | ||
wait_for_active_shards: 1 | ||
body: | ||
aliases: | ||
logs_search: {} | ||
|
||
# index first document and wait for refresh | ||
- do: | ||
index: | ||
index: logs-1 | ||
id: "1" | ||
body: { "foo": "hello world" } | ||
refresh: true | ||
|
||
# perform alias rollover with no result | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_docs: 10 | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_docs: 10]": false } } | ||
- match: { rolled_over: false } | ||
|
||
# perform alias rollover | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_docs: 1 | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_docs: 1]": true } } | ||
- match: { rolled_over: true } |
48 changes: 48 additions & 0 deletions
48
...est/resources/rest-api-spec/test/indices.rollover/60_min_primary_shard_docs_condition.yml
This file contains 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,48 @@ | ||
--- | ||
"Rollover with min_primary_shard_docs condition": | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: introduced in 8.4.0 | ||
|
||
# create index with alias and replica | ||
- do: | ||
indices.create: | ||
index: logs-1 | ||
wait_for_active_shards: 1 | ||
body: | ||
aliases: | ||
logs_search: {} | ||
|
||
# index first document and wait for refresh | ||
- do: | ||
index: | ||
index: logs-1 | ||
id: "1" | ||
body: { "foo": "hello world" } | ||
refresh: true | ||
|
||
# perform alias rollover with no result | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_primary_shard_docs: 10 | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_primary_shard_docs: 10]": false } } | ||
- match: { rolled_over: false } | ||
|
||
# perform alias rollover | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_primary_shard_docs: 1 | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_primary_shard_docs: 1]": true } } | ||
- match: { rolled_over: true } |
48 changes: 48 additions & 0 deletions
48
...est/resources/rest-api-spec/test/indices.rollover/65_min_primary_shard_size_condition.yml
This file contains 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,48 @@ | ||
--- | ||
"Rollover with min_primary_shard_size condition": | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: introduced in 8.4.0 | ||
|
||
# create index with alias and replica | ||
- do: | ||
indices.create: | ||
index: logs-1 | ||
wait_for_active_shards: 1 | ||
body: | ||
aliases: | ||
logs_search: {} | ||
|
||
# index first document and wait for refresh | ||
- do: | ||
index: | ||
index: logs-1 | ||
id: "1" | ||
body: { "foo": "hello world" } | ||
refresh: true | ||
|
||
# perform alias rollover with no result | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_primary_shard_size: "50gb" | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_primary_shard_size: 50gb]": false } } | ||
- match: { rolled_over: false } | ||
|
||
# perform alias rollover | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_primary_shard_size: "0b" | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_primary_shard_size: 0b]": true } } | ||
- match: { rolled_over: true } |
48 changes: 48 additions & 0 deletions
48
.../src/yamlRestTest/resources/rest-api-spec/test/indices.rollover/70_min_size_condition.yml
This file contains 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,48 @@ | ||
--- | ||
"Rollover with min_size condition": | ||
- skip: | ||
version: " - 8.3.99" | ||
reason: introduced in 8.4.0 | ||
|
||
# create index with alias and replica | ||
- do: | ||
indices.create: | ||
index: logs-1 | ||
wait_for_active_shards: 1 | ||
body: | ||
aliases: | ||
logs_search: {} | ||
|
||
# index first document and wait for refresh | ||
- do: | ||
index: | ||
index: logs-1 | ||
id: "1" | ||
body: { "foo": "hello world" } | ||
refresh: true | ||
|
||
# perform alias rollover with no result | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_size: "50gb" | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_size: 50gb]": false } } | ||
- match: { rolled_over: false } | ||
|
||
# perform alias rollover | ||
- do: | ||
indices.rollover: | ||
alias: "logs_search" | ||
wait_for_active_shards: 1 | ||
body: | ||
conditions: | ||
max_docs: 1 | ||
min_size: "0b" | ||
|
||
- match: { conditions: { "[max_docs: 1]": true, "[min_size: 0b]": true } } | ||
- match: { rolled_over: true } |
This file contains 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 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 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.