pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[Bug] ResourceGroupService requests all topic stats every 60 seconds by default even when it shouldn't be enabled

Open lhotari opened this issue 1 year ago • 1 comments

Search before reporting

  • [x] I searched in the issues and found nothing similar.

Read release policy

  • [x] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

User environment

Potentially all released Pulsar versions that include org.apache.pulsar.broker.resourcegroup.ResourceGroupService, since 2.8.0 . It was part of PIP-82.

Issue Description

The documentation for "resourceUsageTransportPublishIntervalInSecs" states: "Default interval to publish usage reports if resourceUsagePublishToTopic is enabled."

https://github.com/apache/pulsar/blob/fcd5f9259bd6790832ee8e7eb127d043b7898a1b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java#L1181-L1186

However, the documentation for the configuration setting doesn't make sense since the job to iterate all topic stats happens every 60 seconds:

https://github.com/apache/pulsar/blob/fcd5f9259bd6790832ee8e7eb127d043b7898a1b/pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java#L693-L710

https://github.com/apache/pulsar/blob/fcd5f9259bd6790832ee8e7eb127d043b7898a1b/pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java#L542-L550

It would be expected that ResourceGroupService wouldn't perform any activities unless it's used and needed.

Error messages


Reproducing the issue

See the description above.

Additional information

No response

Are you willing to submit a PR?

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

lhotari avatar Sep 02 '25 16:09 lhotari

Hi,I'm currently learning Pulsar. I've noticed that there doesn't seem to be a resourceUsagePublishToTopic config. Can we add a config to resolve this issue? If so, I'm willing to submit a PR.

Dream95 avatar Sep 23 '25 02:09 Dream95