-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
On batch-msg dispatching: broker should disconnect consumer which doesn't support batch-message #215
Conversation
…sn't support batch-message
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.
The only issue I see is that, the consumer will keep reconnecting in a loop without backoff.
The backoff time in reconnection is reset every time a producer/consumer is successful in re-establishing itself to the broker.
…doesn't support batch-message
That is correct. But we are targeting clients which are using old version so, we have to prevent at broker side. To address reconnection, I modified change:
This will prevent reconnection, logs message at broker and consumer will not receive any further messages. Any thought? |
Sound good to me. Another option I was thinking of would to mark the topic as a "topic that a some point got batched messages" and prevent consumer to subscribe again. That way the back off would kick in |
Yes, that is also a good option and at least in that way, client will receive an error and consumer would know what's going on. However, there are few complications to implement it and not sure if it's worth to introduce it to solve a problem which may touch very small no of clients for now.
Do you think we should still go with this approach? |
@merlimat I think I misunderstood your previous comment. I have updated the change. Can you please take a look of it. I have introduced new error-code UnsupporteVersion in case if one introduces new client without inital support of batch-msg, can also handle the error gracefully. |
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.
Looks good
int permitsToReduce = 0; | ||
Iterator<Entry> iter = entries.iterator(); | ||
boolean unsupportedVersion = false; |
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.
What about :
boolean clientSupportBatchMessages = cnx.isBatchMessageCompatibleVersion();
@@ -77,6 +77,7 @@ enum ServerError { | |||
ProducerBlockedQuotaExceededError = 7; // Unable to create producer because backlog quota exceeded | |||
ProducerBlockedQuotaExceededException = 8; // Exception while creating producer because quota exceeded | |||
ChecksumError = 9; // Error while verifying message checksum | |||
UnsupportedVersionError = 10; // Error when broker/client doesn't support requested feature |
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.
.. when an older client/version doesn't support a required feature
71fd6e2
to
8f3c296
Compare
8f3c296
to
96ecc9a
Compare
updated the changes. |
…sn't support batch-message (#215) * On batch-msg dispatching: broker should disconnect consumer which doesn't support batch-message * Close consumer at broker-side without closing connection if consumer doesn't support batch-message * Fail unsupportedBatchVersion-subscriber if topic has served batch-message
Fix data race when accessing partition producer state
Motivation
Broker should verify consumer's version before dispatching
batch-messages
to the consumer. Right now, broker dispatches the batch-messages to consumer regardless consumer support it and it causes failure while client-consumer consumes the batch-message if consumer doesn't support batch-message feature.Modifications
Disconnect the consumer while dispatching
batch-message
if consumer doesn't support batch-message.Result
Broker will not dispatch batch-message if consumer doesn't support it.