You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/17 18:00:30 UTC

[GitHub] [pulsar] wmccarley opened a new issue #7584: PIP 68 Suggestions

wmccarley opened a new issue #7584:
URL: https://github.com/apache/pulsar/issues/7584


   Suggestions for modifications to PIP 68: Exclusive Producer by @merlimat 
   
   The purpose of these suggestions is to place more control on the system admin for what is/isn't allowed w.r.t exclusive producing system-wide and also to give the tenant admin some tools that could be used
   
   1. Only two ProducerAccessModes and separate  enum for *requested* behavior when exclusive produce ownership is contested
   
   ```java
   /**
    * The type of access to the topic that the producer requires.
    */
   public enum ProducerAccessMode {
       /**
        * By default multiple producers can publish on a topic.
        */
       Shared,
   
       /**
        * Requestexclusive access for producer.
        */
       Exclusive
   }
   
   /**
    *
    */
   public enum ProducerContentionBehavior {
   
      /**
       * Producer requests broker generate hard-error  when exclusive produce ownership of the topic cannot be immediately assumed
       */
      Fail,
   
      /**
       * Producer requests the broker enqueue this producer
       */
      Enqueue,
   
      /**
       * Producer requests that the broker forcibly terminate the existing producer's session and install this producer instead
       */
      Displace
   }
   
   ```
   
   2. Additional settings in broker.conf:
   ```properties
   # Default topic producer access mode
   defaultTopicProducerAccessMode=[shared|exclusive]
   
   # Whether exclusive producer queuing is allowed by default
   allowProducerQueuing=[true|false]
   
   # Maximum number of producers allowed to queue up for exclusive status
   maxProducerQueueLength=<some num>
   
   # Whether broker allows producers to forcibly displace one another by default
   allowExclusiveProducerDisplacement=[true|false]
   
   # Topics will be given a grace period during which they will be prevented from being shutdown when an admin has evicted all the producers of a topic
   producerEvictionTopicShutdownGracePeriodSeconds=<some num>
   ```
   
   3. Modify/Add Admin APIs to:
   
   - Add APIs to override the five broker.conf settings at the tenant/namespace/topic level
   ```bash
   $ pulsar-admin namespaces set-producer-policies tenant/namespace --exclusive --allowQueing --maxQueueLength 10 --disallowDisplacement --producerEvictionGracePeriod 60
   ```
   - Show current exclusive producer and producer queue in internal-info response
   
   - Add a call to evict all producers (could be used to 'trigger' a new leader election)
   ```bash
   pulsar-admin topics {persistent|non-persistent}://tenant/namespace/topic evict-all-producers
   ```
   
   - Add a call to evict specific producer (could be the current exclusive producer or one of the enqueued ones)
   ```bash
   pulsar-admin topics {persistent|non-persistent}://tenant/namespace/topic evict-producer --producerName xyz
   ```
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org