Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make BookieId work with PulsarRegistrationDriver #17762

Merged
merged 3 commits into from
Sep 24, 2022

Conversation

eolivelli
Copy link
Contributor

Motivation

In Pulsar 2.10 the custom "BookieId" feature doesn't work anymore because in PulsarRegistrationDriver we are not implementing getBookieServiceInfo

Modifications

Implement getBookieServiceInfo

Verifying this change

This change added tests

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

Matching PR in forked repository

PR in forked repository:eolivelli#17

Copy link
Contributor

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eolivelli
Copy link
Contributor Author

We have a problem with this PR.
There is a deadlock, as we are doing a blocking call to the metadatastore inside the metadata store main thread.

I have seen this problem the first time we implemented getBookieServiceInfo in BookKeeper in the ZKRegistrationClient.

I am working on it

"metadata-store-5239-1" #14301 prio=5 os_prio=31 cpu=41.80ms elapsed=872.17s tid=0x00007fdd1df77800 nid=0x6630f waiting on condition  [0x0000700015c3c000]
   java.lang.Thread.State: WAITING (parking)
        at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
        - parking to wait for  <0x00000007d5868310> (a java.util.concurrent.CompletableFuture$Signaller)
        at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
        at java.util.concurrent.CompletableFuture$Signaller.block([email protected]/CompletableFuture.java:1796)
        at java.util.concurrent.ForkJoinPool.managedBlock([email protected]/ForkJoinPool.java:3128)
        at java.util.concurrent.CompletableFuture.waitingGet([email protected]/CompletableFuture.java:1823)
        at java.util.concurrent.CompletableFuture.get([email protected]/CompletableFuture.java:1998)
        at org.apache.bookkeeper.common.concurrent.FutureUtils.result(FutureUtils.java:72)
        at org.apache.bookkeeper.common.concurrent.FutureUtils.result(FutureUtils.java:61)
        at org.apache.bookkeeper.client.DefaultBookieAddressResolver.resolve(DefaultBookieAddressResolver.java:43)
        at org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.resolveNetworkLocation(TopologyAwareEnsemblePlacementPolicy.java:804)
        at org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.createBookieNode(TopologyAwareEnsemblePlacementPolicy.java:794)
        at org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.convertBookiesToNodes(TopologyAwareEnsemblePlacementPolicy.java:822)
        at org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.newEnsembleInternal(RackawareEnsemblePlacementPolicyImpl.java:390)
        at org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.newEnsemble(RackawareEnsemblePlacementPolicyImpl.java:356)
        at org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy.newEnsemble(RackawareEnsemblePlacementPolicy.java:104)
        at org.apache.pulsar.bookie.rackawareness.IsolatedBookieEnsemblePlacementPolicy.newEnsemble(IsolatedBookieEnsemblePlacementPolicy.java:131)
        at org.apache.bookkeeper.client.BookieWatcherImpl.newEnsemble(BookieWatcherImpl.java:270)
        at org.apache.bookkeeper.client.LedgerCreateOp.initiate(LedgerCreateOp.java:161)
        at org.apache.bookkeeper.client.BookKeeper.asyncCreateLedger(BookKeeper.java:860)
        at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.asyncCreateLedger(ManagedLedgerImpl.java:3809)
        at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.initializeBookKeeper(ManagedLedgerImpl.java:500)
        - locked <0x00000007d58685a0> (a org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl)
        at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.access$400(ManagedLedgerImpl.java:147)
        at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$1.operationComplete(ManagedLedgerImpl.java:434)
        at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$1.operationComplete(ManagedLedgerImpl.java:366)
        at org.apache.bookkeeper.mledger.impl.MetaStoreImpl.lambda$getManagedLedgerInfo$1(MetaStoreImpl.java:127)
        at org.apache.bookkeeper.mledger.impl.MetaStoreImpl$$Lambda$842/0x0000000800928c40.accept(Unknown Source)
        at java.util.concurrent.CompletableFuture$UniAccept.tryFire([email protected]/CompletableFuture.java:714)
        at java.util.concurrent.CompletableFuture.postComplete([email protected]/CompletableFuture.java:506)
        at java.util.concurrent.CompletableFuture.complete([email protected]/CompletableFuture.java:2073)
        at org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$internalStorePut$12(ZKMetadataStore.java:369)
        at org.apache.pulsar.metadata.impl.ZKMetadataStore$$Lambda$288/0x0000000800512040.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call([email protected]/Executors.java:515)
        at java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run([email protected]/ScheduledThreadPoolExecutor.java:304)
        at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run([email protected]/Thread.java:829)

@eolivelli
Copy link
Contributor Author

I have switched to MetadataCache and now it works like a charm
cc @merlimat

@eolivelli
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@eolivelli eolivelli merged commit 8d7ac33 into apache:master Sep 24, 2022
Jason918 pushed a commit that referenced this pull request Sep 25, 2022
* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle

(cherry picked from commit 8d7ac33)
@Jason918
Copy link
Contributor

This PR depends on #17620, or else CI fails because of deadlock on zk callback thread. See https://github.com/Jason918/pulsar/actions/runs/3120819833/jobs/5061697358#step:8:5003

Technoboy- pushed a commit that referenced this pull request Sep 26, 2022
* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle
@mattisonchao
Copy link
Member

Related issue: #17759

eolivelli added a commit to eolivelli/pulsar that referenced this pull request Oct 3, 2022
eolivelli added a commit that referenced this pull request Oct 4, 2022
eolivelli added a commit that referenced this pull request Oct 4, 2022
eolivelli added a commit that referenced this pull request Oct 4, 2022
eolivelli added a commit to eolivelli/pulsar that referenced this pull request Oct 4, 2022
* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle
eolivelli added a commit to eolivelli/pulsar that referenced this pull request Oct 5, 2022
* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle
eolivelli added a commit that referenced this pull request Oct 15, 2022
* Make BookieId work with PulsarRegistrationDriver (#17762)

* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle

* Do not execute lookup on MetadataCache in the getBookieServiceInfo caller thread
@Technoboy- Technoboy- modified the milestones: 2.11.0, 2.12.0 Nov 15, 2022
liangyepianzhou pushed a commit that referenced this pull request Dec 13, 2022
* Make BookieId work with PulsarRegistrationDriver (#17762)

* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle

* Do not execute lookup on MetadataCache in the getBookieServiceInfo caller thread

(cherry picked from commit 09f5eeb)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
…e#17922)

* Make BookieId work with PulsarRegistrationDriver (apache#17762)

* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle

* Do not execute lookup on MetadataCache in the getBookieServiceInfo caller thread

(cherry picked from commit 09f5eeb)
(cherry picked from commit e3eb026)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
…e#17922)

* Make BookieId work with PulsarRegistrationDriver (apache#17762)

* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle

* Do not execute lookup on MetadataCache in the getBookieServiceInfo caller thread

(cherry picked from commit 09f5eeb)
(cherry picked from commit e3eb026)
Technoboy- pushed a commit that referenced this pull request Feb 8, 2023
* Make BookieId work with PulsarRegistrationDriver (#17762)

* Make BookieId work with PulsarRegistrationDriver

* Switch to MetadataCache

* checkstyle

* Do not execute lookup on MetadataCache in the getBookieServiceInfo caller thread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants