-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
lifecycle/staletype/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug
Description
Describe the bug
Publish time is not monotonic on the same partition.
To Reproduce
Steps to reproduce the behavior:
- Publish events with a single producer to a topic with many partitions, with any partition key.
- Run a consumer on
key_sharedmode, for example:
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)- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lifecycle/staletype/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug