Closed
Description
The names of the current CCR APIs don't match well with what they are doing and the use cases CCR needs to support.
Based on what ccr does and the use cases it needs support there is a need for the following primitives:
- Create the follow index based on settings and the mapping in the leader index.
- Start fetching of write operations from leader and replicate into follow index.
- Stop the fetching of write operations from the leader and replication into follow index.
- Transform a follow index into a normal index. After this step it cannot become a follower index.
It should be possible to stop and than start following a leader index with the same follow index, so that parameters that control certain characteristics of the persistent tasks following leader shards can be changed to improve replication throughput.
Currently there are the following APIs:
- create and follow api, which does 1 and 2.
- follow api, which does 2.
- unfollow api, which does 3.
The follow changes should be made in order to better align CCR with the supported use cases:
- Rename the following apis:
- follow api > start api (/{index}/_ccr/follow > /{index}/_ccr/start)
- unfollow api > stop api (/{index}/_ccr/unfollow > /{index}/_ccr/stop)
- Add a new api, named the unfollow api, that changes a follower index into a regular index, so that it can handle regular write operations. This API will require the follow index to be closed. It will remove the
index.xpack.ccr.following_index
setting and ccr custom index metadata in the IndexMetaData of the follow index. After this; when the index is opened then it will not longer use theFollowingEngine
.