The demotion policy determines the demotion level based on the current load of the performance tier in the cluster. It dynamically adjusts the data size for demotion, the demotion parameters, and the direct-write mode of the capacity tier. The commands described in this section are used to manage the demotion policy in the cluster.
Precaution
The commands in this section are intended only for troubleshooting and for viewing the internal state of the cluster. Do not use these commands to change the cluster's default behavior unless you fully understand their impact.
Procedure
Run the following command on any node in the cluster to immediately trigger a demotion policy update:
zbs-meta sink scan_immediate
Output note
If the command succeeds, no output is displayed.
The demotion policy includes four levels. The system dynamically adjusts based on the current load of the performance tier:
There are four direct-write modes for the capacity tier, applicable only to volumes with a redundancy policy of replication.
CAP_DIO_BLOCK_ALIGNED_ONLY.Procedure
Run the following command on any node in the cluster to configure demotion policy parameters:
zbs-meta sink update [--inactive_lease_interval_map <INACTIVE_LEASE_INTERVAL_MAP>] [--no_lease_timeout_map <NO_LEASE_TIMEOUT_MAP>] [--cap_direct_write_policy_map <CAP_DIRECT_WRITE_POLICY_MAP>] [--prefer_cap_passthru <PREFER_CAP_PASSTHRU>]
| Parameter | Description |
|---|---|
--inactive_lease_interval_map <INACTIVE_LEASE_INTERVAL_MAP> | Optional. Specifies the time threshold for determining whether the lease is active under different demotion policy levels. |
--no_lease_timeout_map <NO_LEASE_TIMEOUT_MAP> | Optional. Specifies the time threshold for issuing demotion commands to extents without a lease under different demotion policy levels. |
--cap_direct_write_policy_map <CAP_DIRECT_WRITE_POLICY_MAP> | Optional. Specifies the capacity tier direct write policies corresponding to different demotion policy levels. |
--prefer_cap_passthru <PREFER_CAP_PASSTHRU> | Optional. Specifies if a write I/O with the PREFER_CAP IO flag should directly write to the capacity tier when the conditions are met. |
Output note
If the command succeeds, no output is displayed.
Procedure
Run the following command on any node in the cluster to query demotion policy parameters:
zbs-meta sink show
Output example
Sink scan interval: 10s
Sink mode: SINK_LOW
Sink load: 0.42
Sink mid load ratio: 0.50
Sink high load ratio: 0.80
Sink very high load ratio: 0.95
Drain parent start mode: SINK_LOW
Drain idle start mode: SINK_MID
Cap direct write policy: CAP_DIO_BLOCK_ALIGNED_ONLY
Start cap direct write in SINK_LOW ratio: 0.40
Prefer cap passthru: False
Access reserve block num: reserve all
Inactive lease interval (sec) map: (SINK_MID, 1800), (SINK_HIGH, 900), (SINK_VERY_HIGH, 180)
No lease timeout (ms) map: (SINK_LOW, 600000), (SINK_MID, 600000), (SINK_HIGH, 300000), (SINK_VERY_HIGH, 180000)
Cap direct write policy map: (SINK_LOW, CAP_DIO_DISABLED), (SINK_MID, CAP_DIO_BLOCK_ALIGNED_ONLY), (SINK_HIGH, CAP_DIO_ALL_THROTTLED), (SINK_VERY_HIGH, CAP_DIO_ALL)Output note
| Parameter | Description |
|---|---|
Sink scan interval | The interval for updating the demotion policy. |
Sink mode | The demotion policy level. |
Sink load | The current performance tier load, used to determine the current demotion policy level. |
Sink mid load ratio | When the performance tier load exceeds this value, the cluster enters the medium demotion policy level. |
Sink high load ratio | When the performance tier load exceeds this value, the cluster enters the high demotion policy level. |
Sink very high load ratio | When the performance tier load exceeds this value, the cluster enters the very high demotion policy level. |
Drain parent start mode | The demotion level at which demotion commands start to be issued for parent extents. |
Drain idle start mode | The demotion level at which demotion commands start to be issued for extents without leases. |
Cap direct write policy | The current direct-write policy for the capacity tier. |
Start cap direct write in SINK_LOW ratio | When the current demotion level is low and Sink load exceeds this value, the parameter enables capacity-tier direct write. |
Prefer cap passthru | Whether a write I/O with the PREFER_CAP IO flag should directly write to the capacity tier when the conditions are met. |
Access reserve block num | The number of blocks currently reserved by Access. |
Inactive lease interval (sec) map | The time thresholds for determining whether a lease is active under different demotion policy levels. |
No lease timeout (ms) map | The time thresholds for issuing demotion commands to extents without a lease under different demotion policy levels. |
Cap direct write policy map | The capacity tier direct write policies corresponding to different demotion policy levels. |