-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
cli: Redefine Stores Flag #4577
Comments
I think it should also be possible to specify sizes in human-readable formats (mb, gb) and I would avoid the percentage symbol (bad for scripting). Percentages can be specified as I don't like muddling up the size with the attributes and special-casing based on its being numeric, but somehow an extra separator doesn't make it better.
Looks good to me. |
It feels awkward for the size and labels to be intermixed like that. Perhaps the size should be distinguished with different syntax:
|
@petermattis By putting the amount after the directory, it limits the directory syntax. |
Is limiting the directory syntax a problem? We could use a rarer delimiter like
|
We discussed that it's a bad idea to have anything after the path since pretty much anything is a legit path name. |
I like |
We could also allow the delimiter to be escaped so that it wouldn't be completely disallowed. My preference would be to demote attributes since they're something of an advanced feature, so you'd specify attributes with The examples become:
As long as we keep the simple case of |
Ben's proposal is fine by me. |
I'm leaning toward's Ben's proposal as well. I like the explicit nature of it. |
I looked through the mongo, cassandra, and hbase docs to see how they handle such settings. Really hard to track it all down! I'll look more tomorrow, but I find Ben's proposal a lot more intuitive than what I've been seeing. |
I like @bdarnell's proposal as well, but I'm still in favor of supporting human-readable sizes (at least to some extent: |
@tschottdorf Agreed about human-readable input. See #4348. |
I like human readable as well. I found a library https://github.com/dustin/go-humanize that I'm going to be referencing to do the parsing. |
Go-humanize does parsing? On Tue, Feb 23, 2016, 00:44 Bram Gruneir notifications@github.com wrote:
|
Any final comments? |
Do it. |
For reference, Cassandra supports the JBOD model for storage - Just a Bunch Of Disks. The data_file_directories parameter in the cassandra.yaml configuration file can specify a list if directories, typically one per storage device, with no other settings for each directory/device. Then it gets messy... Prior to release 3.2, on each memtable/sstable flush it will select the directory (device) which has the most available space as a percentage of the total available space on all of the listed directories/devices. Actually, it uses a random weighted value so it won't always pick the directory/device with the most space, one goal being to balance writes for performance. As of release 3.2, Cassandra simply splits the range of tokens (the partition key subset of the primary key is hashed to produce a token) to even cover each listed storage device. Since 3.2, there currently isn't any compensation for differences in capacity or free space on the individual devices. The important thing since 3.2 was to assure that the sstables for a given token would not be split across devices since that would open the door to zombie data - deleted data on one device which could come back to life if the device containing its tombstone were to be lost and the node (partially) repaired from another node. There are probably also still some cases where the pre-3.2 behavior is still used (if the configured partitioner does not support a token range splitter, for example, but that would not be common.) 3.2 was released on January 12, 2016. |
So I need to make a small change to the format. Going with a semicolon to separate the parameters looks good on paper... but semicolons don't work well in bash. So, slight change, commas to separate parameters and colons to separate attributes. |
Fixes cockroachdb#4577 This changes the --stores flag in which all stores are specified in a single command line flag into the --store flag. This new flag adds in the option to specify the size for non in memory stores.
Covered in docs for |
Split the --stores flag into having multiple --store flags.
The following is old, see Ben's comment below to see the format we plan to use.
So the new flag will be used once per store, and contain the following values, in order:
So some examples:
// attributes, size and location
--store=abc1,def2,20%=/mnt/hda1
// attribute, size and location
--store=abc1,200000=/mnt/hda1
// only size and location
--store=50%=/mnt/hda1
// only attribute and size (in memory)
--store=abc1,200000
// only size (in memory)
--store=34%
// attributes with no size
--store=abc1,def2=/mnt/ssd1
So one limitation of this format is that you can't have an all numeric attribute without defining a size. But this format doesn't preclude them, just define the size as 100%.
--store=12345,100%=/mnt/ssd2
This format does mean that you can't use commas as attributes, but I think that's reasonable. Currently, the colon is used instead.
This format is not set in stone, if anyone can think of a better way to define this flag, please reply to this issue.
The implementation of this new format is being tracked in issue #4095.
The text was updated successfully, but these errors were encountered: