Skip to content

Zen2 ClusterState storage #33958

Closed
Closed
@andrershov

Description

@andrershov

In Zen, ClusterState is stored through GatewayMetaState. There are the following issues with the current approach:

  1. Since GatewayMetaState implements ClusterStateApplier, if there was an IOException during storing the state, ClusterState change still will be applied to in-memory node state.
  2. GatewayMetaState stores global metadata and index metadata for each index in separate files. See MetaDataStateFormatter. MetaDataStateFormatter ensures that global/index metadata is stored atomically. However, if there is a change to the global metadata and index metadata or metadata of several indices, state update could be partial.

Zen2 needs a reliable mechanism to store ClusterState without these drawbacks. Two alternative approaches were discussed:

  1. Instead of storing metadata in separate files, create translog for ClusterState diffs. Once ClusterState.Diff is received, persist it to the translog. There could be a background merging process that merges multiple ClusterState diffs together.
  2. Enhance existing solution, by adding the manifest file that will contain pointers to global state/index metadata files and will ensure atomicity.
    While the 1st approach is preferable in the long run, for now, we decided to go with the 2nd approach.

Below is the list of things that should be done:

Although points 1-3 are relevant for Zen, it's decided to make changes on Zen2 branch.

Relates to #32006

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions