Skip to content

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

@JaySon-Huang

Description

@JaySon-Huang

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions