Skip to content

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.

4 participants