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

PIP-161 Exclusive Producer: ability to fence out an existing Producer (ExclusiveWithFencing mode) #15488

Merged
merged 8 commits into from
May 20, 2022

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented May 7, 2022

Motivation

Currently (in 2.10) we have two ways of creating a Exclusive Producer: Exclusive and WaitForExclusive.
We are missing a mode in which the new Producer fences out any existing producer, allowing to apply Optimistic Locking pattern.

Linked PIP: #15528

Modifications

  • Add a new mode ExclusiveWithFencing
  • Add tests
  • Implementation on the Broker side
  • Implementation on the Java Client

Verifying this change

This change added tests.

@eolivelli eolivelli added type/feature The PR added a new feature or issue requested a new feature area/broker component/client-java labels May 7, 2022
@eolivelli eolivelli added this to the 2.11.0 milestone May 7, 2022
@eolivelli eolivelli requested a review from merlimat May 7, 2022 14:30
@eolivelli eolivelli self-assigned this May 7, 2022
@github-actions
Copy link

github-actions bot commented May 7, 2022

@eolivelli:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@eolivelli eolivelli marked this pull request as ready for review May 7, 2022 14:31
@merlimat merlimat added doc-required Your PR changes impact docs and you will update later. and removed doc-label-missing labels May 7, 2022
@mattisonchao
Copy link
Member

It changed the protocol and public API, I'm not sure if we need a proposal for it.

@Anonymitaet
Copy link
Member

@momo-jun a soft reminder: here is a PR w/ doc-required label, could u pls follow up? Thanks

@eolivelli eolivelli added doc-not-needed Your PR changes do not impact docs and removed doc-required Your PR changes impact docs and you will update later. labels May 9, 2022
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.

👍

I don't like ExclusiveWithFencing too much though I cannot come up with a better suggestion.

For the "doc-required" label, it's needed to remember updating the docs. eg: https://pulsar.apache.org/docs/en/concepts-messaging/#access-mode

Finally, as @mattisonchao mentioned, this is touching public API so it would be good to have a PIP discussion and vote.

@merlimat merlimat added doc-required Your PR changes impact docs and you will update later. and removed doc-not-needed Your PR changes do not impact docs labels May 10, 2022
@momo-jun
Copy link
Contributor

@eolivelli I can add docs for this PR as soon as it is approved/merged. If you'd like to do it, feel free to ping me for review. Either way works for me.

@eolivelli eolivelli force-pushed the impl/exclusive-producer-fence branch from 83c14f0 to 42808ea Compare May 10, 2022 12:43
@eolivelli
Copy link
Contributor Author

For the "doc-required" label, it's needed to remember updating the docs. eg: https://pulsar.apache.org/docs/en/concepts-messaging/#access-mode

I have updated that section, thanks for the reminder.

@eolivelli eolivelli changed the title [enh] Exclusive Producer: ability to fence out an existing Producer (ExclusiveWithFencing mode) PIP-157 Exclusive Producer: ability to fence out an existing Producer (ExclusiveWithFencing mode) May 10, 2022
@eolivelli eolivelli changed the title PIP-157 Exclusive Producer: ability to fence out an existing Producer (ExclusiveWithFencing mode) PIP-161 Exclusive Producer: ability to fence out an existing Producer (ExclusiveWithFencing mode) May 10, 2022
@Anonymitaet Anonymitaet added doc-complete Your PR changes impact docs and the related docs have been already added. and removed doc-required Your PR changes impact docs and you will update later. labels May 11, 2022
Co-authored-by: Anonymitaet <50226895+Anonymitaet@users.noreply.github.com>
@eolivelli
Copy link
Contributor Author

thank you @Anonymitaet. I have committed your suggestion

@eolivelli
Copy link
Contributor Author

eolivelli commented May 18, 2022

@merlimat @mattisonchao @Anonymitaet please take another look

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

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

/pulsarbot rerun-failure-checks

@eolivelli
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

2 similar comments
@eolivelli
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@eolivelli
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@eolivelli eolivelli merged commit bde3972 into apache:master May 20, 2022
@eolivelli eolivelli deleted the impl/exclusive-producer-fence branch May 20, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker doc-complete Your PR changes impact docs and the related docs have been already added. type/feature The PR added a new feature or issue requested a new feature type/PIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants