Index is not actionable in curator shrink

Hello, I need to archive file in order to shrink size of index which older than 1 day, also delete index. Now my delete_indeces action works well, shrink action doesn`t. My index status is green now. What i should do?
Here is my file action_file.yml

actions:
  1:
    action: shrink
    description: >-
      Shrink indices older than 1 days 
    options:
      allow_ilm_indices: True
      disable_action: False
      ignore_empty_list: False
      continue_if_exception: False
      shrink_node: DETERMINISTIC
      node_filters:
        permit_masters: False
        exclude_nodes: ['not_this_node']
      number_of_shards: 1
      number_of_replicas: 1
      shrink_prefix:
      shrink_suffix: '-shrink'
      delete_after: true
      post_allocation:
        allocation_type: include
        key: node_tag
        value: cold
      wait_for_active_shards: 1
      extra_settings:
        settings:
          index.codec: best_compression
      wait_for_completion: True
      wait_for_rebalance: True
      wait_interval: 9
      max_wait: -1
    filters:
      - filtertype: pattern
        kind: prefix
        value: mpayara-203-
      - filtertype: age
        source: name
        direction: older
        timestring: '%Y.%m.%d'
        unit: days
        unit_count: 1

And this is my logs

2020-02-20 06:42:15,858 DEBUG          curator.indexlist       empty_list_check:226  Checking for empty list


2020-02-20 06:42:15,858 DEBUG              curator.utils         get_date_regex:195  regex = \d{4}\.\d{2}\.\d{2}


2020-02-20 06:42:15,859 DEBUG          curator.indexlist           working_list:237  Generating working list of indices


2020-02-20 06:42:15,866 DEBUG          curator.indexlist           working_list:237  Generating working list of indices


2020-02-20 06:42:15,866 DEBUG          curator.indexlist           __actionable:35   Index mpayara-203-2020.02.16 is actionable and remains in the list.


2020-02-20 06:42:15,866 DEBUG          curator.indexlist            __excludify:58   Remains in actionable list: Index "mpayara-203-2020.02.16" age (1581811200), direction: "older", point of reference, (1582094535)


2020-02-20 06:42:15,866 DEBUG          curator.indexlist        iterate_filters:1238 Post-instance: ['mpayara-203-2020.02.16']


2020-02-20 06:42:15,866 DEBUG     curator.actions.shrink  _merge_extra_settings:1896 Adding extra_settings to shrink body: {'settings': {'index.codec': 'best_compression'}}


2020-02-20 06:42:15,866 DEBUG                curator.cli         process_action:99   Doing the action here.


2020-02-20 06:42:15,866 DEBUG          curator.indexlist          filter_closed:717  Filtering closed indices


2020-02-20 06:42:15,866 DEBUG          curator.indexlist       empty_list_check:226  Checking for empty list


2020-02-20 06:42:15,866 DEBUG          curator.indexlist           working_list:237  Generating working list of indices


2020-02-20 06:42:15,867 DEBUG          curator.indexlist          filter_closed:722  Index mpayara-203-2020.02.16 state: open


2020-02-20 06:42:15,867 DEBUG          curator.indexlist           __actionable:35   Index mpayara-203-2020.02.16 is actionable and remains in the list.


2020-02-20 06:42:15,867 DEBUG          curator.indexlist       filter_by_shards:1013 Filtering indices by number of shards


2020-02-20 06:42:15,867 DEBUG          curator.indexlist       empty_list_check:226  Checking for empty list


2020-02-20 06:42:15,867 DEBUG          curator.indexlist           working_list:237  Generating working list of indices


2020-02-20 06:42:15,867 DEBUG          curator.indexlist       filter_by_shards:1031 Filter by number of shards: Index: mpayara-203-2020.02.16


2020-02-20 06:42:15,867 DEBUG          curator.indexlist       __not_actionable:39   Index mpayara-203-2020.02.16 is not actionable, removing from list.


2020-02-20 06:42:15,867 DEBUG          curator.indexlist       empty_list_check:226  Checking for empty list


2020-02-20 06:42:15,867 ERROR                curator.cli                    run:185  Unable to complete action "shrink".  No actionable items in list: <class 'curator.exceptions.NoIndices'>


/usr/local/lib/python3.6/site-packages/curator/utils.py:53: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.


  return yaml.load(read_file(path))

No actionable items in list: is the message returned. It means that no indices were left to act on after all filters were applied.

In the logs you've provided, it appears that this is what happened:

Filter by number of shards: Index: mpayara-203-2020.02.16
Index mpayara-203-2020.02.16 is not actionable, removing from list.

This suggests that the index mpayara-203-2020.02.16 already has only 1 shard (though it does not say how many it actually has), so it removes it from the actionable list.

The shrink index API doesn't compress or reduce the size of an index. It reduces the number of shards in an index, while the size remains the same. The shrink action in Curator can change to best_compression as part of its flow, but only for an index that has more than 1 shard.

The only way to get the best_compression codec for an index that already only has a single shard would be to close the index, apply the best_compression setting, re-open the index, and trigger a force_merge. Even after these steps, the amount of size reduced using best_compression may not be significant (perhaps shrinking only a few percent, though in some cases it might be more), and the amount of CPU and disk I/O to accomplish a re-compression will vary, but could slow down other operations on the node(s) hosting the shard(s) to re-compress.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.