Skip to content

[fix] [admin] fix incorrect state replication.connected on API partitioned-topic stat#19942

Merged
congbobo184 merged 3 commits into
apache:masterfrom
poorbarcode:fix/incorrect_connected
Mar 29, 2023
Merged

[fix] [admin] fix incorrect state replication.connected on API partitioned-topic stat#19942
congbobo184 merged 3 commits into
apache:masterfrom
poorbarcode:fix/incorrect_connected

Conversation

@poorbarcode

Copy link
Copy Markdown
Contributor

Motivation

Pulsar will merge the variable PartitionedTopicStatsImpl.replication[x].connected by the way below when we call pulsar-admin topics partitioned-stats

this.connected = this.connected & other.connected

But the variable connected of PartitionedTopicStatsImpl.replication is initialized false, so the expression this.connected & other.connected will always be false.

Then we will always get the value false if we call pulsar-admin topics partitioned-stats.

Modifications

make the variable `` of PartitionedTopicStatsImpl is initialized `true`

Documentation

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

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Mar 27, 2023
@poorbarcode poorbarcode self-assigned this Mar 28, 2023

@liangyepianzhou liangyepianzhou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@coderzc

coderzc commented Mar 28, 2023

Copy link
Copy Markdown
Member

It seems that line-298 also needs to be changed.

@gaoran10

gaoran10 commented Mar 28, 2023

Copy link
Copy Markdown
Contributor

I'm not sure why need to use the symbol &, if the metric change to false, it will always be false, maybe we can use the latest value directly.

@poorbarcode

Copy link
Copy Markdown
Contributor Author

Hi @gaoran10

I'm not sure why need to use the symbol &, if the metric change to false, it will always be false, maybe we can use the latest value directly.

Good idea, already fixed

@poorbarcode

poorbarcode commented Mar 28, 2023

Copy link
Copy Markdown
Contributor Author

@coderzc

It seems that line-298 also needs to be changed.

fixed, Thanks

@Technoboy- Technoboy- added this to the 3.0.0 milestone Mar 28, 2023
@congbobo184 congbobo184 merged commit 9fc0b5e into apache:master Mar 29, 2023
@poorbarcode poorbarcode deleted the fix/incorrect_connected branch March 29, 2023 01:56
poorbarcode added a commit that referenced this pull request Mar 29, 2023
…ioned-topic stat (#19942)

### Motivation

Pulsar will merge the variable `PartitionedTopicStatsImpl.replication[x].connected` by the way below when we call `pulsar-admin topics partitioned-stats`

``` java
this.connected = this.connected & other.connected
```

But the variable `connected` of `PartitionedTopicStatsImpl.replication` is initialized `false`, so the expression `this.connected & other.connected` will always be `false`.

Then we will always get the value `false` if we call `pulsar-admin topics partitioned-stats`.

### Modifications

make the variable `` of `PartitionedTopicStatsImpl` is initialized `true`

(cherry picked from commit 9fc0b5e)
poorbarcode added a commit that referenced this pull request Mar 29, 2023
…ioned-topic stat (#19942)

### Motivation

Pulsar will merge the variable `PartitionedTopicStatsImpl.replication[x].connected` by the way below when we call `pulsar-admin topics partitioned-stats`

``` java
this.connected = this.connected & other.connected
```

But the variable `connected` of `PartitionedTopicStatsImpl.replication` is initialized `false`, so the expression `this.connected & other.connected` will always be `false`.

Then we will always get the value `false` if we call `pulsar-admin topics partitioned-stats`.

### Modifications

make the variable `` of `PartitionedTopicStatsImpl` is initialized `true`

(cherry picked from commit 9fc0b5e)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Mar 29, 2023
…ioned-topic stat (apache#19942)

### Motivation

Pulsar will merge the variable `PartitionedTopicStatsImpl.replication[x].connected` by the way below when we call `pulsar-admin topics partitioned-stats`

``` java
this.connected = this.connected & other.connected
```

But the variable `connected` of `PartitionedTopicStatsImpl.replication` is initialized `false`, so the expression `this.connected & other.connected` will always be `false`.

Then we will always get the value `false` if we call `pulsar-admin topics partitioned-stats`.

### Modifications

make the variable `` of `PartitionedTopicStatsImpl` is initialized `true`

(cherry picked from commit 9fc0b5e)
(cherry picked from commit 4f15792)
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.

6 participants