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

Added redpanda.virtual.cluster.id topic property #16714

Merged

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Feb 26, 2024

Added redpanda.virtual.cluster.id topic property which affiliates the topic with virtual cluster. The property is only settable during topic creation and can not be modified.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x
  • v23.1.x

Release Notes

  • none

@mmaslankaprv mmaslankaprv marked this pull request as ready for review February 27, 2024 11:34
@mmaslankaprv mmaslankaprv marked this pull request as draft February 27, 2024 11:55
@mmaslankaprv mmaslankaprv force-pushed the v-cluster-id-topic-property branch 2 times, most recently from 081d4d1 to f93278e Compare February 29, 2024 07:57
@mmaslankaprv
Copy link
Member Author

/dt

@mmaslankaprv
Copy link
Member Author

/dt

@redpanda-data redpanda-data deleted a comment from vbotbuildovich Mar 1, 2024
Copy link
Contributor

@bharathv bharathv left a comment

Choose a reason for hiding this comment

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

lgtm, couple of nits.. not too familiar with the topic_manifest related changes, so someone else should take a look too.

, enable_mpx_extensions(
*this,
"enable_mpx_extensions",
"Enable Redpanda extensions for MPX.",
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: a bit more verbose description


static bool is_valid(const creatable_topic& c) {
if (!config::shard_local_cfg().enable_mpx_extensions()) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should this not be

return config_entries.find(topic_property_mpx_virtual_cluster_id) == config_entries.end();

or at least check for validity of property that it conforms to vcluster_id type (like in L326), otherwise I think there is a scope to sneak in garbage for this field.

Copy link
Member Author

Choose a reason for hiding this comment

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

if the extensions are not enabled the field is ignored, so we do not need to validate it, there is no risk of storing garbage as the property value. I did it like this as when unknown property is sent to create topics request it is silently ignored. This way the logic in validator is consistent with what we already have.

`vcluster_id` type is going to have limited scope. We are going to need
it in the cloud storage module, hence moving the type to `model`
submodule.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
Added topic property that is a label used to provide an information
about topic virtual cluster affiliation.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
graphcareful
graphcareful previously approved these changes Mar 6, 2024
Copy link
Contributor

@graphcareful graphcareful left a comment

Choose a reason for hiding this comment

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

LGTM seems pretty complete !

Copy link
Contributor

@michael-redpanda michael-redpanda left a comment

Choose a reason for hiding this comment

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

looks good! just some suggestions

src/v/compat/cluster_compat.h Outdated Show resolved Hide resolved
src/v/compat/cluster_compat.h Outdated Show resolved Hide resolved
src/v/compat/cluster_json.h Outdated Show resolved Hide resolved
src/v/compat/cluster_json.h Outdated Show resolved Hide resolved
Added property marking topic virtual cluster affiliation. The virtual
cluster property is different than other topic properties as it has no
default. By default it is an empty optional.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
@mmaslankaprv mmaslankaprv merged commit 7dba0b9 into redpanda-data:dev Mar 7, 2024
17 checks passed
@mmaslankaprv mmaslankaprv deleted the v-cluster-id-topic-property branch March 7, 2024 18:16
@andrwng andrwng mentioned this pull request Mar 28, 2024
6 tasks
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.

None yet

5 participants