You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/01 08:10:12 UTC

[GitHub] [pulsar] Nicklee007 opened a new pull request, #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Nicklee007 opened a new pull request, #16325:
URL: https://github.com/apache/pulsar/pull/16325

   ### Motivation
   Fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client, which will cause even we delete-bookie-affinity-group and always used the last BookieAffinityGroup setting.
   1. If we set `bookkeeperClientIsolationGroups=aGroup` in `broker.conf ` and local policy set `set-bookie-affinity-group public/default --primary-group bGroup`,  the `defaultIsolationGroups` be set as `bGroup` when init bookkeeper client ,  and after invoke  `delete-bookie-affinity-group`, there are choice bookies in `bGroup`, the correct behavior is `aGroup` which we set int `broker.conf`.
   2. If we don't set `bookkeeperClientIsolationGroups=` in `broker.conf` , and local policy set `set-bookie-affinity-group public/default --primary-group bGroup`, the `defaultIsolationGroups` be set as `bGroup` when init bookkeeper client , and after invoke  `delete-bookie-affinity-group`, there are choice bookies in `bGroup`, the correct behavior is no more isolation policy.
   
   #### To Reproduce
   The unit test can help reproduce the bug , but it running success is also depend on another PR #16273 which is fix the `defaultIsolationGroups` be  permanent covered when invoke newEnsemble, so we need merge  PR #16273 firstly.
   
   ### Modifications
   
   1.  When create bookkeeper client In `BookKeeperClientFactoryImpl.class`  , add the `ServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy` to `bkConf` if not empty.
   3. When create bookkeeper client In `BookKeeperClientFactoryImpl.class`,  cancel to  set the local policy `BookieAffinityGroup` properties to bkConf, to avoid cover the `ISOLATION_BOOKIE_GROUPS` if  the `ServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy` is empty.
   4.  Modify `bookieMappingCache` init time to adapt the  `ServiceConfiguration's IsolatedBookieEnsemblePlacementPolicy` is empty case.
   5. add some unit test.
   
   
   ### Documentation
   - [X] `doc-not-needed` 
   
   


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


