pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix][admin] Refactor bookie affinity group sync operations to async in rest api

Open oneby-wang opened this issue 1 month ago • 1 comments

Motivation

It is not recommended to use sync operations in NIO threads, which would block other operations and degrade the overall performance of the system.

Modifications

Refactor bookie affinity group sync operations to async in rest api, and add tests.

Verifying this change

  • [x] Make sure that the change passes the CI checks.

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

If the box was checked, please highlight the changes

  • [ ] Dependencies (add or upgrade a dependency)
  • [ ] The public API
  • [ ] The schema
  • [ ] The default values of configurations
  • [ ] The threading model
  • [ ] The binary protocol
  • [x] The REST endpoints
  • [ ] The admin CLI options
  • [ ] The metrics
  • [ ] Anything that affects deployment

Documentation

  • [ ] doc
  • [ ] doc-required
  • [x] doc-not-needed
  • [ ] doc-complete

Matching PR in forked repository

PR in forked repository: https://github.com/oneby-wang/pulsar/pull/12

oneby-wang avatar Dec 09 '25 09:12 oneby-wang

Codecov Report

:x: Patch coverage is 89.65517% with 6 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 74.32%. Comparing base (5356b64) to head (1da9c88). :warning: Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
.../org/apache/pulsar/broker/admin/v1/Namespaces.java 66.66% 6 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #25050       +/-   ##
=============================================
+ Coverage     38.52%   74.32%   +35.79%     
- Complexity    13307    34127    +20820     
=============================================
  Files          1864     1921       +57     
  Lines        146217   150416     +4199     
  Branches      16985    17470      +485     
=============================================
+ Hits          56335   111797    +55462     
+ Misses        82212    29686    -52526     
- Partials       7670     8933     +1263     
Flag Coverage Δ
inttests 26.36% <0.00%> (+0.19%) :arrow_up:
systests 22.86% <0.00%> (+0.03%) :arrow_up:
unittests 73.87% <89.65%> (+39.04%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ulsar/broker/resources/LocalPoliciesResources.java 76.66% <100.00%> (+18.04%) :arrow_up:
...pache/pulsar/broker/admin/impl/NamespacesBase.java 75.90% <100.00%> (+44.09%) :arrow_up:
.../org/apache/pulsar/broker/admin/v2/Namespaces.java 91.01% <100.00%> (+70.62%) :arrow_up:
.../org/apache/pulsar/broker/admin/v1/Namespaces.java 53.01% <66.66%> (+47.15%) :arrow_up:

... and 1419 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov-commenter avatar Dec 10 '25 05:12 codecov-commenter