Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][broker] Correct the 'connected' status in topic stats of multi-partition topic for geo replication #23695

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Coselding
Copy link

Motivation

The default value of the connected field in org.apache.pulsar.common.policies.data.stats.ReplicatorStatsImpl is false, and the logic for accumulating each partition (org.apache.pulsar.common.policies.data.stats.ReplicatorStatsImpl#add) is this.connected &= stats.connected;. This causes the status of a multi-partition topic to always be false after calculation, and it is impossible to truly feedback the correct status of the geo replication task.

Modifications

Modify the connected field in org.apache.pulsar.common.policies.data.stats.ReplicatorStatsImpl from false to true.

Documentation

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

@nodece
Copy link
Member

nodece commented Dec 11, 2024

Good catch! the connected is always false after the connection is reconnected/disconnected.

Could you check https://github.com/apache/pulsar/blob/v4.0.1/pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/TopicStatsImpl.java#L335-L343? This seems to be the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants