-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Is your feature request related to a problem? Please describe
The feature described below is related to #11703
Describe the solution you'd like
Background
Coming in from #11703 - A new mechanism is needed to configure the storage properties for an index, which can be used to modify the type of underlying node storage used by an index.
This mechanism should trigger a change on the index properties and should also provide the user with a mechanism to track the progress or cancel the operation.
Goals
- The storage type of an index can be changed by the client using an API
- The transition should be trackable by the client using an API
- The transition process should be cancelable using an API
Proposed Solution
How can the user create an index with the new properties?
The process to create an index with the new properties would utilize the existing store attribute on index settings.
Simplified approach
This approach will auto configure properties of the store with predefined configuration for the corresponding tier.
API: **PUT** /<index_name>?tier=WARM
Body:
{
... index settings
}
Expert user approach:
This approach can be used by expert users to define individual values for the corresponding tier properties on the store.
API: **PUT** /<index_name>/
Body:
{
"index": {
"store": {
"type": "hybridfs, niofs, mmapfs, warmfs",
// can be extended for store specific properties as follows
// for example purposes only
"warmfs": {
"max_cache_usage": "ValueInPercentOrSize"
}
}
}
}
How can the user know the current tier attributes of an index?
API: **GET** /<index_name>/_settings
For a warm index:
{
"index": {
"store": {
"type": "hybridfs, niofs, mmapfs, warmfs",
// for example purposes only
"warmfs": {
"max_cache_usage": "ValueInPercentOrSize"
}
}
}
}
On similar lines, we can also list indices with their current state as follows -
Request:
**GET** _cat/indices?h=index,health,uuid,tier
Sample Response: includes an extra tier parameter to show the tier of the index
health status index uuid tier
yellow open my-index-000001 u8FNjxh8Rfy_awN11oDKYQ HOT
green open my-index-000002 nYFWZEO7TUiOjLQXBaYJpA WARM
How can the user migrate an existing index to a different tier?
The client will use a new, custom API to perform the migration as follows -
API: POST /<indexNameOrPattern>/_tier
{
"type" : "HOT"/"WARM"
}
OR
(Preferred) API: POST /<indexNameOrPattern>/_tier/_warm
{
"" : "" // supporting body to make it extensible for future use-cases
}
How can the user track migrations for indexes?
This API would show the on-going or failed migrations across different tiers.
Request:
GET /_tiering/_status?source=hot&target=warmGET /_tiering/{index}/_status?verbose=<true/false
OR
Preferred:
GET/<indexNameOrPattern>/_tier?source=hot&target=warmGET/<indexNameOrPattern>/_tier?verbose=true/false
Sample Response:
{
"tiering_status" : {
"id": "tiering_id",
"index" : "test1"
"source": "hot",
"destination": "warm",
"progress" : "50%",
"failed" : false
}
}
with verbose flag
{
"tiering_status" : {
"id": "tiering_id",
"index" : "test1"
"source": "hot",
"destination": "warm",
"progress" : "50%",
...<shard_stats>...,
...<transfer_stats>...,
"cancellable" : true,
"cancelled" : false,
"reason" : "reason of failure, if any"
}
}
How can the user cancel a migration?
The user can utilize the tiering APIs to cancel the migration by providing the original state of the index.
If there is a current hot to warm migration going on, in order to cancel the migration, the user can trigger a warm to hot migration and return to the original state.
API: POST /<indexNameOrPattern>/``_tier
{
"type" : "HOT"/"WARM"
}
OR
(Preferred) API: POST /<indexNameOrPattern>/_tier/_hot
Contributors: @kotwanikunal, @neetikasinghal
Related component
Search:Remote Search
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status
Status