-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pulsar-client] Remove UUID generation on sending message #7705
Conversation
// Globally unique producer name | ||
/** | ||
* Globally unique producer name generated by server. It should be the same as {@link #producerName} unless user | ||
* configures {@link ProducerConfigurationData::setProducerName}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always be the same as producerName
. If the client overrides it, the server will use that name, but if a producer with same name is already connected, it will instead error it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed it but I don't think user_producer_id
+ sequence_id
can create UUID because user_producer_id
can be reused by other producer later on and sequence_id
can start with 0
again and it will create a duplicate combination which will not be unique across messages on the topic and that can be issue for message chunking.
eg:
Producer P1 gives name userProducer1
and publish message with sequenceId=0
. Now that process died and another process created producer with similar name userProducer1
and started message with sequenceId=0
in which case UUID will not be unique.
Therefore, using serverProducerName
always gives a guarantee for unique producer-id and UUID. Adding new string serverProducerId
will not create any overhead as well. So, can you please let me know your thought on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merlimat did you get chance to read my above comment before merging the PR?
* [pulsar-client] Remove UUID generation on sending message * fix prod name
* [pulsar-client] Remove UUID generation on sending message * fix prod name
* [pulsar-client] Remove UUID generation on sending message * fix prod name
* [pulsar-client] Remove UUID generation on sending message * fix prod name
* [pulsar-client] Remove UUID generation on sending message * fix prod name
Motivation
Pulsar client producer requires uuid while sending chunked messages. right now, Pulsar-client lib generates UUID for every send message which is expensive and impacts publish performance. Therefore, UUID generation shouldn't be expensive and producer should not generate uuid for non-chunked messages.
Modification
Note
This fix should be cherry-picked to 2.6.1 release as well.