GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Broker] Replicator producer should have blockIfQueueFull=true by lhotari · Pull Request #15724 · apache/pulsar

Conversation

@lhotari

@lhotari lhotari commented May 23, 2022

Copy link
Copy Markdown
Member

Motivation

In #15691, an exception is seen which isn't properly handled.

2022-05-19T18:35:09,916+0000 [BookKeeperClientWorker-OrderedExecutor-3-0] ERROR org.apache.pulsar.broker.service.persistent.PersistentReplicator - [persistent://tenant/namespace/perftest-partition-33][pulsar-cluster-src -> pulsar-cluster-dst] Error producing on remote broker
org.apache.pulsar.client.api.PulsarClientException$MemoryBufferIsFullError: Client memory buffer is full
	at org.apache.pulsar.client.impl.ProducerImpl.canEnqueueRequest(ProducerImpl.java:849) ~[com.datastax.oss-pulsar-client-original-2.10.0.3.jar:2.10.0.3]
	at org.apache.pulsar.client.impl.ProducerImpl.sendAsync(ProducerImpl.java:429) ~[com.datastax.oss-pulsar-client-original-2.10.0.3.jar:2.10.0.3]
	at org.apache.pulsar.broker.service.persistent.PersistentReplicator.lambda$readEntriesComplete$2(PersistentReplicator.java:369) ~[com.datastax.oss-pulsar-broker-2.10.0.3.jar:2.10.0.3]
	at java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753) ~[?:?]
	at java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731) ~[?:?]
	at java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2108) ~[?:?]
	at org.apache.pulsar.broker.service.persistent.PersistentReplicator.readEntriesComplete(PersistentReplicator.java:367) ~[com.datastax.oss-pulsar-broker-2.10.0.3.jar:2.10.0.3]
	at org.apache.bookkeeper.mledger.impl.OpReadEntry.lambda$checkReadCompletion$2(OpReadEntry.java:156) ~[com.datastax.oss-managed-ledger-2.10.0.3.jar:2.10.0.3]
	at org.apache.bookkeeper.mledger.util.SafeRun$1.safeRun(SafeRun.java:32) [com.datastax.oss-managed-ledger-2.10.0.3.jar:2.10.0.3]
	at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [com.datastax.oss-bookkeeper-common-4.14.5.1.0.0.jar:4.14.5.1.0.0]
	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.76.Final.jar:4.1.76.Final]
	at java.lang.Thread.run(Thread.java:829) [?:?]

The reason for this is the memory limit controller which is enabled by default. PR #15723 addresses that and makes it configurable and disables the memory limit for replication clients by default. Besides this, the blockIfQueueFull=true setting should be used in the replicator producer.

  • prevents exceptions when sending gets backpressured by memory limit (or queue size limit)

Modifications

  • set blockIfQueueFull=true for replicator producer

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lhotari
[Broker] Replicator producer should have blockIfQueueFull=true
1a5e604
- prevents exceptions when sending gets backpressured by
  memory limit
@lhotari lhotari added type/bug The PR fixed a bug or issue reported a bug area/broker area/geo-replication doc-not-needed Your PR changes do not impact docs labels May 23, 2022
@lhotari lhotari added this to the 2.11.0 milestone May 23, 2022
@lhotari
lhotari requested review from codelipenghui, eolivelli, merlimat and michaeljmarshall May 23, 2022 17:37
@lhotari lhotari self-assigned this May 23, 2022
@lhotari lhotari mentioned this pull request May 23, 2022
[Broker] Disable memory limit controller for broker client and replication clients #15723
Merged
merlimat
merlimat requested changes May 23, 2022
View reviewed changes
Comment thread pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractReplicator.java
.enableBatching(false)
.sendTimeout(0, TimeUnit.SECONDS) //
.maxPendingMessages(producerQueueSize) //
.blockIfQueueFull(true)

@merlimat merlimat May 23, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This would mean blocking the IO threads (or other shared threads) in the broker causing a deadlock

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mattisonchao reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@merlimat merlimat May 23, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We need to find a better solution to have a broker-wide flow control mechanism for replicators that can be tied to the client memory limit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lhotari lhotari May 23, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for reviewing @merlimat . Yes, blocking would be problematic in this case.

Would you mind also reviewing #15723 since the memory limit is currently causing regressions in geo-replication in 2.10 .

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lhotari
lhotari marked this pull request as draft May 23, 2022 17:44
@lhotari lhotari closed this May 24, 2022
@rogueVpedro rogueVpedro mentioned this pull request Aug 31, 2022
[Bug] How to solve or optimize this problem [Client memory buffer is full] #17360
Open
2 tasks done
@sijie sijie mentioned this pull request Aug 31, 2022
ISSUE-17360: [Bug] How to solve or optimize this problem [Client memory buffer is full] streamnative/pulsar-archived#4800
Open
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merlimat merlimat merlimat requested changes
@eolivelli eolivelli Awaiting requested review from eolivelli
@codelipenghui codelipenghui Awaiting requested review from codelipenghui
@michaeljmarshall michaeljmarshall Awaiting requested review from michaeljmarshall

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@lhotari lhotari

Labels

area/broker area/geo-replication doc-not-needed Your PR changes do not impact docs type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Milestone

2.11.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@lhotari @merlimat
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.