Skip to content

Conversation

@nkurihar
Copy link
Contributor

Motivation

This closes #199

Modifications

When the replication producer catches an exception,
rewind cursor and continue readMoreEntries (if possible) rather than return immediately.

An unit test for simulating #199 is also added.

Result

Replicator will continue to replicate even when producer exception.

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Feb 17, 2017
@merlimat merlimat added this to the 1.17 milestone Feb 17, 2017
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we setup the test this way? If you want, you can create another test.

  1. limit quota to 1 message
  2. Publish 10 messages
  3. verify receive times out after first message is received(since quota is full)
  4. Increase quota to 10
  5. Verify we receive the remaining 9 messages.

Copy link
Contributor Author

@nkurihar nkurihar Feb 17, 2017

Choose a reason for hiding this comment

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

@saandrews
I modified the test a little:

  1. limit quota to 1
  2. Publish 1 message and wait for reflecting backlog limitation ※
  3. Publish 9 messages and verify they will be pended

※ If I produce 10 messages at once in interval of reflecting backlog limitation, they will be sended

Copy link
Contributor

Choose a reason for hiding this comment

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

@merlimat Do you see any side effect if we rewind it for every exception. All failed pending messages would reach here and invoke rewind.

Copy link
Contributor

Choose a reason for hiding this comment

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

Rewind is a cheap operation, it just resets the readPosition to markDeletePosition + 1

Copy link
Contributor

@rdhabalia rdhabalia left a comment

Choose a reason for hiding this comment

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

👍

@merlimat merlimat merged commit 6fd212a into apache:master Feb 17, 2017
rdhabalia pushed a commit that referenced this pull request Feb 24, 2017
* Fix #199: Do not stop to replicate when producer throws exception

* Fix log messages

* testReplicatorProducerClosing shoud be executed at last since it closes pulsar2/pulsar3

* Add unit test for replication resumption on backlog exceeded
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
fixes apache#220

 if using `computeIfAbsent `, `consumerManagerFuture.complete(null)` will store in `consumerTopicManagers`, and `getTopicConsumerManager ` will always get future null cache for key which should getTopic again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replicator does not resume once paused, due to backlog quota

4 participants