Skip to content

[feat][broker]: support dynamic update topic broker-level publish-rate#14387

Merged
codelipenghui merged 3 commits intoapache:masterfrom
AnonHxy:opt_publishRate_brokerLevel
Mar 18, 2022
Merged

[feat][broker]: support dynamic update topic broker-level publish-rate#14387
codelipenghui merged 3 commits intoapache:masterfrom
AnonHxy:opt_publishRate_brokerLevel

Conversation

@AnonHxy
Copy link
Contributor

@AnonHxy AnonHxy commented Feb 20, 2022

Motivation

Dynamic update topic broker-level publish-rate.

Modifications

Invoke org.apache.pulsar.broker.service.BrokerService#registerConfigurationListener to register listeners
about maxPublishRatePerTopicInMessages and maxPublishRatePerTopicInBytes

Verifying this change

  • Make sure that the change passes the CI checks.
  • Add org.apache.pulsar.broker.service.PrecisTopicPublishRateThrottleTest#testMultiLevelPublishRate to test the case

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • no-need-doc

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 20, 2022
@AnonHxy
Copy link
Contributor Author

AnonHxy commented Feb 21, 2022

/pulsarbot run-failure-checks

Copy link
Contributor

@Jason918 Jason918 left a comment

Choose a reason for hiding this comment

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

Overall LGTM.
Please add unit test for broker level dynamic updating, we missed cover this case.

@codelipenghui codelipenghui added this to the 2.11.0 milestone Feb 23, 2022
@codelipenghui
Copy link
Contributor

+1 please add test for the new changes.

@AnonHxy AnonHxy force-pushed the opt_publishRate_brokerLevel branch from ec3ea32 to 1d49557 Compare March 4, 2022 06:46
@AnonHxy
Copy link
Contributor Author

AnonHxy commented Mar 4, 2022

/pulsarbot run-failure-checks

MessageId messageId = null;
try {
// first will be success, and will set auto read to false
messageId = producer.sendAsync(new byte[expectedRate]).get(500, TimeUnit.MILLISECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we only need to check the dynamic update is been applied, do not need to check if the rate limier is works or not? because the rate limiter is tested by other tests.

So that we don't introduce Thread.sleep() in this test, which might introduce new flaky tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we only need to check the dynamic update is been applied, do not need to check if the rate limier is works or not?

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have updated the UT, PTAL @codelipenghui @Jason918

@AnonHxy
Copy link
Contributor Author

AnonHxy commented Mar 18, 2022

/pulsarbot run-failure-checks

@codelipenghui codelipenghui changed the title [Broker]Dynamic update topic broker-level publish-rate [feat][broker]: support dynamic update topic broker-level publish-rate Mar 18, 2022
@codelipenghui codelipenghui added type/feature The PR added a new feature or issue requested a new feature area/broker and removed area/broker labels Mar 18, 2022
@codelipenghui codelipenghui merged commit b5e0c94 into apache:master Mar 18, 2022
aparajita89 pushed a commit to aparajita89/pulsar that referenced this pull request Mar 21, 2022
apache#14387)

### Motivation

Dynamic update topic broker-level publish-rate.

### Modifications

Invoke `org.apache.pulsar.broker.service.BrokerService#registerConfigurationListener` to register   listeners 
 about `maxPublishRatePerTopicInMessages` and `maxPublishRatePerTopicInBytes`
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
apache#14387)

### Motivation

Dynamic update topic broker-level publish-rate.

### Modifications

Invoke `org.apache.pulsar.broker.service.BrokerService#registerConfigurationListener` to register   listeners 
 about `maxPublishRatePerTopicInMessages` and `maxPublishRatePerTopicInBytes`
AnonHxy added a commit to AnonHxy/pulsar that referenced this pull request Jul 25, 2022
apache#14387)

Dynamic update topic broker-level publish-rate.

Invoke `org.apache.pulsar.broker.service.BrokerService#registerConfigurationListener` to register   listeners
 about `maxPublishRatePerTopicInMessages` and `maxPublishRatePerTopicInBytes`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs type/feature The PR added a new feature or issue requested a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants