Skip to content

Conversation

@poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Jan 4, 2024

Motivation

Issue

  • Start a consumer subscribe with regexp public/default/*
  • Create a new topic public/default/tp-1
  • Send messages to the new topic
  • Consumers will not receive any messages, and the messages will be deleted due to there are no subscription.

Root cause

Case-1:

Time Thread start consumer Thread create topic
1 Start subscribe
2 Start to register TopicListWatcher Create new topic
3 Topic created
4 Since there are no listeners registered, there is no need to notice clients
5 TopicListWatcher registered, the consumer will not receive any messages from the new topic

Case-2:

Time Thread TopicListWatcher reconnect Thread create topic
1 Start reconnect
2 Create new topic
3 Topic created
4 Since there are no listeners registered, there is no need to notice clients
5 TopicListWatcher reconnected
6 The consumer will not receive any messages from the new topic

This issue only affects the releases >=3.1, because before 3.1 there is a supplementary mechanism scheduled recheckPatternTimeout, it makes the issues will not occur. This supplementary mechanism was removed at 3.1, see #20779

Modifications

  • After TopicListWatcher reconnected, re-check the topics list.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Jan 4, 2024
@poorbarcode poorbarcode added type/bug The PR fixed a bug or issue reported a bug category/reliability The function does not work properly in certain specific environments or failures. e.g. data lost labels Jan 4, 2024
@poorbarcode poorbarcode added this to the 3.3.0 milestone Jan 4, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 4, 2024
@poorbarcode poorbarcode changed the title Fix/topic watcher [fix] [client] Messages lost due to TopicListWatcher reconnect" Jan 4, 2024
@poorbarcode poorbarcode changed the title [fix] [client] Messages lost due to TopicListWatcher reconnect" [fix] [client] Messages lost due to TopicListWatcher reconnect Jan 4, 2024
@poorbarcode poorbarcode closed this Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category/reliability The function does not work properly in certain specific environments or failures. e.g. data lost doc-not-needed Your PR changes do not impact docs release/3.1.3 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant