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/02/08 18:51:10 UTC

[GitHub] [pulsar] fernandezpablo85 opened a new issue #6276: publish time non-monotonic on same partition

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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] jiazhai commented on issue #6276: publish time non-monotonic on same partition

Posted by GitBox <gi...@apache.org>.
jiazhai commented on issue #6276: publish time non-monotonic on same partition
URL: https://github.com/apache/pulsar/issues/6276#issuecomment-586069740
 
 
   @fangpengcheng95 Thanks for the report. Seems This is a issue producer in `pulsar-client-go`

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


With regards,
Apache Git Services

[GitHub] [pulsar] fernandezpablo85 commented on issue #6276: publish time non-monotonic on same partition

Posted by GitBox <gi...@apache.org>.
fernandezpablo85 commented on issue #6276: publish time non-monotonic on same partition
URL: https://github.com/apache/pulsar/issues/6276#issuecomment-586095406
 
 
   thanks @jiazhai , I'd be glad to contribute a patch if you give me a few pointers

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


With regards,
Apache Git Services

[GitHub] [pulsar] fernandezpablo85 commented on issue #6276: publish time non-monotonic on same partition

Posted by GitBox <gi...@apache.org>.
fernandezpablo85 commented on issue #6276: publish time non-monotonic on same partition
URL: https://github.com/apache/pulsar/issues/6276#issuecomment-583768819
 
 
   Note that this also fails when consuming from a single partition, by changing the topic to `$TOPIC_NAME-partition-0` for example

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


With regards,
Apache Git Services