Serverless filtering create from#137850
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the /_create_from API in Serverless mode by filtering out settings that are not available in Serverless environments. Previously, the API attempted to copy user-unsettable settings like index.routing.allocation.include._tier_preference, index.number_of_replicas, and index.number_of_shards, causing failures. The fix adds logic to skip settings that are not serverless-public when running in serverless mode.
Key changes:
- Added serverless mode detection using
DiscoveryNode.isStateless() - Implemented filtering to exclude non-serverless-public settings when copying from source index
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @seanzatzdev, I've created a changelog YAML for you. |
|
Pinging @elastic/es-data-management (Team:Data Management) |
💔 Backport failed
You can use sqren/backport to manually backport by running |
* add serverless filtering in _create_from transport action * Moved serverless test to serverless repo * Update docs/changelog/137850.yaml
This reverts commit c6cab2e.
|
My first time using the backport label, seem to have missed those failures... Going to resolve this now |
💔 Some backports could not be created
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
* add serverless filtering in _create_from transport action * Moved serverless test to serverless repo * Update docs/changelog/137850.yaml (cherry picked from commit c6cab2e)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* add serverless filtering in _create_from transport action * Moved serverless test to serverless repo * Update docs/changelog/137850.yaml (cherry picked from commit c6cab2e) # Conflicts: # x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/CreateIndexFromSourceTransportAction.java
* Serverless filtering create from (#137850) * add serverless filtering in _create_from transport action * Moved serverless test to serverless repo * Update docs/changelog/137850.yaml (cherry picked from commit c6cab2e) * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
* Serverless filtering create from (#137850) * add serverless filtering in _create_from transport action * Moved serverless test to serverless repo * Update docs/changelog/137850.yaml (cherry picked from commit c6cab2e) # Conflicts: # x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/CreateIndexFromSourceTransportAction.java * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Some index settings are not available in Serverless, however, currently the /_create_from API does not work correctly, because it tries to copy some user-unsettable settings, e.g.
This PR fixes this for Serverless so the API can be used there:
I've got a follow up PR in the serverless repo that adds tests for this logic on serverless mode: https://github.com/elastic/elasticsearch-serverless/pull/4812