You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lifepuzzlefun (via GitHub)" <gi...@apache.org> on 2023/03/11 12:48:46 UTC

[GitHub] [pulsar] lifepuzzlefun opened a new pull request, #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   
   <!-- Either this PR fixes an issue, -->
   
   Fixes #xyz
   
   <!-- or this PR is one task of an issue -->
   
   Master Issue: #xyz
   
   <!-- If the PR belongs to a PIP, please add the PIP link here -->
   
   PIP: #xyz 
   
   <!-- Details of when a PIP is required and how the PIP process work, please see: https://github.com/apache/pulsar/blob/master/wiki/proposals/PIP.md -->
   
   ### Motivation
   Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`
   
   ### Modifications
   
   1. set metadata store name to avoid generate metric with name cause relate unit test fail.
   
   2. auto generate metadata store name if caller not specify one for avoid this problem occur again.
   
   
   ### 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


[GitHub] [pulsar] nodece commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   Is the root cause that the metadatastoreName is empty?


-- 
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] lifepuzzlefun commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   the auto generate metadata store name will be like `org.apache.pulsar.metadata.MetadataStoreConfigTest_testGeneCallerStackNameWhenMetadataStoreNameNotSet_11`


-- 
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 #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19793:
URL: https://github.com/apache/pulsar/pull/19793#issuecomment-1464905319

   @lifepuzzlefun 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 -->
   ```


-- 
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] nodece commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataStoreConfig.java:
##########
@@ -81,6 +84,39 @@ public class MetadataStoreConfig {
     @Builder.Default
     private final String metadataStoreName = "";
 
+    public static MetadataStoreConfigBuilder builder() {
+        return new CustomMetadataStoreConfigBuilder();
+    }
+
+    public static class CustomMetadataStoreConfigBuilder extends MetadataStoreConfigBuilder {
+
+        private String callerSetMetadataStoreName;
+
+        @Override
+        public MetadataStoreConfigBuilder metadataStoreName(String metadataStoreName) {
+            this.callerSetMetadataStoreName = metadataStoreName;
+            return super.metadataStoreName(metadataStoreName);
+        }
+
+        @Override
+        public MetadataStoreConfig build() {
+            if (Strings.isEmpty(this.callerSetMetadataStoreName)) {
+                Exception e = new Exception("stack trace");

Review Comment:
   I think you can throw an exception, so like:
   ```
   throw new IllegalArgumentException("metadataStoreName is required");
   ```



-- 
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] lifepuzzlefun commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/MultiBrokerMetadataConsistencyTest.java:
##########
@@ -43,6 +44,9 @@ protected int numberOfAdditionalBrokers() {
 
     TestZKServer testZKServer;
 
+    private final ConcurrentHashMap<MetadataStoreExtended, Object> needCloseStore =

Review Comment:
   will the test run concurrently?



-- 
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] nodece commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   This fix is invalid, see https://github.com/apache/pulsar/actions/runs/4424020709/jobs/7763604452#step:11:1277


-- 
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] nodece merged pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


-- 
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] nodece commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   /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


[GitHub] [pulsar] nodece commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/MetadataStoreStatsTest.java:
##########
@@ -69,6 +69,9 @@ protected void cleanup() throws Exception {
 
     @Test
     public void testMetadataStoreStats() throws Exception {
+        // if this test fail see link below to find something.

Review Comment:
   It looks unnecessary.



-- 
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] lifepuzzlefun commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   @lhotari please take a look.


-- 
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] nodece commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataStoreConfig.java:
##########
@@ -81,6 +84,39 @@ public class MetadataStoreConfig {
     @Builder.Default
     private final String metadataStoreName = "";
 
+    public static MetadataStoreConfigBuilder builder() {
+        return new CustomMetadataStoreConfigBuilder();
+    }
+
+    public static class CustomMetadataStoreConfigBuilder extends MetadataStoreConfigBuilder {
+
+        private String callerSetMetadataStoreName;
+
+        @Override
+        public MetadataStoreConfigBuilder metadataStoreName(String metadataStoreName) {
+            this.callerSetMetadataStoreName = metadataStoreName;
+            return super.metadataStoreName(metadataStoreName);
+        }
+
+        @Override
+        public MetadataStoreConfig build() {
+            if (Strings.isEmpty(this.callerSetMetadataStoreName)) {
+                Exception e = new Exception("stack trace");

Review Comment:
   > yes, other modification is for this case not happen again and supply some method to find the wrong usage.
   
   Makes sense! But this is rare.



-- 
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] lifepuzzlefun commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   @nodece @coderzc please take a look.


-- 
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] lifepuzzlefun commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/MetadataStoreStatsTest.java:
##########
@@ -69,6 +69,9 @@ protected void cleanup() throws Exception {
 
     @Test
     public void testMetadataStoreStats() throws Exception {
+        // if this test fail see link below to find something.

Review Comment:
   fixed



##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/MultiBrokerMetadataConsistencyTest.java:
##########
@@ -43,6 +44,9 @@ protected int numberOfAdditionalBrokers() {
 
     TestZKServer testZKServer;
 
+    private final ConcurrentHashMap<MetadataStoreExtended, Object> needCloseStore =

Review Comment:
   fixed



-- 
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] lifepuzzlefun commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   /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


[GitHub] [pulsar] nodece commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/MultiBrokerMetadataConsistencyTest.java:
##########
@@ -43,6 +44,9 @@ protected int numberOfAdditionalBrokers() {
 
     TestZKServer testZKServer;
 
+    private final ConcurrentHashMap<MetadataStoreExtended, Object> needCloseStore =

Review Comment:
   Could you use the List?



-- 
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] lifepuzzlefun commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataStoreConfig.java:
##########
@@ -81,6 +84,39 @@ public class MetadataStoreConfig {
     @Builder.Default
     private final String metadataStoreName = "";
 
+    public static MetadataStoreConfigBuilder builder() {
+        return new CustomMetadataStoreConfigBuilder();
+    }
+
+    public static class CustomMetadataStoreConfigBuilder extends MetadataStoreConfigBuilder {
+
+        private String callerSetMetadataStoreName;
+
+        @Override
+        public MetadataStoreConfigBuilder metadataStoreName(String metadataStoreName) {
+            this.callerSetMetadataStoreName = metadataStoreName;
+            return super.metadataStoreName(metadataStoreName);
+        }
+
+        @Override
+        public MetadataStoreConfig build() {
+            if (Strings.isEmpty(this.callerSetMetadataStoreName)) {
+                Exception e = new Exception("stack trace");

Review Comment:
   I agree with you. the problem is there is a lot of ut didn't set name. If they don't set name but they close the object the flaky test won't occur.



-- 
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] lifepuzzlefun commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataStoreConfig.java:
##########
@@ -81,6 +84,39 @@ public class MetadataStoreConfig {
     @Builder.Default
     private final String metadataStoreName = "";
 
+    public static MetadataStoreConfigBuilder builder() {
+        return new CustomMetadataStoreConfigBuilder();
+    }
+
+    public static class CustomMetadataStoreConfigBuilder extends MetadataStoreConfigBuilder {
+
+        private String callerSetMetadataStoreName;
+
+        @Override
+        public MetadataStoreConfigBuilder metadataStoreName(String metadataStoreName) {
+            this.callerSetMetadataStoreName = metadataStoreName;
+            return super.metadataStoreName(metadataStoreName);
+        }
+
+        @Override
+        public MetadataStoreConfig build() {
+            if (Strings.isEmpty(this.callerSetMetadataStoreName)) {
+                Exception e = new Exception("stack trace");

Review Comment:
   yes i agree with you. maybe we can add one comment in this unit test point to the current modification to catch up new wrong usage. and the branch will be retain for those who is block by this problem.
   
   I'll remove the current metadataStore name generate code for this patch to merge. 



-- 
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] lifepuzzlefun commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   > Is the root cause that the metadatastoreName is empty?
   
   @nodece The root cause is create one MetadataStore with no name set and not close it.


-- 
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] nodece commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataStoreConfig.java:
##########
@@ -81,6 +84,39 @@ public class MetadataStoreConfig {
     @Builder.Default
     private final String metadataStoreName = "";
 
+    public static MetadataStoreConfigBuilder builder() {
+        return new CustomMetadataStoreConfigBuilder();
+    }
+
+    public static class CustomMetadataStoreConfigBuilder extends MetadataStoreConfigBuilder {
+
+        private String callerSetMetadataStoreName;
+
+        @Override
+        public MetadataStoreConfigBuilder metadataStoreName(String metadataStoreName) {
+            this.callerSetMetadataStoreName = metadataStoreName;
+            return super.metadataStoreName(metadataStoreName);
+        }
+
+        @Override
+        public MetadataStoreConfig build() {
+            if (Strings.isEmpty(this.callerSetMetadataStoreName)) {
+                Exception e = new Exception("stack trace");

Review Comment:
   So can we just need to close the metadatastore to fix the flaky test?



-- 
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] lifepuzzlefun commented on a diff in pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/MetadataStoreConfig.java:
##########
@@ -81,6 +84,39 @@ public class MetadataStoreConfig {
     @Builder.Default
     private final String metadataStoreName = "";
 
+    public static MetadataStoreConfigBuilder builder() {
+        return new CustomMetadataStoreConfigBuilder();
+    }
+
+    public static class CustomMetadataStoreConfigBuilder extends MetadataStoreConfigBuilder {
+
+        private String callerSetMetadataStoreName;
+
+        @Override
+        public MetadataStoreConfigBuilder metadataStoreName(String metadataStoreName) {
+            this.callerSetMetadataStoreName = metadataStoreName;
+            return super.metadataStoreName(metadataStoreName);
+        }
+
+        @Override
+        public MetadataStoreConfig build() {
+            if (Strings.isEmpty(this.callerSetMetadataStoreName)) {
+                Exception e = new Exception("stack trace");

Review Comment:
   yes, other modification is for this case not happen again and supply some method to find the wrong usage.
   
   the modification won't hurt production. 



-- 
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] nodece commented on pull request #19793: [fix] [test] Fix flaky test `MetadataStoreStatsTest.testBatchMetadataStoreMetrics`

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

   /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