You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/17 07:25:15 UTC

[GitHub] [pulsar] startjava created a discussion: how use exclusive implements leader election ??i want know more details??

GitHub user startjava created a discussion: how use exclusive implements leader election ??i want know more details??

@merlimat 

https://github.com/apache/pulsar/wiki/PIP-68%3A-Exclusive-Producer

There are several use cases that require exclusive access for a single writer, of which few examples are:
(1)Ensuring a linear non-interleaved history of messages
(2)Providing basic mechanism for leader election


how use exclusive implements leader election ??i want know more details??

thank you very much!

GitHub link: https://github.com/apache/pulsar/discussions/17703

----
This is an automatically sent email for dev@pulsar.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@pulsar.apache.org


[GitHub] [pulsar] merlimat added a comment to the discussion: how use exclusive implements leader election ??i want know more details??

Posted by GitBox <gi...@apache.org>.
GitHub user merlimat added a comment to the discussion: how use exclusive implements leader election ??i want know more details??

@startjava You can implement a "leader election" pattern using the "exclusive producer" feature. 

Basically, if a certain producer is able to become the "exclusive producer" on the topic, it will assume itself the role of "leader". It is important though that all the decisions taken by the leader to be communicated as messages published in the topic.

There are few options to chose from when creating the exclusive producer: 
 * `Exclusive`: Require exclusive access for producer. Gives error if there's already a producer
 * `ExclusiveWithFencing`: Acquire exclusive access for the producer. - Removes any existing producers
 * `Shared`: By default multiple producers can publish on a topic.
 * `WaitForExclusive`: Producer creation is pending until it can acquire exclusive access.

GitHub link: https://github.com/apache/pulsar/discussions/17703#discussioncomment-3669573

----
This is an automatically sent email for dev@pulsar.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@pulsar.apache.org


[GitHub] [pulsar] startjava added a comment to the discussion: how use exclusive implements leader election ??i want know more details??

Posted by GitBox <gi...@apache.org>.
GitHub user startjava added a comment to the discussion: how use exclusive implements leader election ??i want know more details??

about :
One example of concrete use case for this feature is in the Pulsar Functions metadata controller. In order to write a single linear history of all the functions metadata updates, it requires to elect 1 leader and that all the "decisions" made by this leader be written on the topic.

GitHub link: https://github.com/apache/pulsar/discussions/17703#discussioncomment-3667253

----
This is an automatically sent email for dev@pulsar.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@pulsar.apache.org