Currently, preferred content "balanced=groupname:lackingcopies" does not cause any repository in the balanced group to want to drop content even when there are more than enough copies.
("balanced=groupname:lackingcopies=grouplimit" also doesn't cause a drop)
Using --rebalance does make it want to drop.
Is this a good thing? If so, it needs to be documented. Or it could be changed to drop when there are more copies than necessary.
Internally, the reason this behavior happens is that "balanced=groupname:number" is the same as "(fullybalanced=groupname:number and not copies=groupname:number) or present" until --rebalance is used. And "balanced=groupname:lackingcopies" inherited that "or present".
The "or present" is important to avoid moving objects between repositories of a balanced group when not rebalancing. But, it's behaving more broadly here and keeping copies when there are enough copies outside the group.
Could it be changed to want to keep present copies where they are when there are not enough copies outside the balanced group, but otherwise want to drop from the balanced group?
I think that would entail making "balanced=groupname:lackingcopies" work the same as "fullybalanced=groupname:lackingcopies or (present and not lackingcopies=groupname:0)" --Joey
I tried implementing this (patch below) and found that it made objects be moved amoung nodes of the balanced group to balance, despite --rebalance not being used.
This patch actually makes it like "(present and lackingcopies=1)" but that is equvilant to "(present and not lackingcopies=0)" .. I think?
I do think that "present and foo" will work, with the right "foo". I'm just having trouble coming up with it, and it may be that it's not expressible with current preferred content syntax.
What's needed is something that only matches when there are too many copies.
"lackingcopies=groupname:0" matches when there are too many or the desired numcopies, which is not quite right.