Open tabVersion opened 1 month ago
Thanks for providing the context. Now I can understand #18873 better.
And I had also thought about this for Kafka (rely on consumer group, and use manual commit), and yes the largest drawback seems to be exactly-once
-> at-least-once
.
(But there seem to be no many benefits for Kafka to do the change.)
(And I'm not sure whether group rebalancing causes duplication, but was more thinking that failover will cause duplication. i.e., crash after checkpoint, but before ack)
But I found there's a "partitioning" mechanism in NATS https://docs.nats.io/nats-concepts/subject_mapping (not delved into the details), which makes me think whether NATS's parallelism mechanism is like Pulsar.
Their diagram tells the story. Subject Mapping does things inside broker, you can dynamically route messages into different subjects. RW, on the consumer side, does not need to care much about it. The consumer just needs to know which subject to consume, no matter foo
or foo.*
.
which makes me think whether NATS's parallelism mechanism is like Pulsar
Yes, I have the same feeling. But Pulsar offers API to list sub-partitions, giving us a way to consume in Kafka's way.
(But there seem to be no many benefits for Kafka to do the change.)
Yes, I am just proposing changes just to Nats JetStream (maybe Pubsub later).
(And I'm not sure whether group rebalancing causes duplication, but was more thinking that failover will cause duplication. i.e., crash after checkpoint, but before ack)
Kafka pauses the consumption during rebalancing. It is not designed for rapidly changing parallelism.
I am still confuse about one point:
The broker will dispatch messages across workers without a guarantee of the distribution.
If we have several works A,B,C to read message from one broker in the future. Then B batch ACK the message and A C crashed. When A and C recovery, what message they will get from Nats Jetstream?
I am still confuse about one point:
The broker will dispatch messages across workers without a guarantee of the distribution.
If we have several works A,B,C to read message from one broker in the future. Then B batch ACK the message and A C crashed. When A and C recovery, what message they will get from Nats Jetstream?
B just acks messages sent to B, it does not involves messages sent to A and C. The broker records each message sent to which consumer. After A and C recovery, the broker sends the un-acked messages waiting in the queue. It does not guarantee there is no overlap in A's, B's, and C's messages.
Current Impl
Our primary goal is to enable multiple workers to consume a single subject (the smallest unit in NATS) or a group of subjects (described using wildcards).
Challenges and Solutions
Drawback
exactly-once
toat-least-once
.TODO List
durable name
parameter) https://github.com/risingwavelabs/risingwave/pull/18895scale controller
andsource manager
on meta, to get the real-time fragment parallelism. https://github.com/risingwavelabs/risingwave/pull/19529