You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "heesung-sn (via GitHub)" <gi...@apache.org> on 2024/04/11 01:16:48 UTC

[PR] [fix][broker] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

heesung-sn opened a new pull request, #22478:
URL: https://github.com/apache/pulsar/pull/22478

   <!--
   ### Contribution Checklist
     
     - PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://pulsar.apache.org/contribute/develop-semantic-title/)*. 
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   -->
   
   
   ### Motivation
   
   <!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
   
   Since the internal topics of ExtensibleLoadBalancer(bundle state, broker, and bundle load topics) will be auto-created in the green cluster, we don't need to migrate them.
   
   ### Modifications
   
   - Skip the internal topics of ExtensibleLoadBalancer(bundle state, broker, and bundle load topics) during blute-green migration.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   ### 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: <!-- 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] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

Posted by "heesung-sn (via GitHub)" <gi...@apache.org>.
heesung-sn commented on PR #22478:
URL: https://github.com/apache/pulsar/pull/22478#issuecomment-2050712015

   can't cherry-pick this to 3.0 and 3.1 as this relies on this PR, https://github.com/apache/pulsar/pull/21368


-- 
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] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

Posted by "dragosvictor (via GitHub)" <gi...@apache.org>.
dragosvictor commented on code in PR #22478:
URL: https://github.com/apache/pulsar/pull/22478#discussion_r1561299343


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -825,11 +825,11 @@ synchronized void playLeader() {
         boolean becameFollower = false;
         while (!Thread.currentThread().isInterrupted()) {
             try {
+                initWaiter.await();
                 if (!serviceUnitStateChannel.isChannelOwner()) {
                     becameFollower = true;
                     break;
                 }
-                initWaiter.await();

Review Comment:
   Is this change necessary for the blue-green migration?



-- 
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] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

Posted by "dragosvictor (via GitHub)" <gi...@apache.org>.
dragosvictor commented on code in PR #22478:
URL: https://github.com/apache/pulsar/pull/22478#discussion_r1561289843


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ClusterMigrationTest.java:
##########
@@ -100,10 +105,10 @@ public void setup() throws Exception {
 
         log.info("--- Starting ReplicatorTestBase::setup ---");
 
-        broker1 = new TestBroker("r1");
-        broker2 = new TestBroker("r2");
-        broker3 = new TestBroker("r3");
-        broker4 = new TestBroker("r4");
+        broker1 = new TestBroker("r1", testLoadBalancer());
+        broker2 = new TestBroker("r2", testLoadBalancer());
+        broker3 = new TestBroker("r3", testLoadBalancer());
+        broker4 = new TestBroker("r4", testLoadBalancer());

Review Comment:
   Can we use `org.testng.annotations.Factory` for this purpose, instead of creating a new subclass? [Here](https://github.com/apache/pulsar/blob/82237d3684fe506bcb6426b3b23f413422e6e4fb/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionBufferTest.java#L64) is how it's used in `TransactionBufferTest`.



-- 
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] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

Posted by "heesung-sn (via GitHub)" <gi...@apache.org>.
heesung-sn commented on code in PR #22478:
URL: https://github.com/apache/pulsar/pull/22478#discussion_r1561345444


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -825,11 +825,11 @@ synchronized void playLeader() {
         boolean becameFollower = false;
         while (!Thread.currentThread().isInterrupted()) {
             try {
+                initWaiter.await();
                 if (!serviceUnitStateChannel.isChannelOwner()) {
                     becameFollower = true;
                     break;
                 }
-                initWaiter.await();

Review Comment:
   No. It is a minor fix. Otherwise, isChannelOwner will likely fail for the first time before fully initiating the channel.  (It will retry anyway, but we don't want to spam with error logs when starting the broker)



-- 
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] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

Posted by "heesung-sn (via GitHub)" <gi...@apache.org>.
heesung-sn commented on code in PR #22478:
URL: https://github.com/apache/pulsar/pull/22478#discussion_r1561345791


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ClusterMigrationTest.java:
##########
@@ -100,10 +105,10 @@ public void setup() throws Exception {
 
         log.info("--- Starting ReplicatorTestBase::setup ---");
 
-        broker1 = new TestBroker("r1");
-        broker2 = new TestBroker("r2");
-        broker3 = new TestBroker("r3");
-        broker4 = new TestBroker("r4");
+        broker1 = new TestBroker("r1", testLoadBalancer());
+        broker2 = new TestBroker("r2", testLoadBalancer());
+        broker3 = new TestBroker("r3", testLoadBalancer());
+        broker4 = new TestBroker("r4", testLoadBalancer());

Review Comment:
   done.



-- 
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] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

Posted by "heesung-sn (via GitHub)" <gi...@apache.org>.
heesung-sn merged PR #22478:
URL: https://github.com/apache/pulsar/pull/22478


-- 
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] Do not migrate internal topics during Blue-Green Migration when ExtensibleLoadBalancer is used [pulsar]

Posted by "dragosvictor (via GitHub)" <gi...@apache.org>.
dragosvictor commented on code in PR #22478:
URL: https://github.com/apache/pulsar/pull/22478#discussion_r1561289843


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ClusterMigrationTest.java:
##########
@@ -100,10 +105,10 @@ public void setup() throws Exception {
 
         log.info("--- Starting ReplicatorTestBase::setup ---");
 
-        broker1 = new TestBroker("r1");
-        broker2 = new TestBroker("r2");
-        broker3 = new TestBroker("r3");
-        broker4 = new TestBroker("r4");
+        broker1 = new TestBroker("r1", testLoadBalancer());
+        broker2 = new TestBroker("r2", testLoadBalancer());
+        broker3 = new TestBroker("r3", testLoadBalancer());
+        broker4 = new TestBroker("r4", testLoadBalancer());

Review Comment:
   Can we use `org.testng.annotations.Factory` for this purpose, instead of creating a new subclass? It simplifies the structure and logic of the test. [Here](https://github.com/apache/pulsar/blob/82237d3684fe506bcb6426b3b23f413422e6e4fb/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionBufferTest.java#L64) is how it's used in `TransactionBufferTest`.



-- 
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