You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "hrzzzz (via GitHub)" <gi...@apache.org> on 2024/12/20 08:19:17 UTC
[PR] [fix][broker] Fix bug causing loss of migrated information when setting other localPolicies in namespace [pulsar]
hrzzzz opened a new pull request, #23764:
URL: https://github.com/apache/pulsar/pull/23764
### Motivation
https://github.com/apache/pulsar/pull/21367 introduced the `migrated` field in `localPolicies` to indicate whether the topics under a namespace have been migrated in the blue-green cluster migration feature.
In https://github.com/apache/pulsar/pull/9598, it is specified that when updating the field content of `localPolicies`, a new object needs to be created instead of updating the original object.
After the addition of the `migrated` field in https://github.com/apache/pulsar/pull/21367, there has been no synchronization of modifications in other places that update `localPolicies`. This could lead to the loss of the `migrated` content during other operations on `localPolicies`, such as setting the `namespaceAntiAffinityGroup`, etc.
### Modifications
1. Synchronize the `migrated` content in the places where `localPolicies` are updated
2. When updating the `migrated` field of `localPolicies`, do not modify the original object
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
- Added test in: org.apache.pulsar.broker.admin.NamespacesTest#testMigratedInfoIsNotLostDuringOtherLocalPoliciesUpdate
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*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
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: https://github.com/hrzzzz/pulsar/pull/13
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix bug causing loss of migrated information when setting other localPolicies in namespace [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #23764:
URL: https://github.com/apache/pulsar/pull/23764#issuecomment-2556808722
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/23764?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 74.26%. Comparing base [(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`bd19ba4`)](https://app.codecov.io/gh/apache/pulsar/commit/bd19ba4614bd5bd4e13dfd8e8fce1cd558f2e607?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 804 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/23764?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #23764 +/- ##
============================================
+ Coverage 73.57% 74.26% +0.68%
+ Complexity 32624 32098 -526
============================================
Files 1877 1838 -39
Lines 139502 143058 +3556
Branches 15299 16232 +933
============================================
+ Hits 102638 106239 +3601
+ Misses 28908 28426 -482
- Partials 7956 8393 +437
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/23764/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/23764/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.68% <50.00%> (+2.09%)` | :arrow_up: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/23764/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.69% <50.00%> (-0.64%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/23764/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.63% <100.00%> (+0.78%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/23764?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...pache/pulsar/broker/admin/impl/NamespacesBase.java](https://app.codecov.io/gh/apache/pulsar/pull/23764?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Fadmin%2Fimpl%2FNamespacesBase.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9hZG1pbi9pbXBsL05hbWVzcGFjZXNCYXNlLmphdmE=) | `76.09% <100.00%> (+3.01%)` | :arrow_up: |
| [.../apache/pulsar/common/naming/NamespaceBundles.java](https://app.codecov.io/gh/apache/pulsar/pull/23764?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fcommon%2Fnaming%2FNamespaceBundles.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NvbW1vbi9uYW1pbmcvTmFtZXNwYWNlQnVuZGxlcy5qYXZh) | `80.00% <100.00%> (+0.25%)` | :arrow_up: |
| [...che/pulsar/common/policies/data/LocalPolicies.java](https://app.codecov.io/gh/apache/pulsar/pull/23764?src=pr&el=tree&filepath=pulsar-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fcommon%2Fpolicies%2Fdata%2FLocalPolicies.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NvbW1vbi9wb2xpY2llcy9kYXRhL0xvY2FsUG9saWNpZXMuamF2YQ==) | `100.00% <100.00%> (+8.33%)` | :arrow_up: |
... and [1003 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/23764/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix bug causing loss of migrated information when setting other localPolicies in namespace [pulsar]
Posted by "hrzzzz (via GitHub)" <gi...@apache.org>.
hrzzzz commented on PR #23764:
URL: https://github.com/apache/pulsar/pull/23764#issuecomment-2556677160
/pulsarbot rerun-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix bug causing loss of migrated information when setting other localPolicies in namespace [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #23764:
URL: https://github.com/apache/pulsar/pull/23764
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org