asim: enforce len(weighted_rand) == number of stores#108099
asim: enforce len(weighted_rand) == number of stores#108099craig[bot] merged 2 commits intocockroachdb:masterfrom
Conversation
95a3e00 to
ed4d5a7
Compare
b350933 to
145dd50
Compare
|
Please only review the last two commits. The preceding commits are from #108059. |
e24463c to
5966fe8
Compare
e0d8032 to
2cf6178
Compare
kvoli
left a comment
There was a problem hiding this comment.
Nice! One non-blocking question.
Reviewed 10 of 10 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @wenyihu6)
pkg/kv/kvserver/asim/tests/rand_gen.go line 257 at r1 (raw file):
) func (c clusterGenSettings) String() string {
nit: Any reason this moved? its better to avoid moving code around if unnecessary, as it pollutes the blame history.
|
Previously, kvoli (Austen) wrote…
I think I moved it just so that it is after all the const initialization. I've moved them back. |
This patch allows users to modify the settings for the static mode within the randomized testing framework. The following command is now supported: ``` 4. “change_static_option”[nodes=<int>][stores_per_node=<int>] [rw_ratio=<float64>] [rate=<float64>] [min_block=<int>] [max_block=<int>] [min_key=<int64>] [max_key=<int64>] [skewed_access=<bool>] [ranges=<int>] [placement_type=<gen.PlacementType>] [key_space=<int>] [replication_factor=<int>] [bytes=<int64>] [stat=<string>] [height=<int>] [width=<int>] e.g. change_static_option nodes=2 stores_per_node=3 placement_type=skewed - Change_static_option: modifies the settings for the static mode where no randomization is involved. Note that this does not change the default settings for any randomized generation. - nodes (default value is 3): number of nodes in the generated cluster - storesPerNode (default value is 1): number of store per nodes in the generated cluster - rwRatio (default value is 0.0): read-write ratio of the generated load - rate (default value is 0.0): rate at which the load is generated - minBlock (default value is 1): min size of each load event - maxBlock (default value is 1): max size of each load event - minKey (default value is int64(1)): min key of the generated load - maxKey (default value is int64(200000)): max key of the generated load - skewedAccess (default value is false): is true, workload key generator is skewed (zipf) - ranges (default value is 1): number of generated ranges - keySpace (default value is 200000): keyspace for the generated range - placementType (default value is gen.Even): type of distribution for how ranges are distributed across stores - replicationFactor (default value is 3): number of replica for each range - bytes (default value is int64(0)): size of each range in bytes - stat (default value is “replicas”): specifies the output to be plotted for the verbose option - height (default value is 15): height of the plot - width (default value is 80): width of the plot In addition, verbose=(static_settings) can now be used to display settings used for static options where no randomization is involved. ``` Part of: cockroachdb#106311 Release note: None
Previously, we enforce that the length of a given `weighted_rand` cannot exceed the number of stores. This was challenging for users as they might not know the cluster configuration that would be generated and thus do not know the number of stores. In addition, if the length of `weighted_rand` was less than total number of stores, any stores outside of the `weighted_rand` range would simply have zero replicas. This could lead to confusion. To improve user control, this patch disables the use of weighted_rand with randomized cluster generation. Requirements to use weighted_rand: 1. use static option for cluster generation 2. specify nodes(default:3) and stores_per_node(default:1) through change_static_option 3. ensure len(weighted_rand) == number of stores == nodes * stores_per_node In addition to these new rules, the following existing requirements remain in place: 1. weighted_rand should only be used with placement_type=weighted_rand and vice versa. 2. must specify a weight between [0.0, 1.0] for each element in the array, with each element corresponding to a store 3. sum of weights in the array should be equal to 1 Resolves: cockroachdb#106311 Release note: None
2cf6178 to
667599b
Compare
|
TFTR! bors r=kvoli |
|
Build succeeded: |
asim: enable option to change static option settings
This patch allows users to modify the settings for the static mode within the
randomized testing framework. The following command is now supported:
Part of: #106311
Release note: None
asim: enforce len(weighted_rand) == number of stores
Previously, we enforce that the length of a given
weighted_randcannot exceedthe number of stores. This was challenging for users as they might not know the
cluster configuration that would be generated and thus do not know the number of
stores. In addition, if the length of
weighted_randwas less than total numberof stores, any stores outside of the
weighted_randrange would simply havezero replicas. This could lead to confusion.
To improve user control, this patch disables the use of weighted_rand with
randomized cluster generation. Requirements to use weighted_rand:
change_static_option
In addition to these new rules, the following existing requirements remain in
place:
versa.
each element corresponding to a store
Resolves: #106311
Release note: None