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: support default pg meta store #80

Merged
merged 8 commits into from
Jan 18, 2025
Merged

Conversation

cloudcarver
Copy link
Contributor

@cloudcarver cloudcarver commented Jan 15, 2025

Allow tf plugin to function correctly when etcd_meta_store is not set.

Currently, the pg meta store is not exposed in tf config, we let the cloud to provision the default pg meta store.

Acceptance test is passed.

@cloudcarver cloudcarver requested a review from wjf3121 January 15, 2025 05:42
@wjf3121 wjf3121 requested a review from Gogomoe January 15, 2025 06:13
Gogomoe
Gogomoe previously approved these changes Jan 15, 2025
Copy link

@Gogomoe Gogomoe left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +398 to +400
specObj := map[string]attr.Value{
"risingwave_config": types.StringValue(cluster.RwConfig),
"compute": types.ObjectValueMust(
Copy link

Choose a reason for hiding this comment

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

we will support scale between standalone/distributed soonly https://github.com/risingwavelabs/risingwave-cloud/pull/9653

Should we also add standalone here?

Copy link
Contributor

@wjf3121 wjf3121 Jan 15, 2025

Choose a reason for hiding this comment

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

For an existing cluster resource with etcd spec specified, I'm wondering what the behavior will be when user change the version to v2.1+:

During upgrade, we will migrate their metastore from etcd to pg. Next time the provider call GET api, will the provider see a diff as etcd is still specified in the tf config?

Looking at func metaStoreEqual, seems that it will? How will the provider handle this diff?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This case is covered.

Copy link
Contributor

@wjf3121 wjf3121 Jan 16, 2025

Choose a reason for hiding this comment

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

Discussed offline, confirmed that it will generate a diff and the apply will fail.

Suggest we add some instructions to ask users to remove the etcd_meta_store field in the error message/documentation.

Copy link
Contributor

@wjf3121 wjf3121 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! I only have 2 comments about documentation/error message.

@@ -233,7 +219,7 @@ Required:

Optional:

- `etcd_meta_store` (Attributes) (see [below for nested schema](#nestedatt--spec--meta--etcd_meta_store))
- `etcd_meta_store` (Attributes) The etcd meta store is no longer supported in new RisingWave versions, this field is kept for compatibility, please migrate to PostgreSQL meta store (see [below for nested schema](#nestedatt--spec--meta--etcd_meta_store))
Copy link
Contributor

Choose a reason for hiding this comment

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

please migrate to PostgreSQL meta store

This seem to be a very vague statement. How does user migrate to PostgreSQL meta store?

Maybe simply tell them the meta store will be decided by the server and ask user to not specify this field ?

Copy link
Contributor

@wjf3121 wjf3121 Jan 16, 2025

Choose a reason for hiding this comment

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

Discussed offline, confirmed that it will generate a diff and the apply will fail.

Suggest we add some instructions to ask users to remove the etcd_meta_store field in the error message/documentation.

wjf3121
wjf3121 previously approved these changes Jan 16, 2025
Optional: true,
Description: "The etcd meta store is no longer supported in new RisingWave versions, this field is kept for compatibility, please remove it if your RisingWave version is above v2.1.0",
},
"meta_store": schema.SingleNestedAttribute{
Copy link
Contributor

@wjf3121 wjf3121 Jan 16, 2025

Choose a reason for hiding this comment

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

hmm.. this is a lot of changes since the approval.

I'm not sure we really want this: in general we don't want users to control what metastore use, and IIRC most of the options you listed here are read only attributes that are not allowed to be specified in a POST request.

I would suggest we don't expose this as an argument but display it as a read-only attributes instead.

Update: just realized these new schema are read only attributes. Then it looks good to me! Apology for the confusion XD

cc @Gogomoe to for another review too.

@wjf3121 wjf3121 dismissed stale reviews from Gogomoe and themself January 16, 2025 14:58

Large changes since the review, need another round of reivew.

Copy link
Contributor

@wjf3121 wjf3121 left a comment

Choose a reason for hiding this comment

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

LGTM!

@cloudcarver cloudcarver merged commit ecf150f into main Jan 18, 2025
11 checks passed
@cloudcarver cloudcarver deleted the mike/support-pgmetastore branch January 18, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants