You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "rdhabalia (via GitHub)" <gi...@apache.org> on 2023/10/13 17:30:25 UTC
[PR] [fix][broker] Fix race condition of replication cluster connection during migration topic [pulsar]
rdhabalia opened a new pull request, #21364:
URL: https://github.com/apache/pulsar/pull/21364
### Motivation
Right now, during global topic migration, blue cluster creates topic resources such as tenant,namespace, topic-subscriptions..it will allow green cluster to load the topic and that topic will try to connect to replication clusters where blue-cluster topic is already connected. but due to some reason if green cluster gets connected with other region's replication clusters and if blue cluster has replication backlog on that topic then blue-cluster will not be able to connect to those replication clusters and won't be able to drain the backlog unless green cluster disconnect with those replication clusters for sometime.
To avoid such race conditions between blue and green clusters to connect to other replication clusters, blue cluster must not create topic-resources in green cluster until topic in to blue cluster drains all replication backlog and then create topic resources in green cluster and migrate the topic to green cluster.
### Modifications
Broker will create topic resources in green cluster only after blue cluster drains the replication backlog to avoid replication connection race condition during migration.
### Result
This change will prevent replication backlog delay into blue cluster due to connection race condition between blue and green cluster during migration.
It depends on #21354
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### 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 -->
- [ ] `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: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
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 race condition of replication cluster connection during migration topic [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #21364:
URL: https://github.com/apache/pulsar/pull/21364#issuecomment-1762862732
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#21364](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (5148a92) into [master](https://app.codecov.io/gh/apache/pulsar/commit/eb9fa63d6bcaa4e1cbc4b87e36ead5a3ff6c44ae?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (eb9fa63) will **decrease** coverage by `35.32%`.
> Report is 4 commits behind head on master.
> The diff coverage is `10.44%`.
[](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #21364 +/- ##
=============================================
- Coverage 72.10% 36.78% -35.32%
+ Complexity 32291 12254 -20037
=============================================
Files 1875 1711 -164
Lines 140068 130868 -9200
Branches 15431 14292 -1139
=============================================
- Hits 100997 48143 -52854
- Misses 31008 76384 +45376
+ Partials 8063 6341 -1722
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/21364/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/21364/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.17% <10.44%> (?)` | |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/21364/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.69% <10.44%> (?)` | |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/21364/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `31.97% <10.69%> (-40.13%)` | :arrow_down: |
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](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...org/apache/pulsar/broker/ServiceConfiguration.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9icm9rZXIvU2VydmljZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `98.05% <100.00%> (-0.92%)` | :arrow_down: |
| [...n/java/org/apache/pulsar/broker/service/Topic.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1RvcGljLmphdmE=) | `9.09% <ø> (-27.28%)` | :arrow_down: |
| [...ava/org/apache/pulsar/client/admin/Namespaces.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC1hZG1pbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9jbGllbnQvYWRtaW4vTmFtZXNwYWNlcy5qYXZh) | `0.00% <ø> (-66.67%)` | :arrow_down: |
| [...g/apache/pulsar/common/policies/data/Policies.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC1hZG1pbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9jb21tb24vcG9saWNpZXMvZGF0YS9Qb2xpY2llcy5qYXZh) | `54.54% <ø> (-4.55%)` | :arrow_down: |
| [...ava/org/apache/pulsar/broker/service/Consumer.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL0NvbnN1bWVyLmphdmE=) | `62.65% <0.00%> (-23.59%)` | :arrow_down: |
| [.../java/org/apache/pulsar/admin/cli/CmdClusters.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC10b29scy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2FkbWluL2NsaS9DbWRDbHVzdGVycy5qYXZh) | `0.00% <0.00%> (-74.08%)` | :arrow_down: |
| [.../org/apache/pulsar/broker/admin/v1/Namespaces.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9hZG1pbi92MS9OYW1lc3BhY2VzLmphdmE=) | `8.26% <0.00%> (-43.86%)` | :arrow_down: |
| [.../org/apache/pulsar/broker/admin/v2/Namespaces.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9hZG1pbi92Mi9OYW1lc3BhY2VzLmphdmE=) | `19.48% <0.00%> (-47.42%)` | :arrow_down: |
| [...oker/service/nonpersistent/NonPersistentTopic.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL25vbnBlcnNpc3RlbnQvTm9uUGVyc2lzdGVudFRvcGljLmphdmE=) | `46.72% <40.00%> (-24.96%)` | :arrow_down: |
| [...pache/pulsar/common/policies/data/ClusterData.java](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC1hZG1pbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3B1bHNhci9jb21tb24vcG9saWNpZXMvZGF0YS9DbHVzdGVyRGF0YS5qYXZh) | `11.11% <0.00%> (-60.32%)` | :arrow_down: |
| ... and [10 more](https://app.codecov.io/gh/apache/pulsar/pull/21364?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
... and [1476 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/21364/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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 race condition of replication cluster connection during migration topic [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed pull request #21364: [fix][broker] Fix race condition of replication cluster connection during migration topic
URL: https://github.com/apache/pulsar/pull/21364
--
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 race condition of replication cluster connection during migration topic [pulsar]
Posted by "rdhabalia (via GitHub)" <gi...@apache.org>.
rdhabalia commented on PR #21364:
URL: https://github.com/apache/pulsar/pull/21364#issuecomment-1763124913
I will reopen this PR as soon as other depending PR will be merged.
--
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 race condition of replication cluster connection during migration topic [pulsar]
Posted by "rdhabalia (via GitHub)" <gi...@apache.org>.
rdhabalia merged PR #21364:
URL: https://github.com/apache/pulsar/pull/21364
--
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 race condition of replication cluster connection during migration topic [pulsar]
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on PR #21364:
URL: https://github.com/apache/pulsar/pull/21364#issuecomment-1778327909
Hi @rdhabalia , cluster migration is introduced by 3.0, so I think we need to cherry-pick this patch to branch-3.0 and branch-3.1
--
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 race condition of replication cluster connection during migration topic [pulsar]
Posted by "rdhabalia (via GitHub)" <gi...@apache.org>.
rdhabalia closed pull request #21364: [fix][broker] Fix race condition of replication cluster connection during migration topic
URL: https://github.com/apache/pulsar/pull/21364
--
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