-
Notifications
You must be signed in to change notification settings - Fork 576
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
feat(source): use fragment id only as Kafka consumer group id #16111
Conversation
@@ -162,7 +162,6 @@ pub struct SourceEnumeratorInfo { | |||
pub struct SourceContext { | |||
pub actor_id: u32, | |||
pub source_id: TableId, | |||
// There should be a 1-1 mapping between `source_id` & `fragment_id` |
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 think this is wrong. 1 source_id
can correspond to multiple MV's SourceExecutor
s, and thus multiple fragment_id
s
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.
LGTM as long as it can work
can we do a test about the behavior? I think we no longer need to migrate to low level API as long as it can work. For example, have three consumers on 4 partitions in a topic. Then shut down one of the consumers to see if the other two work as expected (split assignment not changed). & what's the behavior in shared source? |
Testing for sure (I'm quite frustrated that we don't have any existing serious tests about partitioned topics & split changes :( But I don't understand the scenario you proposed here. By "consumer" do you mean RisingWave or just Kafka consumers? Do they have the same group id? I've manually tested like this (outside risingwave): 5 partition topic
All behavior is the same as before. This PR doesn't not change behavior in RisingWave. The behavior is according to how partitions are assigned to actors (by source manager). Group ID has nothing to do with the actual assignment. |
Signed-off-by: xxchan <xxchan22f@gmail.com>
test updated @tabVersion |
now we have split change tests in CI. Split migration can also change consumer group id in prev impl so can we also cover this? cc @shanicky Can you help design the tests? |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
We use
assign
to manually assign topics and partitions to Kafka consumers, instead ofsubscribe
. In this case, consumer group related features are not used at all.risingwave/src/connector/src/source/kafka/source/reader.rs
Line 115 in 65440fb
assign
ed to the same partitions, they can both consume 1 copy of data without conflict. They work independently.For more details explaining stuff, check this doc: https://www.notion.so/risingwave-labs/Notes-on-Kafka-Consumer-Consumer-Group-6bafdbab58b34ad7917fe47645f9a862
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.