The pulsar-admin namespaces set-persistence
command allows for the configuration of several persistence-related policies on a namespace. One of these policies is the mark-delete rate
, controlled by the --ml-mark-delete-max-rate
(or -r) flag.
The command-line help and its current implementation show that the default value for this flag is 0.0:
-r, --ml-mark-delete-max-rate=<managedLedgerMaxMarkDeleteRate> Throttling rate of mark-delete operation (0 means no throttle) Default: 0.0
Within Pulsar, a managedLedgerMaxMarkDeleteRate of 0 signifies that the rate limit is disabled. This can lead to a “storm” of cursor state writes to BookKeeper, especially with high-frequency acknowledgement patterns, causing significant I/O load, network traffic, and potential cluster instability.
The problem is that if an administrator uses set-persistence to modify another policy (e.g., backlog quotas or ensemble size) and omits the --ml-mark-delete-max-rate flag, the command implicitly applies the default value of 0, thereby disabling any previously configured rate limit. This is a dangerous and counter-intuitive side effect.
A user intending to change one policy can inadvertently disable a critical throttling mechanism, leading to unexpected performance degradation. The broker itself has a safe default (managedLedgerMaxMarkDeleteRate = 1.0), and the admin tool should align with this principle.
The goal of this PIP is to change the behavior of the pulsar-admin namespaces set-persistence command.
When set-persistence is invoked, if the --ml-mark-delete-max-rate
flag is not provided by the user, the command should not reset the mark-delete rate to 0
. Instead, the broker should apply the default rate limit configured at the broker level (via the managedLedgerMaxMarkDeleteRate
parameter in broker.conf
).
This change ensures that the command has a safe, predictable default. Users who explicitly wish to disable the rate limit must do so intentionally by providing --ml-mark-delete-max-rate 0
.
The implementation will require modifications to how the set-persistence command and its corresponding REST endpoint handle the PersistencePolicies object.
--ml-mark-delete-max-rate
parameter's default will be modified from 0.0 to a value indicating it is “unset” (e.g., null or a negative value like -1).This change introduces a behavioral modification that is considered a bug fix for unsafe default behavior.
And the change will not affect any existing namespaces.