apache / apache/pulsar

[Bug] partitioned-stats gives incorrect replication connection status

Open
#19,248 1 comment 0 reactions 0 assignees View on GitHub
Stale type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Version

v-2.9.3.3-2

### Minimal reproduce step

1. Create a partitioned-topic which have only one partition.
2. Run - `bin/pulsar-admin topics partitioned-stats tenant1/ns1/topic1` :
Connection status under replication : `"replication" : {
“Cluster-2” : {
"msgRateIn" : 0.0,
"msgThroughputIn" : 0.0,
"msgRateOut" : 0.0,
"msgThroughputOut" : 0.0,
"msgRateExpired" : 0.0,
"replicationBacklog" : 0,
"**connected**" : false,
"replicationDelayInSeconds" : 0
}
}`
3. Run - `bin/pulsar-admin topics stats tenant1/ns1/topic1-partition-0` :
Connection status under replication : `"replication" : {
“Cluster”-2 : {
"msgRateIn" : 0.0,
"msgThroughputIn" : 0.0,
"msgRateOut" : 0.0,
"msgThroughputOut" : 0.0,
"msgRateExpired" : 0.0,
"replicationBacklog" : 0,
"connected" : true,
"replicationDelayInSeconds" : 0,
"**inboundConnection**" : “/xx.yy.zz.xx:47196",
"**inboundConnectedSince**" : "2023-01-16T08:46:39.861Z",
"**outboundConnection**" : "[id: 0xa019c52b, L:/xx.yy.zz.xx:35890 - R:xx.yy.zz.xx/1xx.yy.zz.xx:6650]",
"**outboundConnectedSince**" : "2023-01-16T08:46:39.709Z"
}
}`

### What did you expect to see?

At topic level also, it should return the inbound/outbound connection information of the broker. As we can see there is only one partition present.

### What did you see instead?

The output of the commands is diff at topic and partition level.

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start by comparing the output paths for `pulsar-admin topics partitioned-stats` and `pulsar-admin topics stats` on a one-partition topic, then trace the partitioned-stats implementation and its replication status aggregation. Done means topic-level output includes the inbound and outbound connection information already shown for the partition.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.