Skip to content

Commit

Permalink
Expanding on leader election scheme using WaitForExclusive to avoid c…
Browse files Browse the repository at this point in the history
…onfusing with other leader election system patterns like with ZK or etcD. (apache#15547)
  • Loading branch information
asafm authored May 11, 2022
1 parent 1757c1b commit c5cde70
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions site2/docs/concepts-messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Producers send messages to brokers synchronously (sync) or asynchronously (async

You can have different types of access modes on topics for producers.

|Access mode | Description
|---|---
`Shared`|Multiple producers can publish on a topic. <br><br>This is the **default** setting.
`Exclusive`|Only one producer can publish on a topic. <br><br>If there is already a producer connected, other producers trying to publish on this topic get errors immediately.<br><br>The “old” producer is evicted and a “new” producer is selected to be the next exclusive producer if the “old” producer experiences a network partition with the broker.
`WaitForExclusive`|If there is already a producer connected, the producer creation is pending (rather than timing out) until the producer gets the `Exclusive` access.<br><br>The producer that succeeds in becoming the exclusive one is treated as the leader. Consequently, if you want to implement the leader election scheme for your application, you can use this access mode.
| Access mode | Description |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Shared` | Multiple producers can publish on a topic. <br><br>This is the **default** setting. |
| `Exclusive` | Only one producer can publish on a topic. <br><br>If there is already a producer connected, other producers trying to publish on this topic get errors immediately.<br><br>The “old” producer is evicted and a “new” producer is selected to be the next exclusive producer if the “old” producer experiences a network partition with the broker. |
| `WaitForExclusive` | If there is already a producer connected, the producer creation is pending (rather than timing out) until the producer gets the `Exclusive` access.<br><br>The producer that succeeds in becoming the exclusive one is treated as the leader. Consequently, if you want to implement a leader election scheme for your application, you can use this access mode. Note that the leader pattern scheme mentioned refers to using Pulsar as a Write-Ahead Log (WAL) which means the leader writes its "decisions" to the topic. On error cases, the leader will get notified it is no longer the leader *only* when it tries to write a message and fails on appropriate error, by the broker. |

> **Note**
>
Expand Down

0 comments on commit c5cde70

Please sign in to comment.