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

Should check whether the dirs under "storage" configuration is valid string array #4093

Closed
JaySon-Huang opened this issue Feb 22, 2022 · 2 comments · Fixed by #4105
Closed

Comments

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented Feb 22, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

If the user set the config file with

[storage]
[storage.main]
dir = "/data0/db"
# Should be: dir = ["/data0/db"]
[storage.raft]
dir = "/data0/db"
# Should be: dir = ["/data0/db"]

If storage.main.dir,storage.latest.dir,storage.raft.dir is a string instead of string-array, TiFlash now consider it is an empty array without any warning/exception.
https://github.com/pingcap/tics/blob/fb00fbba50d802164a975daa3107478888ae0e25/dbms/src/Server/StorageConfigParser.cpp#L124-L135

We should check whether the dirs under "storage" configuration is a string array or not. If not, make TiFlash quit and tell the users to correct their configuration file.


In one scenario, users set ...

path="/data0/db"
raft.kvstore_path="/data0/kvstore"

in their cluster, after upgrading to v5.4.0, they replace those configurations with ...

[storage]
[storage.main]
dir = ["/data0/db"]
[storage.raft]
dir = "/data0/kvstore" # Should be: dir = ["/data0/kvstore"]

with the later configuration, TiFlash consider "storage.raft.dir" as an empty array and set it to "/data0/db/kvstore", which is not the same as upgrade before.

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

@JaySon-Huang JaySon-Huang added type/bug The issue is confirmed as a bug. affects-4.0 affects-5.0 affects-5.1 affects-5.2 affects-5.3 affects-5.4 This bug affects the 5.4.x(LTS) versions. labels Feb 22, 2022
@fuzhe1989
Copy link
Contributor

treat a single string as an array with one item?

@JaySon-Huang
Copy link
Contributor Author

JaySon-Huang commented Feb 22, 2022

@fuzhe1989 I think explicit require an array would be better.

In the old configuration, we use this for the multi-disks feature ...

path="/data0/tiflash,/data1/tiflash"

while in the new configuration, we use this for multi-disks feature ...

[storage.main]
dir = [ "/data0/tiflash", "/data1/tiflash"]

I don't want to see users mistakenly set sth like this in the future.... It is terrible...

[storage.main]
dir = "/data0/tiflash,/data1/tiflash"

@JaySon-Huang JaySon-Huang self-assigned this Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants