orid
September 15, 2022, 8:57am
2
I have created github issues.
For item (1):
opened 08:54AM - 15 Sep 22 UTC
enhancement
untriaged
**Is your feature request related to a problem? Please describe.**
When I perfo… rm an index rollover (weather directly by the rollover API or by using the ISM job), I want **all** aliases of an index to be rolled over.
I have an index with multiple aliases (my-alias-01, my-alias-02,…), and I want all of them to be rollover.
**Describe the solution you'd like**
Let's assume I have an index with 2 aliases.
```
PUT my-index-000001
{
"aliases": {
"my-alias-01": {
"is_write_index": true
},
"my-alias-02": {
"is_write_index": true
}
}
}
```
I want to do something like that in my index template:
```
"plugins.index_state_management.rollover_alias": "my-alias*"
````
Then, when rollover action occurs, a new index 'my-index-000002' will be created with both aliases.
Or, when running rollover API directly:
```POST my-alias*/_rollover```
the rollover will create a new index `my-index-000002` with all the matched aliases.
Right now, it fails with:
```
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "rollover target [my-alias-*] does not exist"
}
],
"type" : "illegal_argument_exception",
"reason" : "rollover target [my-alias-*] does not exist"
},
"status" : 400
}
```
**Describe alternatives you've considered**
I could not find any alternative.
Right now, I have my own code that performs alias creation on the new index after rollover.
For item (2):
opened 09:41PM - 07 Sep 22 UTC
bug
**What is the bug?**
Create an index rollover policy and associate to index (wi… th index template).
When creating the first index, the index contains an alias for rollover. This alias also contains a filter.
After rollover, additional index is created, but the new index with the alias. But the filter is missing in the alias of the new index.
Moreover, the alias filter in the original index (before rollover) is also deleted.
**How can one reproduce the bug?**
Steps to reproduce the behavior:
1. Create ISM policy
```
PUT _plugins/_ism/policies/rollovertests_policy
{
"policy": {
"description": "test rollover policy.",
"default_state": "rollover",
"states": [
{
"name": "rollover",
"actions": [
{
"rollover": {
"min_index_age": "2m"
}
}
],
"transitions": []
}
]
,
"ism_template": {
"index_patterns": ["rollovertests*"],
"priority": 100
}
}
}
```
3. Create index template with relation to policy and rollover_alias.
```
PUT _index_template/rollovertests_template
{
"index_patterns": [
"rollovertests-*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"plugins.index_state_management.rollover_alias": "rollovertests"
},
"mappings": {
"_routing": {
"required": true
},
"properties": {
"timestamp": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
}
}
}
}
```
5. Create a new index with alias and filter
```
PUT rollovertests-000001
{
"aliases": {
"rollovertests": {
"is_write_index": true,
"filter": {
"term": {
"timestamp": "1574641891142"
}
}
}
}
}
```
7. Make sure index was created properly with the alias
```
GET rollovertests-*/_alias
{
"rollovertests-000001" : {
"aliases" : {
"rollovertests" : {
"filter" : {
"term" : {
"timestamp" : "1574641891142"
}
},
"is_write_index" : true
}
}
}
}
```
7. Wait few minutes for rollover action.
9. Query the newly generated index and the original index. You can see that filter is missing in both.
```
GET rollovertests-*/_alias
{
"rollovertests-000002" : {
"aliases" : {
"rollovertests" : {
"is_write_index" : true
}
}
},
"rollovertests-000001" : {
"aliases" : {
"rollovertests" : {
"is_write_index" : false
}
}
}
}
```
**What is the expected behavior?**
Alias filter should be copied to new index after rollover.
Alias filter should not be deleted from original alias and index.
**What is your host/environment?**
- OS: AWS OpenSearch
- Version : 1.3.2
- Plugins