[GitHub] [pulsar] Jason918 commented on a diff in pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Jason918 commented on code in PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#discussion_r931760099


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java:
##########
@@ -71,9 +71,7 @@ public BookKeeper create(ServiceConfiguration conf, MetadataStoreExtended store,
         MetadataDrivers.registerClientDriver("metadata-store", PulsarMetadataClientDriver.class);
 
         ClientConfiguration bkConf = createBkClientConfiguration(store, conf);
-        if (properties != null) {
-            properties.forEach((key, value) -> bkConf.setProperty(key, value));
-        }
+

Review Comment:
   This seems like a breaking change. We are not able to set `bkConf` through `properties` at all.



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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1174656066

   /pulsarbot run-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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1186176236

   /pulsarbot run-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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1192470217

   @Jason918 Could you help to review this PR, Thx.


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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1194995710

   @codelipenghui @Jason918 @eolivelli Could you help to review this PR, Thx.


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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1184051643

   /pulsarbot run-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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1186614356

   /pulsarbot run-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


[GitHub] [pulsar] Jason918 commented on a diff in pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Jason918 commented on code in PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#discussion_r933789130


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java:
##########
@@ -71,9 +71,7 @@ public BookKeeper create(ServiceConfiguration conf, MetadataStoreExtended store,
         MetadataDrivers.registerClientDriver("metadata-store", PulsarMetadataClientDriver.class);
 
         ClientConfiguration bkConf = createBkClientConfiguration(store, conf);
-        if (properties != null) {
-            properties.forEach((key, value) -> bkConf.setProperty(key, value));
-        }
+

Review Comment:
   I understand that removing `properties` here can solve current isolation issue. My concern is that if this `properties` is introduced only to support isolation?



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


[GitHub] [pulsar] github-actions[bot] commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1287585325

   The pr had no activity for 30 days, mark with Stale label.


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


[GitHub] [pulsar] Nicklee007 commented on a diff in pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on code in PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#discussion_r931776838


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java:
##########
@@ -71,9 +71,7 @@ public BookKeeper create(ServiceConfiguration conf, MetadataStoreExtended store,
         MetadataDrivers.registerClientDriver("metadata-store", PulsarMetadataClientDriver.class);
 
         ClientConfiguration bkConf = createBkClientConfiguration(store, conf);
-        if (properties != null) {
-            properties.forEach((key, value) -> bkConf.setProperty(key, value));
-        }
+

Review Comment:
   As the Isolation logic, if we set the isolation policy in bkConf,  when invoke  `newEnsemble` or `replaceBookie`  in `solatedBookieEnsemblePlacementPolicy` as  follow we also can use the policy setting to choice bookies, even we do not set the properties in here; It like do not cause breaking;
   Cancel the properties setting in here is do not want the dynamic local policy covey the properties in broker.conf
   
   https://github.com/apache/pulsar/blob/4c6989c4da6c0b18c9b0196630e03daf437cea68/pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java#L146-L160



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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1200651301

   /pulsarbot run-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


[GitHub] [pulsar] Jason918 commented on a diff in pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Jason918 commented on code in PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#discussion_r938385045


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java:
##########
@@ -71,9 +71,7 @@ public BookKeeper create(ServiceConfiguration conf, MetadataStoreExtended store,
         MetadataDrivers.registerClientDriver("metadata-store", PulsarMetadataClientDriver.class);
 
         ClientConfiguration bkConf = createBkClientConfiguration(store, conf);
-        if (properties != null) {
-            properties.forEach((key, value) -> bkConf.setProperty(key, value));
-        }
+

Review Comment:
   If so, you need to remove the `properties` from the method.



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


[GitHub] [pulsar] Nicklee007 commented on a diff in pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on code in PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#discussion_r934118873


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java:
##########
@@ -71,9 +71,7 @@ public BookKeeper create(ServiceConfiguration conf, MetadataStoreExtended store,
         MetadataDrivers.registerClientDriver("metadata-store", PulsarMetadataClientDriver.class);
 
         ClientConfiguration bkConf = createBkClientConfiguration(store, conf);
-        if (properties != null) {
-            properties.forEach((key, value) -> bkConf.setProperty(key, value));
-        }
+

Review Comment:
   @Jason918 This change satisfied our expect, the properties only contain bookie isolation properties. So remove the properties do not effect other properties be setting.
   
   https://github.com/apache/pulsar/blob/cb305823b77ae36b67db575793a2f40f874a977a/pulsar-broker/src/main/java/org/apache/pulsar/broker/ManagedLedgerClientFactory.java#L92-L98



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


[GitHub] [pulsar] Jason918 commented on a diff in pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Jason918 commented on code in PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#discussion_r931761022


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java:
##########
@@ -234,6 +232,13 @@ private void setEnsemblePlacementPolicy(ClientConfiguration bkConf, ServiceConfi
                     NET_TOPOLOGY_SCRIPT_FILE_NAME_KEY,
                     ""));
         }
+
+        if (conf.getBookkeeperClientIsolationGroups() != null && !conf.getBookkeeperClientIsolationGroups().isEmpty()) {

Review Comment:
   We can use `StringUtils.isNotBlank` instead.



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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1226854806

   /pulsarbot run-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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1186618663

   /pulsarbot run-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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1183938722

   /pulsarbot run-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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1183924610

   /pulsarbot run-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


[GitHub] [pulsar] Nicklee007 commented on a diff in pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on code in PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#discussion_r931779735


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java:
##########
@@ -234,6 +232,13 @@ private void setEnsemblePlacementPolicy(ClientConfiguration bkConf, ServiceConfi
                     NET_TOPOLOGY_SCRIPT_FILE_NAME_KEY,
                     ""));
         }
+
+        if (conf.getBookkeeperClientIsolationGroups() != null && !conf.getBookkeeperClientIsolationGroups().isEmpty()) {

Review Comment:
   changed the config check, Thx.



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


[GitHub] [pulsar] Nicklee007 commented on pull request #16325: [fix][broker] fix the local police IsolationGroups cover the defaultIsolationGroups when init managedLedger bookkeeper client

Posted by GitBox <gi...@apache.org>.
Nicklee007 commented on PR #16325:
URL: https://github.com/apache/pulsar/pull/16325#issuecomment-1198940310

   /pulsarbot run-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