Skip to content
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: allow customize pulsar subscription name #18379

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

tabVersion
Copy link
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

resolve #18377

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

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.

Signed-off-by: tabVersion <[email protected]>
.subscription_name_prefix
.unwrap_or(PULSAR_DEFAULT_SUBSCRIPTION_PREFIX.to_string()),
source_ctx.fragment_id,
source_ctx.actor_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is actor_id needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use exclusive subscription here, which mean a partition can only be consumed by one subscription. So actor-id is essential to avoid collision.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 pulsar split corresponds to 1 topic. In one source (i.e., one fragment), each actor will be assigned to different topics. So actor_id is not necessary. There's no collision.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 pulsar split corresponds to 1 topic. In one source (i.e., one fragment), each actor will be assigned to different topics.

I dont get the logic

Copy link
Member

@xxchan xxchan Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assignment looks like this. Where's the collision? Correct me if I'm wrong

  • fragment 6 (topic t)
    • actor 1001 - topic t-partition-1, subscription rw-consumer-6
    • actor 1002 - topic t-partition-2, subscription rw-consumer-6
    • actor 1003 - topic t-partition-3, subscription rw-consumer-6
    • ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid things not work in this way

The exclusive type is a subscription type that only allows a single consumer to attach to the subscription. If multiple consumers subscribe to a topic using the same subscription, an error occurs. Note that if the topic is partitioned, all partitions will be consumed by the single consumer allowed to be connected to the subscription. source

We cannot attach multiple consumers to one subscription in exclusive mode. Since we want to manage the data parallelism, ie. partitions, in RisingWave, we have to separate the consumers from each parallelism into different subscriptions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe each subscription belongs to a different (sub)topic... They are not "one subscription"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the example above, rw-consumer-6 are 3 different subscriptions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already separated the consumers by subscribing to different sub topics. It's not by separate them into different subscriptions..

Signed-off-by: tabVersion <[email protected]>
@tabVersion tabVersion requested a review from xxchan September 9, 2024 09:53
@tabVersion tabVersion added this pull request to the merge queue Sep 11, 2024
Merged via the queue into main with commit 23410f0 Sep 11, 2024
31 of 32 checks passed
@tabVersion tabVersion deleted the tab/pulsar-custom-prefix branch September 11, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

specify a prefix in the pulsar subscription name to avoid collisions
2 participants