You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by te...@apache.org on 2026/05/11 11:01:03 UTC

(pulsar) branch branch-4.2 updated: [fix][broker] Skip backlog-quota eviction on fenced/closing topics (#25684)

This is an automated email from the ASF dual-hosted git repository.

Technoboy- pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-4.2 by this push:
     new 7d40597c40e [fix][broker] Skip backlog-quota eviction on fenced/closing topics (#25684)
7d40597c40e is described below

commit 7d40597c40efdbdbcec5a888cc353d4666d3ead4
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Wed May 6 11:05:26 2026 +0300

    [fix][broker] Skip backlog-quota eviction on fenced/closing topics (#25684)
---
 .../org/apache/pulsar/broker/service/BacklogQuotaManager.java | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
index f04570c5441..4e3dbe12288 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
@@ -85,6 +85,17 @@ public class BacklogQuotaManager {
      */
     public void handleExceededBacklogQuota(PersistentTopic persistentTopic, BacklogQuotaType backlogQuotaType,
                                            boolean preciseTimeBasedBacklogQuotaCheck) {
+        if (persistentTopic.isFenced() || persistentTopic.isClosingOrDeleting()) {
+            // Skip eviction work on a topic that is being torn down or transiently fenced.
+            // Mutating cursors here (skipEntries / markDeletePosition) contends with the
+            // delete path and can keep namespace force-delete from completing in time;
+            // the entries are about to be discarded anyway.
+            log.debug()
+                    .attr("topic", persistentTopic.getName())
+                    .attr("backlogQuotaType", backlogQuotaType)
+                    .log("Skipping backlog-quota eviction on fenced/closing topic");
+            return;
+        }
         BacklogQuota quota = persistentTopic.getBacklogQuota(backlogQuotaType);
         BacklogQuotaMetrics topicBacklogQuotaMetrics =
                 persistentTopic.getPersistentTopicMetrics().getBacklogQuotaMetrics();