mq_sink: unexpected behavior of max-message-bytes
#2962
Labels
affects-4.0
affects-5.0
affects-5.1
affects-5.2
affects-5.3
area/ticdc
Issues or PRs related to TiCDC.
bug-from-user
Bugs found by users.
severity/major
type/bug
The issue is confirmed as a bug.
What did you do?
Assume the Kafka broker has 1M as
message.max.bytes
. I use TiCDC with Kafka sink and Open Protocol, where I setmax-message-bytes=10K
.What did you expect to see?
If there is no row whose serialized size is more than 1M then everything works normally. If there is, I would need a detailed error message helping me identify the problematic row (and table).
The expected behavior is that: as long as CDC has
max-message-bytes <= 1M
and there is no row larger than1M
, everything should work.What did you see instead?
Any message larger than 10K fails to be delivered.
The root cause is that (1)
max-message-bytes
is used both as an advisory to the Open Protocol encoder AND as a hard-limit for the kafka producer (sarama) (2) we have failed to take into account the producer overhead by the kafka client.Problematic Scenarios
a.
|<------ CDC's limit = Broker's Limit = 10M ----->|<-overflow->|
| row A = 5M | row B = 4M | row C = 1000K| overhead = 100K|
The batch should have been reduced, but was not.
b.
|<--------------------------- Broker's Limit = 10M ------------------------>|
|<---- CDC's Limit = 5M --->|<--overflow-->|
|<------------- row A = 6M ----------------------->|<--still space here->|
The message should have been sent, but was not.
Versions of the cluster
v5.0.1
The text was updated successfully, but these errors were encountered: