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

fruitful playground - tikv-slim mode #1269

Closed
tisonkun opened this issue Apr 1, 2021 · 4 comments · Fixed by #1365
Closed

fruitful playground - tikv-slim mode #1269

tisonkun opened this issue Apr 1, 2021 · 4 comments · Fixed by #1365
Labels
category/usability Categorizes issue or PR as a usability enhancement. type/feature-request Categorizes issue as related to a new feature.
Milestone

Comments

@tisonkun
Copy link
Contributor

tisonkun commented Apr 1, 2021

Feature Request

Feature Description

So far, tiup playground by default create a tidb-fullstack cluster with 1 tidb + 1 tikv + 1 pd + 1 tiflash deployment. It is good for tidb audience, but not great for tikv-only audience, who just wants tikv + pd.

I'd like to introduce a tikv quickstart guide and recommend tiup as the defaulut, but it is an understanding burden for new user with current tiup he must set --db 0 --tiflash 0 and likely asks "what db / tiflash is".

Thus I propose we introduce a tikv-slim mode for playground which builds on the top of instance settings and provides fruitful feature for tikv-only audience, with which the experience becomes

$ tiup playground --mode tikv-slim

... and it starts 1 tikv + 1 pd only.

Rough Technical Design

The interface above leads to a minimal change set of code. Generally specking tiup currently hardcode the default option as below.

opt := &bootOptions{
tidb: instance.Config{
Num: 1,
UpTimeout: 60,
},
tikv: instance.Config{
Num: 1,
},
pd: instance.Config{
Num: 1,
},
tiflash: instance.Config{
Num: 1,
UpTimeout: 120,
},
host: "127.0.0.1",
monitor: true,
version: "",
}

We can introduce a new config named mode(consider it!) which has options "tidb-fullstack"(default), and "tikv-slim".

tidb-fullatsack is the default and acts as current, while tikv-slim will populate the default config with "tikv.Num = 1" and "pd.Num = 1" only, without setting up tidb & tiflash. Other configs will be respected later one by one.

@tisonkun tisonkun added the type/feature-request Categorizes issue as related to a new feature. label Apr 1, 2021
@AstroProfundis AstroProfundis added the category/usability Categorizes issue or PR as a usability enhancement. label Apr 12, 2021
@AstroProfundis AstroProfundis added this to the v1.5.0 milestone Apr 12, 2021
@tisonkun
Copy link
Contributor Author

tisonkun commented May 6, 2021

closed by #1333

@tisonkun tisonkun closed this as completed May 6, 2021
@tisonkun
Copy link
Contributor Author

@iosmanthus what if we move kv-only to mode design above?

@tisonkun tisonkun reopened this May 15, 2021
@tisonkun
Copy link
Contributor Author

@AstroProfundis I'm trying to use a painter algorithm for populate options layer by layer, but fail because the default value cannot be empty and trivially be ignored.

For example, I'd like make TiDB.Num to be blank(None in Rust as Option), and using --mode to define its default value while it can be later overwritten by --db. But it is tricky because cobra doesn't provide None but always a default value. And thus --db always have a default value that I don't know it is from user or just default.

@tisonkun
Copy link
Contributor Author

tisonkun commented May 15, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/usability Categorizes issue or PR as a usability enhancement. type/feature-request Categorizes issue as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants