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

Improved logic for pausing replicated subscription snapshots when no traffic #11922

Merged
merged 5 commits into from
Sep 16, 2021

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Sep 3, 2021

Motivation

In #10292, we've added logic to pause the creation of new replicated subscription snapshots when there is no traffic.

Here, I'm changing it to a different approach to avoid a potential issue and to simplify the logic.

Comparing the last message id, we had to use stop taking a snapshot when there are no connected producer, in order to create a "quiet period" and check if the last message id didn't change.

What can happen is that if producers disconnect, we might not create the last snapshot (at least until new producers will get connected).

Modifications

Instead of checking producers and last message id, let's make sure that the last snapshot was initiated after the last "data" message was published. With "data" message here meaning any non-marker message.

@merlimat merlimat added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages release/2.8.2 labels Sep 3, 2021
@merlimat merlimat added this to the 2.9.0 milestone Sep 3, 2021
@merlimat merlimat self-assigned this Sep 3, 2021
Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

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

LGTM

@merlimat merlimat merged commit ab23eae into apache:master Sep 16, 2021
@merlimat merlimat deleted the enhance-replicated-subscriptions branch September 16, 2021 15:28
merlimat added a commit that referenced this pull request Sep 16, 2021
…traffic (#11922)

* Improved logic for pausing replicated subscription snapshots when no traffic

* Removed unused import

* Fixed flaky test ReplicatorTest.testRemoveClusterFromNamespace

* Fixed cast that was not available in tests
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Sep 18, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…traffic (apache#11922)

* Improved logic for pausing replicated subscription snapshots when no traffic

* Removed unused import

* Fixed flaky test ReplicatorTest.testRemoveClusterFromNamespace

* Fixed cast that was not available in tests
eolivelli pushed a commit to datastax/pulsar that referenced this pull request Apr 7, 2022
…traffic (apache#11922)

* Improved logic for pausing replicated subscription snapshots when no traffic

* Removed unused import

* Fixed flaky test ReplicatorTest.testRemoveClusterFromNamespace

* Fixed cast that was not available in tests

(cherry picked from commit 28a223c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.8 Archived: 2.8 is end of life release/2.8.2 release/2.9.0 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants