Skip to content
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

[BUG] Shrink action can't work properly #709

Closed
Angie-Zhang opened this issue Mar 1, 2023 · 2 comments
Closed

[BUG] Shrink action can't work properly #709

Angie-Zhang opened this issue Mar 1, 2023 · 2 comments
Assignees
Labels
action Index management actions bug Something isn't working medium

Comments

@Angie-Zhang
Copy link
Contributor

Angie-Zhang commented Mar 1, 2023

What is the bug?
When we use shrink action after rollover action, or apply shrink action on data stream's index, the shrink action can't be executed correctly. It throws:

Shrink failed when sending shrink request.
<some index> must be read-only to resize index. use "index.blocks.write=true"

After several retries, the cluster has no available node to execute shrink action, all indexes for shrink have:

{
    "message": "There are no available nodes to move to to execute a shrink. Delaying until node becomes available."
}

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Created an ISM policy with shrink action after rollover, e.g.
{
    "policy": {
        "policy_id": "rollover_shrink_test",
        "description": "Rollover after 3 min then shrink and delete after 1 day",
        "error_notification": null,
        "default_state": "hot",
        "states": [
            {
                "name": "hot",
                "actions": [
                    {
                        "rollover": {
                            "min_doc_count": 1
                        }
                    }
                ],
                "transitions": [
                    {
                        "state_name": "search"
                    }
                ]
            },
            {
                "name": "search",
                "actions": [
                    {
                        "shrink": {
                            "num_new_shards": 1,
                            "aliases": [
                                {
                                    "rollover-shrink-target": {
                                        "is_write_index": false
                                    }
                                }
                            ],
                            "force_unsafe": true
                        }
                    }
                ],
                "transitions": [
                    {
                        "state_name": "delete",
                        "conditions": {
                            "min_index_age": "1d"
                        }
                    }
                ]
            },
            {
                "name": "delete",
                "actions": [
                    {
                        "delete": {}
                    }
                ],
                "transitions": []
            }
        ],
        "ism_template": [
            {
                "index_patterns": [
                    "rollover-shrink-test*"
                ],
                "priority": 100,
            }
        ]
    }
}
  1. Shrink action fails after rollover, keep getting error message:
{
    "message": "There are no available nodes to move to execute a shrink. Delaying until node becomes available."
}

Even though there are available nodes for shrink, ISM still throws above error message.

What is the expected behavior?
Shrink action should work as expected.

What is your host/environment?

  • OS: AWS & MacOS Monterey
  • Version: 2.3 in AWS; 2.5.0 docker image in local MacOS Monterey.
  • Plugins: Index Management
@Angie-Zhang Angie-Zhang added bug Something isn't working action Index management actions labels Mar 1, 2023
@Angie-Zhang Angie-Zhang self-assigned this Mar 1, 2023
@getsaurabh02
Copy link
Member

@Angie-Zhang Can we also share the setup used while replicating this issue. Wondering if this issue replicable on any specific setup or configuration of indices/cluster.
Also, do we have any insights on the possible reasons for it yet?

@petardz
Copy link
Contributor

petardz commented Mar 4, 2023

I made IT with this configuration and everything is working fine.

Can you please paste here datastream info:

  1. Response from /my_data_stream_name
  2. index template for this datastream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action Index management actions bug Something isn't working medium
Projects
Archived in project
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants