nicoloboschi opened a new pull request #13891:
URL: https://github.com/apache/pulsar/pull/13891


   ### Motivation
   The PR https://github.com/apache/pulsar/pull/13296 introduces a bug that 
breaks the functions worker in certain types of configuration.
   
   To reproduce: 
   * Use `zookkeeper` entry in `initialize-cluster-metadata` command (which is 
the common configuration before PIP-45) (see the unit test for reference)
   * With 
[this](https://github.com/apache/pulsar/pull/13296/files#diff-03a1201aab4aa284723e575a7c9b18ad9542fcc02beb80d83cfb87d64adf54b5R234
 
   ) change the DL configuration does not use the correct ledgersPath 
(`/ledgers` by default) anymore and instead, it uses the root path 
(ledgersPath="").
   * Start functions-worker and install a connector. This trigger the DLog 
client to upload the Nar file to the bookies. Since the ledgers path does not 
match with the actual BK ledgers path, the client is not able to find an 
available bookie.
   
   
   ```
    
   java.io.IOException: org.apache.bookkeeper.client.BKException$ZKException: 
Error while using ZooKeeper
        at 
org.apache.distributedlog.BookKeeperClient.commonInitialization(BookKeeperClient.java:123)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.BookKeeperClient.initialize(BookKeeperClient.java:172)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.BookKeeperClient.get(BookKeeperClient.java:199) 
~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.BookKeeperClient.createLedger(BookKeeperClient.java:211)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.bk.SimpleLedgerAllocator.allocateLedger(SimpleLedgerAllocator.java:370)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.bk.SimpleLedgerAllocator.allocate(SimpleLedgerAllocator.java:271)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.bk.LedgerAllocatorDelegator.allocate(LedgerAllocatorDelegator.java:67)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.impl.logsegment.BKLogSegmentAllocator.allocate(BKLogSegmentAllocator.java:55)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.BKLogWriteHandler.doStartLogSegment(BKLogWriteHandler.java:571)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.BKLogWriteHandler$10.onSuccess(BKLogWriteHandler.java:538)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.BKLogWriteHandler$10.onSuccess(BKLogWriteHandler.java:530)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:42)
 ~[org.apache.bookkeeper-bookkeeper-common-4.14.4.jar:4.14.4]
        at 
org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:26)
 ~[org.apache.bookkeeper-bookkeeper-common-4.14.4.jar:4.14.4]
        at 
java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
 ~[?:?]
        at 
java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883)
 ~[?:?]
        at 
java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251)
 ~[?:?]
        at 
org.apache.distributedlog.BKLogWriteHandler.asyncStartLogSegment(BKLogWriteHandler.java:530)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
org.apache.distributedlog.BKAbstractLogWriter.lambda$asyncStartNewLogSegment$1(BKAbstractLogWriter.java:379)
 ~[org.apache.distributedlog-distributedlog-core-4.14.4.jar:4.14.4]
        at 
java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
 [?:?]
        at 
java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) 
[?:?]
        at 
java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) 
[?:?]
        at 
org.apache.bookkeeper.common.concurrent.FutureUtils$ListFutureProcessor.run(FutureUtils.java:229)
 [org.apache.bookkeeper-bookkeeper-common-4.14.4.jar:4.14.4]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at 
com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
 [com.google.guava-guava-30.1-jre.jar:?]
        at 
com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
 [com.google.guava-guava-30.1-jre.jar:?]
        at 
com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
 [com.google.guava-guava-30.1-jre.jar:?]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
 [?:?]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
[?:?]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
[?:?]
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 [io.netty-netty-common-4.1.72.Final.jar:4.1.72.Final]
        at java.lang.Thread.run(Thread.java:829) [?:?]
   Caused by: org.apache.bookkeeper.client.BKException$ZKException: Error while 
using ZooKeeper
        at 
org.apache.bookkeeper.discover.ZKRegistrationClient.lambda$getChildren$4(ZKRegistrationClient.java:351)
 ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
        at 
org.apache.bookkeeper.zookeeper.ZooKeeperClient$25$1.processResult(ZooKeeperClient.java:1177)
 ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
        at 
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:678) 
~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
        at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:563) 
~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
   Caused by: org.apache.zookeeper.KeeperException$NoNodeException: 
KeeperErrorCode = NoNode for /available
        at 
org.apache.zookeeper.KeeperException.create(KeeperException.java:118) 
~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:54) 
~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
        at 
org.apache.bookkeeper.discover.ZKRegistrationClient.lambda$getChildren$4(ZKRegistrationClient.java:350)
 ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
        at 
org.apache.bookkeeper.zookeeper.ZooKeeperClient$25$1.processResult(ZooKeeperClient.java:1177)
 ~[org.apache.bookkeeper-bookkeeper-server-4.14.4.jar:4.14.4]
        at 
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:678) 
~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
        at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:563) 
~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
   ```
   
   ### Modifications
   * Pass the correct ledgersPath during the cluster metadata initialization
   
   ### Documentation
   
   - [x] `no-need-doc` 
   


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