fernandezpablo85 opened a new issue #6276: publish time non-monotonic on same 
partition
URL: https://github.com/apache/pulsar/issues/6276
 
 
   **Describe the bug**
   Publish time is not monotonic on the same partition. 
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Publish events with a __single producer__ to a topic with many 
partitions, with any partition key.
   2. Run a consumer on `key_shared` mode, for example:
   
   ```python
   client = pulsar.Client(pulsar_url)
       consumer = client.subscribe(
           topic=pulsar_topic,
           subscription_name="any_name_you_want",
           consumer_name="any_name_you_want",
           consumer_type=ConsumerType.KeyShared,
           initial_position=InitialPosition.Earliest,
       )
   
       for i in itertools.count():
           msg = consumer.receive()
           ts = msg.publish_timestamp()
           p_id = msg.message_id().partition()
           lpt = latest_partition_timestamp[p_id]
           assert ts >= lpt, f"latest timestamp of partition {p_id} was {lpt} 
and new event has timestamp {ts}"
           latest_partition_timestamp[p_id] = ts
           consumer.acknowledge(msg)
   ```
   3. See assertion error
   
   **Expected behavior**
   No error should be raised since `publish_timestamp` on the same partition 
must be monotonically increasing.
   
   **Desktop (please complete the following information):**
    - OS: macOS 10.15.2
   
   **Additional context**
   - producer: https://github.com/apache/pulsar-client-go
   - consumer: https://pypi.org/project/pulsar-client/
   - partitions: 3
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to