Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][broker] Fix unexpected behaviour by invoke PulsarConfigurationLoader#convertFrom #18816

Merged
merged 2 commits into from
Dec 9, 2022
Merged

[fix][broker] Fix unexpected behaviour by invoke PulsarConfigurationLoader#convertFrom #18816

merged 2 commits into from
Dec 9, 2022

Conversation

mattisonchao
Copy link
Member

@mattisonchao mattisonchao commented Dec 8, 2022

Motivation

This regression is introduced by #16234.

I found it by setting proxyAdditionalServlets on the proxy, I expected it could load the additional servlet, but it didn’t work well. the proxyConfig.getProperties().getProperty("proxyAdditionalServlets") method returns null after invoking PulsarConfigurationLoader#convertFrom.

After investigating, The root cause is we use the same properties object when we invoke convertFrom method. And then, it set the unknown field to the new config without any type check.

Modifications

  • Don't use the same properties object when converting.

Verifying this change

  • Make sure that the change passes the CI checks.

  • doc-not-needed

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

@mattisonchao Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@mattisonchao mattisonchao changed the title [fix][common] Fix unexpected value by invoke PulsarConfigurationLoader#convertFrom [fix][common] Fix unexpected behaviour by invoke PulsarConfigurationLoader#convertFrom Dec 8, 2022
@mattisonchao mattisonchao self-assigned this Dec 8, 2022
@mattisonchao mattisonchao added this to the 2.12.0 milestone Dec 8, 2022
@mattisonchao mattisonchao added release/2.11.1 release/blocker Indicate the PR or issue that should block the release until it gets resolved release/2.11.0 and removed doc-label-missing release/2.11.1 labels Dec 8, 2022
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 8, 2022
@Technoboy- Technoboy- closed this Dec 8, 2022
@Technoboy- Technoboy- reopened this Dec 8, 2022
@Technoboy- Technoboy- changed the title [fix][common] Fix unexpected behaviour by invoke PulsarConfigurationLoader#convertFrom [fix][common] Fix unexpected behaviour by invoke PulsarConfigurationLoader#convertFrom Dec 8, 2022
@Technoboy- Technoboy- changed the title [fix][common] Fix unexpected behaviour by invoke PulsarConfigurationLoader#convertFrom [fix][broker] Fix unexpected behaviour by invoke PulsarConfigurationLoader#convertFrom Dec 8, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2022

Codecov Report

Merging #18816 (8d69886) into master (68ca60c) will decrease coverage by 8.45%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18816      +/-   ##
============================================
- Coverage     50.05%   41.60%   -8.46%     
+ Complexity    11024     2404    -8620     
============================================
  Files           703      235     -468     
  Lines         68814    16671   -52143     
  Branches       7378     1819    -5559     
============================================
- Hits          34446     6936   -27510     
+ Misses        30621     8974   -21647     
+ Partials       3747      761    -2986     
Flag Coverage Δ
unittests 41.60% <ø> (-8.46%) ⬇️

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

Impacted Files Coverage Δ
...apache/pulsar/client/impl/AutoClusterFailover.java 69.44% <0.00%> (-0.56%) ⬇️
...ersistentStickyKeyDispatcherMultipleConsumers.java
...r/stats/prometheus/PrometheusMetricsGenerator.java
...er/loadbalance/extensions/data/BrokerLoadData.java
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java
...ache/pulsar/broker/namespace/NamespaceService.java
...er/mledger/impl/ManagedLedgerFactoryMBeanImpl.java
...rg/apache/pulsar/broker/namespace/OwnedBundle.java
...rvice/nonpersistent/NonPersistentSubscription.java
...he/pulsar/broker/intercept/BrokerInterceptors.java
... and 459 more

Copy link
Contributor

@congbobo184 congbobo184 left a comment

Choose a reason for hiding this comment

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

LGTM! could you please add a test for annotation FieldContext.class

@mattisonchao mattisonchao requested a review from Jason918 December 8, 2022 08:50
@codelipenghui codelipenghui merged commit ac7a34f into apache:master Dec 9, 2022
@mattisonchao mattisonchao deleted the fix_conf_regression branch December 9, 2022 00:40
Technoboy- pushed a commit that referenced this pull request Dec 9, 2022
@Technoboy- Technoboy- added cherry-picked/branch-2.11 and removed release/blocker Indicate the PR or issue that should block the release until it gets resolved labels Dec 9, 2022
Demogorgon314 pushed a commit to Demogorgon314/pulsar that referenced this pull request Dec 26, 2022
Demogorgon314 pushed a commit to Demogorgon314/pulsar that referenced this pull request Dec 29, 2022
lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Jan 10, 2023
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.

10 participants