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] ISM rollover explain does not report action.failed flag correctly #853

Closed
peterzxu-crm opened this issue Jul 11, 2023 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@peterzxu-crm
Copy link

peterzxu-crm commented Jul 11, 2023

Describe the bug
ISM rollover explain does not report action.failed flag correctly

{
  "test-000169": {
    "index.plugins.index_state_management.policy_id": "test",
    "index.opendistro.index_state_management.policy_id": "test",
    "index": "test-000169",
    "index_uuid": "yPHItytKTNO8OI8EBrHnyQ",
    "policy_id": "test",
    "policy_seq_no": -2,
    "policy_primary_term": 0,
    "rolled_over": false,
    "index_creation_date": 1684830592835,
    "state": {
      "name": "rollover",
      "start_time": 1684830951513
    },
    "action": {
      "name": "rollover",
      "start_time": null,
      "index": 0,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": null
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "cause": "Validation Failed: 1: this action would add [8] total shards, but this cluster currently has [2997]/[3000] maximum shards open;",
      "message": "Pending retry of failed managed index"
    },
    "enabled": false
  },
  "total_managed_indices": 1
}

To Reproduce
Steps to reproduce the behavior:

  1. Limit the max shards per node
  2. Then create indices with rollover policy to hit max shard per node configuration

Expected behavior
The action.failed flag should be set to true

Plugins

Screenshots

Host/Environment (please complete the following information):

  • OS: AWS OpenSearch
  • Version 2.5

Additional context

@peterzxu-crm peterzxu-crm added bug Something isn't working untriaged labels Jul 11, 2023
@minalsha
Copy link

Issue needs triaging from ISM SMEs.

@CEHENKLE CEHENKLE transferred this issue from opensearch-project/OpenSearch Jul 13, 2023
@bowenlan-amzn
Copy link
Member

It seems you called retry API, which would reset action and retry_info.

@peterzxu-crm
Copy link
Author

@bowenlan-amzn Not sure what you mean by calling retry API, I am use this ISM explain API https://opensearch.org/docs/2.5/im-plugin/ism/api/#explain-index

@bowenlan-amzn
Copy link
Member

After you called retry API https://opensearch.org/docs/2.5/im-plugin/ism/api/#retry-failed-index
The metadata will be update, code part

managedIndexMetaData.copy(
stepMetaData = null,
policyRetryInfo = PolicyRetryInfoMetaData(false, 0),
actionMetaData = managedIndexMetaData.actionMetaData?.copy(
failed = false,
consumedRetries = 0,
lastRetryTime = null,
startTime = null
),
transitionTo = request.startState,
info = mapOf("message" to "Pending retry of failed managed index")

@peterzxu-crm
Copy link
Author

The code snippet says it all, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants