GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][broker] Don't let a stalled __change_events reader hang topic p… · apache/pulsar@28c7e25

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • conf
    • broker.conf
    • standalone.conf
  • pulsar-broker-common/src/main/java/org/apache/pulsar/broker
    • ServiceConfiguration.java
  • pulsar-broker/src
    • main/java/org/apache/pulsar/broker/service
      • SystemTopicBasedTopicPoliciesService.java
    • test/java/org/apache/pulsar/broker/service
      • StaleCacheGenerationInjectingTopicPoliciesService.java
      • SystemTopicBasedTopicPoliciesServiceTest.java
      • TopicPoliciesStalledReaderTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎conf/broker.conf‎

Copy file name to clipboardExpand all lines: conf/broker.conf
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,10 @@ topicLevelPoliciesEnabled=true
775775
# __change_events system topic to the end). Topic loading waits for this initialization, so if the system-topic
776776
# reader gets stuck, this bounds the wait: the broker fails the initialization, closes the stuck reader and clears
777777
# the cached state so loading the namespace's topics can be retried with a fresh reader instead of hanging until the
778-
# broker is restarted. Set to 0 or a negative value to disable the timeout (not recommended).
778+
# broker is restarted. The same timeout bounds how long a topic policy update, or a topic deletion that deletes the
779+
# topic's policies, waits for the reader to read its event back: when it expires, the operation fails and the broker
780+
# replaces the stalled reader. The event that the operation wrote is not rolled back; it takes effect once the
781+
# replacement reader has read it. Set to 0 or a negative value to disable the timeout (not recommended).
779782
topicPoliciesCacheInitTimeoutSeconds=60
780783

781784
# If a topic remains fenced for this number of seconds, it will be closed forcefully.
Collapse file

‎conf/standalone.conf‎

Copy file name to clipboardExpand all lines: conf/standalone.conf
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,10 @@ topicLevelPoliciesEnabled=true
602602
# __change_events system topic to the end). Topic loading waits for this initialization, so if the system-topic
603603
# reader gets stuck, this bounds the wait: the broker fails the initialization, closes the stuck reader and clears
604604
# the cached state so loading the namespace's topics can be retried with a fresh reader instead of hanging until the
605-
# broker is restarted. Set to 0 or a negative value to disable the timeout (not recommended).
605+
# broker is restarted. The same timeout bounds how long a topic policy update, or a topic deletion that deletes the
606+
# topic's policies, waits for the reader to read its event back: when it expires, the operation fails and the broker
607+
# replaces the stalled reader. The event that the operation wrote is not rolled back; it takes effect once the
608+
# replacement reader has read it. Set to 0 or a negative value to disable the timeout (not recommended).
606609
topicPoliciesCacheInitTimeoutSeconds=60
607610

608611
# If a topic remains fenced for this number of seconds, it will be closed forcefully.
Collapse file

‎pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java‎

Copy file name to clipboardExpand all lines: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,11 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
582582
+ "unloaded and the reconnected reader stops making progress), this bounds the wait: the broker "
583583
+ "fails the initialization, closes the stuck reader and clears the cached state so that loading "
584584
+ "the namespace's topics can be retried with a fresh reader instead of hanging until the broker "
585-
+ "is restarted. Set to 0 or a negative value to disable the timeout (not recommended)."
585+
+ "is restarted. The same timeout bounds how long a topic policy update, or a topic deletion "
586+
+ "that deletes the topic's policies, waits for the reader to read its event back: when it "
587+
+ "expires, the operation fails and the broker replaces the stalled reader. The event that the "
588+
+ "operation wrote is not rolled back; it takes effect once the replacement reader has read it. "
589+
+ "Set to 0 or a negative value to disable the timeout (not recommended)."
586590
)
587591
private long topicPoliciesCacheInitTimeoutSeconds = 60;
588592

@@ -1775,7 +1779,10 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
17751779
+ " topic policies after the namespace's topic-policy cache finishes its initial load. Topics load"
17761780
+ " and apply their own policies when they are loaded, so this broadcast is normally redundant; it"
17771781
+ " is only needed for custom plugins that register TopicPolicyListeners and depend on it for"
1778-
+ " backwards compatibility. Disabled by default.")
1782+
+ " backwards compatibility. Disabled by default. Whatever this setting says, the listeners of a"
1783+
+ " namespace are re-notified once when the broker replaces a __change_events reader that stopped"
1784+
+ " delivering (see topicPoliciesCacheInitTimeoutSeconds), because the topics that are already"
1785+
+ " loaded missed the events that reader withheld.")
17791786
private boolean topicPolicyListenerReplayEnabled = false;
17801787

17811788
@FieldContext(

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.