Skip to content

Safe way to enable Discard/ZeroBlocks feature. #4823

@gy2411

Description

@gy2411

There is a VhostDiscardEnabled feature in the service config https://github.com/ydb-platform/nbs/blob/main/cloud/blockstore/config/server.proto#L243. However, this feature is non-revertible: once a disk starts supporting discards, there is no way to turn that off. We need the safest possible way to enable discards.

Plan:

  • Add a VhostDiscardEnabled flag to VolumeConfig in Schemeshard https://github.com/ydb-platform/nbs/blob/main/contrib/ydb/core/protos/blockstore_config.proto#L34. Note that once this flag has been set, it cannot be unset.
  • Add a feature to the storage config that will set the VhostDiscardEnabled flag in VolumeConfig when creating new disks. This feature can be enabled for specific clouds/folders, as well as for a percentage of clouds/folders.
  • Add a feature to the storage config that will set the VhostDiscardEnabled flag in VolumeConfig for already existing disks. This feature can also be enabled for specific clouds/folders, as well as for a percentage of clouds/folders.

This way, discards can be rolled out gradually.

Approximate order of the feature deployment:

  1. Turn on VhostDiscardEnabled in SchemeShard for new volumes on test clouds/folders.
  2. Turn on VhostDiscardEnabled in SchemeShard for small persentage of clouds/folders.
  3. Turn on VhostDiscardEnabled in SchemeShard for all persentage of clouds/folders.
  4. Like 1-3, but for existing volumes.
  5. Trun on VhostDiscardEnabled in server config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions