Skip to content

[Subscription] Support per-topic uncommitted event recycle timeouts - #18876

Merged
jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:feat/subscription-topic-recycle-interval-pr
Oct 15, 2026
Merged

jt2594838 merged 3 commits into
apache:masterfrom
Caideyipi:feat/subscription-topic-recycle-interval-pr

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Subscription events currently share the server-wide recycle timeout, which defaults to 600 seconds. Add the topic attribute recycle-uncommitted-event-interval-ms so each topic can override this timeout with a long value in milliseconds. Positive values enable recycling after the timeout; zero or negative values disable automatic recycling. Explicit NACK redelivery and ACK commits remain available. Topics without the attribute continue to use subscription_recycle_uncommitted_event_interval_ms, which also disables automatic recycling when set to zero or a negative value.

The attribute supports CREATE TOPIC and ALTER TOPIC across topic modes and response formats. Both Pipe and Consensus subscription queues apply updates to existing in-flight events, and Consensus queues wake when the setting changes without scheduling recycle retries while recycling is disabled. Runtime overrides are isolated by topic name and data model; metadata snapshot updates preserve existing overrides while they are being applied.

CREATE TOPIC t WITH ('recycle-uncommitted-event-interval-ms'='1200000');
ALTER TOPIC t WITH ('recycle-uncommitted-event-interval-ms'='300000');
ALTER TOPIC t WITH ('recycle-uncommitted-event-interval-ms'='0');

Validation

  • Focused unit tests cover parsing, CREATE/ALTER validation, fallback, metadata updates, tree/table isolation, timeout redelivery, disabling/re-enabling recycling, and explicit NACK/ACK behavior in Pipe V1/V2 and Consensus queues.
  • Full-reactor English build with 61 focused unit tests passing.
  • Full-reactor Chinese compilation: mvn -nsu test-compile -DskipTests -P with-zh-locale.
  • Spotless and git diff --check.

This PR has:

  • been self-reviewed, including concurrent reads and metadata updates.
  • added documentation for the topic attribute and the server fallback.
  • added comments explaining runtime configuration access and snapshot handling.
  • added or updated unit tests for the new behavior.
Key changed classes

TopicConfig, SubscriptionInfo, SubscriptionTopicAgent, SubscriptionPrefetchingQueue, ConsensusPrefetchingQueue, and SubscriptionEvent.

@jt2594838
jt2594838 merged commit e3bbab5 into apache:master Oct 15, 2026
38 of 39 checks passed
@jt2594838
jt2594838 deleted the feat/subscription-topic-recycle-interval-pr branch October 15, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants