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

   Fixes #16454
   
   ### Motivation
   
   See #16454
   
   When starting several brokers concurrently, there is a risk that one will 
fail with the following error:
   
   ```
   2022-06-27T16:23:42,169+0000 [main] ERROR 
org.apache.pulsar.broker.PulsarService - Failed to start Pulsar service: 
org.apache.pulsar.metadata.api.MetadataStoreException$BadVersionException: 
org.apache.zookeeper.KeeperException$BadVersionException: KeeperErrorCode = 
BadVersion for /counters/producer-name
   java.util.concurrent.ExecutionException: 
org.apache.pulsar.metadata.api.MetadataStoreException$BadVersionException: 
org.apache.zookeeper.KeeperException$BadVersionException: KeeperErrorCode = 
BadVersion for /counters/producer-name
           at 
java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) 
~[?:?]
           at 
java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999) ~[?:?]
           at 
org.apache.pulsar.broker.service.DistributedIdGenerator.<init>(DistributedIdGenerator.java:54)
 ~[com.datastax.oss-pulsar-broker-2.10.0.6.jar:2.10.0.6]
           at 
org.apache.pulsar.broker.service.BrokerService.start(BrokerService.java:460) 
~[com.datastax.oss-pulsar-broker-2.10.0.6.jar:2.10.0.
   ```
   The key problem is 
`org.apache.pulsar.metadata.api.MetadataStoreException$BadVersionException: 
org.apache.zookeeper.KeeperException$BadVersionException: KeeperErrorCode = 
BadVersion` for `/counters/producer-name`, and in looking at the 
`/counters/producer-name` initialization, I can see that it does not handle 
retries in the event of a `BadVersion` error.
   
   ### Modifications
   
   Add a retry version of `getNextCounterValue` in `CoordinationService`.
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [x] `doc-not-needed` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to