Shrink do not proceed because of number of shard filter

Hi Community,

I'm trying to shrink my indices with a curator.

This is my action.yml content:

actions:
  1:
    action: shrink
    description: "Shrink indices starting with mylog older than two days"
    options:
      allow_ilm_indices: true
      disable_action: False
      shrink_node: DETERMINISTIC
    filters:
      - filtertype: pattern
        kind: prefix
        value: mylog 
      - filtertype: age
        source: creation_date
        direction: older
        unit: days
        unit_count: 2

Even if I do not set any parameter regarding shard_number, I see this log in the console:

2024-02-08 12:45:04,163 DEBUG          curator.indexlist          indices_exist:201  BEGIN indices_exist
2024-02-08 12:45:04,182 DEBUG          curator.indexlist             needs_data:281  These indices need data in index_info: []
2024-02-08 12:45:04,183 DEBUG          curator.indexlist     get_index_settings:310  Getting index settings -- END
2024-02-08 12:45:04,183 DEBUG          curator.indexlist       empty_list_check:400  Checking for empty list
2024-02-08 12:45:04,183 DEBUG          curator.indexlist           working_list:411  Generating working list of indices
2024-02-08 12:45:04,183 DEBUG          curator.indexlist       filter_by_shards:1064 Filter by number of shards: Index: mylog-2024.02.03
2024-02-08 12:45:04,183 DEBUG          curator.indexlist       __not_actionable:44   Index mylog-2024.02.03 is not actionable, removing from list.

As I understand, the curator application's default number_of_shards is "0" and the default shard_filter_behavior is "greater_than"(curator/curator/indexlist.py at master · elastic/curator · GitHub ). by the way indices' number_of_shards parameter is "1" .

example one of the index settings:

{
  "settings": {
    "index": {
      "lifecycle": {
        "name": "twoweekspolicy"
      },
      "routing": {
        "allocation": {
          "include": {
            "_tier_preference": "data_content"
          }
        }
      },
      "number_of_shards": "1",
      "provided_name": "mylog-2024.02.03",
      "creation_date": "1706572801447",
      "priority": "100",
      "number_of_replicas": "1",
      "version": {
        "created": "8030099"
      }
    }
  },

Curator version: docker image with "untergeek/curator:8.0.10" tag.
Elastic version: "elasticsearch:8.3.0"

How Can configure the curator to ignore the "number of shards" filter for the shrink function?

Can you provide more context? The index you shared has 1 shard, is this after the shrink? It is not clear what is the issue here.

Hi @leandrojmp ,

I cannot shrink any indices. after the "shard filter" process, the curator's indices list becomes empty. The index I shared was one of the source indices I wanted to shrink.

The Shrink API is used to reduce the number of primary shards, if your index already has just one primary shard there is nothing to do.

That's why I asked of what you want to do, if your indices already have 1 shard, you cannot shrink them.

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