Skip to content

Allow changing index settings of a searchable snapshot in the frozen tier #90871

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

Closed
gmarouli opened this issue Oct 13, 2022 · 9 comments
Closed
Assignees
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement Team:Data Management Meta label for data/management team

Comments

@gmarouli
Copy link
Contributor

gmarouli commented Oct 13, 2022

Description

When using searchable snapshots in cold and frozen phases the recovered index has the settings that index had just before it was snapshot. A user might have set a setting like total_shards_per_node to match their needs in the hot tier but this doesn't mean that this is relevant in the cold or frozen tier. In the cold tier a user can use the allocate action to set this setting to the desired value but this is not possible yet in the frozen tier.

This issue requests a way to reset or just set index settings in the frozen tier.

Example:
A user might have the following set-up:

  • an index with 2 shards and the setting total_shards_per_node set to 1.
  • a hot tier with 2 nodes and a cold and frozen tier with 1 node each.
  • the following ILM policy related with the index:
{
  "hot": {
    "min_age": "0ms",
    "actions": {
      "rollover": {
        "max_primary_shard_size": "50gb"
      }
    }
  },
  "cold": {
    "min_age": "1h",
    "actions": {
      "allocate": {
        "total_shards_per_node": "2"
      },
      "searchable_snapshot": {
        "snapshot_repository": "found-snapshots",
        "force_merge_index": false
      }
    }
  },
  "frozen": {
    "min_age": "2h",
    "actions": {
      "searchable_snapshot": {
        "snapshot_repository": "found-snapshots",
        "force_merge_index": false
      }
    }
  }
}

The policy above will have the following effect per tier:

  • hot: the index with total_shards_per_node will ensure that every node will have one shard of this index
  • cold: the restored snapshot will be restored with total_shards_per_node=1 but because of the allocate action it will be set to 2, so both shards can be allocated in the single cold node.
  • frozen: the partially restored snapshot will be restored with total_shards_per_node=1 and one shard will not be able to get allocated because we have 2 shards and only 1 node. Being able to remove or reset total_shards_per_node could solve this.
@gmarouli gmarouli added >enhancement needs:triage Requires assignment of a team area label labels Oct 13, 2022
@gmarouli gmarouli changed the title Allow changing index settings when restoring an index in the frozen tier Allow changing index settings of a searchable snapshot in the frozen tier Oct 13, 2022
@gmarouli gmarouli added :Data Management/ILM+SLM Index and Snapshot lifecycle management and removed needs:triage Requires assignment of a team area label labels Oct 13, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Oct 13, 2022
@passing
Copy link

passing commented Nov 28, 2022

We're having exactly this problem in our hot-frozen setup: for indexes in the hot zone we want to ensure that each of the 6 shards gets allocated to a diferent node. So we would need to set "total_shards_per_node": "1" in the index template, but then the 3 primary shards cannot be allocated when getting migrated to the 2 frozen nodes.

@passing
Copy link

passing commented Dec 5, 2022

We found yet another relevant use case for this: When using Slow Logs, thresholds that make sense on hot nodes will in most cases not make sense on frozen nodes and vice versa. The thresholds would need to be updated on migration to the frozen tier, to get usable results.

https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html

@dakrone
Copy link
Member

dakrone commented Feb 16, 2023

@gmarouli rather than allowing setting arbitrary index settings for these indices, do you think we could instead only clean the total_shards_per_node setting?

@gmarouli
Copy link
Contributor Author

gmarouli commented Jun 15, 2023

@dakrone , I think so, we would have to check which other settings can cause issue though, like the slow logs mentioned before. In order to be complete.

Apologies for the late response, I totally missed it.

@andreidan
Copy link
Contributor

We've discussed this within the team and decided we’ll remove total_shards_per_node automatically when partially mounting and index in frozen (if needed, we’ll have the option to later add an allocate action in the frozen phase)

@predogma
Copy link
Contributor

Is there a target version this will be addressed in?

@gmarouli
Copy link
Contributor Author

@predogma not yet. But it's on our radar.

@gmarouli
Copy link
Contributor Author

gmarouli commented Jul 27, 2023

Hi @predogma , #97979 has been merge and although this PR is not allowing to change the index setting of a searchable snapshot, it does address the situation that made us create this enhancement request. So, from now on, even if the original index did have total_shards_per_node set, this will be ignored in the frozen tier and the searchable snapshot will be successfully mounted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

6 participants