crush multi-pick anomaly
Hi Adam,
Sam had a suggestion about the CRUSH weight anomaly[1]. Instead of adjusting the weight for a given bucket based on an expected num_rep value, instead we could store a vector of weight values for every bucket in the tree for a range of num_reps (2..15, or whatever range is appropriate given the min_size/max_size values for the rules). In general the tools will show the normal weight (which is a sum of the children) but we'd also keep the adjusted values for any given num_rep and use those for the actual choose.
What do you think?
sage
[1] See
https://github.com/ceph/ceph/pull/10218 http://tracker.ceph.com/issues/15653
Quoted 11 lines · Sage Weil
Hi Adam,
Sam had a suggestion about the CRUSH weight anomaly[1]. Instead of adjusting the weight for a given bucket based on an expected
num_repvalue, instead we could store a vector of weight values for every bucket in the tree for a range ofnum_reps(2..15, or whatever range is appropriate given the min_size/max_size values for the rules). In general the tools will show the normal weight (which is a sum of the children) but we'd also keep the adjusted values for any givennum_repand use those for the actual choose.
Quoted 1 line
What do you think?
I thought of something along those lines, though it makes me a bit uneasy. Right now, if I have a bunch of objects stored on a bunch of hosts and we increase the replication count, objects migrate are copied to the NEW hosts but don't migrate between hosts. (This is part of the RUSH family monotonicity guarantee.)
This seems like it might catch users by surprise and result in undesired behavior. Having Ceph operate this way would violate the /expectations/ people have from looking at a description of our algorithm.
Rather than having CRUSH automagically pick the distribution based on the replication count, could we make it more explicit? I'm not sure what the best form would be. We might have 'auxiliary weightings' in straw2 and list buckets and a way for a CRUSH rule to select one of the alternates. That way we wouldn't have to replicate the entire hierarchy of devices, and people could 'opt in' explicitly.
That might be a bit too fiddly, but I think you get the idea. I'm very uneasy about having 'magic replication count' behavior sneak up on people.
Signature · 3 lines
Senior Software Engineer Red Hat Storage, Ann Arbor, MI, US
IRC: Aemerson@{RedHat, OFTC, Freenode}
0x80F7544B90EDBFB9 E707 86BA 0C1B 62CC 152C 7C12 80F7 544B 90ED BFB9Quoted 32 lines · Adam C. Emerson
Quoted 11 lines · Sage Weil
Hi Adam,
Sam had a suggestion about the CRUSH weight anomaly[1]. Instead of adjusting the weight for a given bucket based on an expected
num_repvalue, instead we could store a vector of weight values for every bucket in the tree for a range ofnum_reps(2..15, or whatever range is appropriate given the min_size/max_size values for the rules). In general the tools will show the normal weight (which is a sum of the children) but we'd also keep the adjusted values for any givennum_repand use those for the actual choose.Quoted 1 line
What do you think?
I thought of something along those lines, though it makes me a bit uneasy. Right now, if I have a bunch of objects stored on a bunch of hosts and we increase the replication count, objects migrate are copied to the NEW hosts but don't migrate between hosts. (This is part of the RUSH family monotonicity guarantee.)
This seems like it might catch users by surprise and result in undesired behavior. Having Ceph operate this way would violate the /expectations/ people have from looking at a description of our algorithm.
Rather than having CRUSH automagically pick the distribution based on the replication count, could we make it more explicit? I'm not sure what the best form would be. We might have 'auxiliary weightings' in straw2 and list buckets and a way for a CRUSH rule to select one of the alternates. That way we wouldn't have to replicate the entire hierarchy of devices, and people could 'opt in' explicitly.
Quoted 3 lines
That might be a bit too fiddly, but I think you get the idea. I'm very uneasy about having 'magic replication count' behavior sneak up on people.
Hmm. What if the weights are alternatives based on num_rep, but rather based on r (or rather which replica we are choosing). So the first choice is based on the actual weights. The second choice is based on the r=2 weights. The third choice is based on r=3 weights.
In a perfect world, those weights are actually a function of our previous selection(s); in this case, since that is not computationally feasible (right?), we can precalculate values that are "average" for possible prior choices. It'd be a bit more complicated, but assume for a moment that we could do this...
Then, if you move from 2x to 3x for a given mapping, the selection of the first 2 replicas won't be any different than before, but the third replica will use different effective weights.
sage
Quoted 10 lines · Sage Weil
Hmm. What if the weights are alternatives based on
num_rep, but rather based on r (or rather which replica we are choosing). So the first choice is based on the actual weights. The second choice is based on the r=2 weights. The third choice is based on r=3 weights.In a perfect world, those weights are actually a function of our previous selection(s); in this case, since that is not computationally feasible (right?), we can precalculate values that are "average" for possible prior choices. It'd be a bit more complicated, but assume for a moment that we could do this...
So! We /can/ do something like this. A 'cumulative' reweighting, where we calibrate r=n as a correction on r=n-1.
The downsides would be that there are fewer 'possible' distributions if we skew per-round. (That is, there are distributions we can achieve adjusting everything up-front that we can't achieve going per-round.) I'm strongly suspect that as our maximum 'r' goes up the difference between possible all-at-once distributions and possible per-round distributions gets bigger.
Second, currently every OSD has an equal chance of being the primary, secondary, tertiary... Under this scheme the lowest weight OSDs would be the primary for a disproportionately large share of the objects they hold. If we assume that low-weight OSDs are smaller machines and primaries do more work than secondaries, this might be bad.
Third, it would be more computationally intensive. Especially if we want to support a large bucket where each OSD has a unique weight shared by no other OSD. I don't nkow HOW intensive (and there's room to try and make things smarter) but it might be unavoidably quite long for large buckets.
If those don't seem too bad as tradeoffs, we can do something along these lines and I'll get to hammering at it. It seems like a fairly large amount of complexity for the problem being solved, but that all depends on how much the Distribution Surprise is biting people, I guess.
I /suspect/ we will want to support the old, unmodified mode of operation on a scale finer than a CRUSH tunable.
Signature · 3 lines
Senior Software Engineer Red Hat Storage, Ann Arbor, MI, US
IRC: Aemerson@{RedHat, OFTC, Freenode}
0x80F7544B90EDBFB9 E707 86BA 0C1B 62CC 152C 7C12 80F7 544B 90ED BFB9