Skip to content

Commit bc5ac4a

Browse files
authored
Switch built-in policies to max_primary_shard_size (#69995) (#70002)
1 parent 61630a6 commit bc5ac4a

File tree

13 files changed

+40
-17
lines changed

13 files changed

+40
-17
lines changed

docs/reference/data-streams/change-mappings-and-settings.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PUT /_ilm/policy/my-data-stream-policy
3535
"hot": {
3636
"actions": {
3737
"rollover": {
38-
"max_size": "25GB"
38+
"max_primary_shard_size": "25GB"
3939
}
4040
}
4141
},

docs/reference/data-streams/set-up-a-data-stream.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PUT /_ilm/policy/my-data-stream-policy
4040
"hot": {
4141
"actions": {
4242
"rollover": {
43-
"max_size": "25GB"
43+
"max_primary_shard_size": "25GB"
4444
}
4545
}
4646
},

docs/reference/ilm/actions/ilm-rollover.asciidoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,29 @@ shard is a primary (`p`) or a replica (`r`).
8484
[[ilm-rollover-ex]]
8585
==== Example
8686

87+
[[ilm-rollover-primar-shardsize-ex]]
88+
===== Roll over based on largest primary shard size
89+
90+
This example rolls the index over when its largest primary shard is at least 50 gigabytes.
91+
92+
[source,console]
93+
--------------------------------------------------
94+
PUT _ilm/policy/my_policy
95+
{
96+
"policy": {
97+
"phases": {
98+
"hot": {
99+
"actions": {
100+
"rollover" : {
101+
"max_primary_shard_size": "50GB"
102+
}
103+
}
104+
}
105+
}
106+
}
107+
}
108+
--------------------------------------------------
109+
87110
[[ilm-rollover-size-ex]]
88111
===== Roll over based on index size
89112

docs/reference/ilm/ilm-tutorial.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ and the actions to perform in each phase. A lifecycle can have up to five phases
5151
For example, you might define a `timeseries_policy` that has two phases:
5252

5353
* A `hot` phase that defines a rollover action to specify that an index rolls over when it
54-
reaches either a `max_size` of 50 gigabytes or a `max_age` of 30 days.
54+
reaches either a `max_primary_shard_size` of 50 gigabytes or a `max_age` of 30 days.
5555
* A `delete` phase that sets `min_age` to remove the index 90 days after rollover.
5656
Note that this value is relative to the rollover time, not the index creation time.
5757

@@ -72,18 +72,18 @@ PUT _ilm/policy/timeseries_policy
7272
{
7373
"policy": {
7474
"phases": {
75-
"hot": { <1>
75+
"hot": { <1>
7676
"actions": {
7777
"rollover": {
78-
"max_size": "50GB", <2>
78+
"max_primary_shard_size": "50GB", <2>
7979
"max_age": "30d"
8080
}
8181
}
8282
},
8383
"delete": {
84-
"min_age": "90d", <3>
84+
"min_age": "90d", <3>
8585
"actions": {
86-
"delete": {} <4>
86+
"delete": {} <4>
8787
}
8888
}
8989
}
@@ -232,7 +232,7 @@ is met.
232232
"min_age": "0ms",
233233
"actions": {
234234
"rollover": {
235-
"max_size": "50gb",
235+
"max_primary_shard_size": "50gb",
236236
"max_age": "30d"
237237
}
238238
}

docs/reference/ilm/set-up-lifecycle-policy.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ PUT _ilm/policy/my_policy
4949
"hot": {
5050
"actions": {
5151
"rollover": {
52-
"max_size": "25GB" <1>
52+
"max_primary_shard_size": "25GB" <1>
5353
}
5454
}
5555
},

docs/reference/indices/get-data-stream.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PUT /_ilm/policy/my-lifecycle-policy
1818
"hot": {
1919
"actions": {
2020
"rollover": {
21-
"max_size": "25GB"
21+
"max_primary_shard_size": "25GB"
2222
}
2323
}
2424
},

x-pack/plugin/core/src/main/resources/ilm-history-ilm-policy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"hot": {
44
"actions": {
55
"rollover": {
6-
"max_size": "50GB",
6+
"max_primary_shard_size": "50gb",
77
"max_age": "30d"
88
}
99
}

x-pack/plugin/core/src/main/resources/logs-policy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"hot": {
44
"actions": {
55
"rollover": {
6-
"max_size": "50gb",
6+
"max_primary_shard_size": "50gb",
77
"max_age": "30d"
88
}
99
}

x-pack/plugin/core/src/main/resources/metrics-policy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"hot": {
44
"actions": {
55
"rollover": {
6-
"max_size": "50gb",
6+
"max_primary_shard_size": "50gb",
77
"max_age": "30d"
88
}
99
}

x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"hot": {
44
"actions": {
55
"rollover": {
6-
"max_size": "50GB"
6+
"max_primary_shard_size": "50gb"
77
}
88
}
99
}

0 commit comments

Comments
 (0)