No progress on disk removal

Hi,

Very minor issue in the grand scheme of things.

I’ve just replaced a disk with a larger disk. The Balances tab showed Percent finished while rebalancing after adding the larger disk, but not when removing the smaller disk afterwards.
(Although you can see the Allocated GB of the removed disk heading towards 0 with each refresh)

Shall I raise a github issue?

@HarryHUK Hello again.

Re:

Yes, this is us relaying the info provided by btrs balance status.

Unfortunately, this is a btrfs ‘thing’. There is not balance enacted by us in this case, but an internal balance by btrfs does take place. Unfortunately this disk removal ‘internal’ balance has no status report. And in fact while it is under way there is no report of such from the balance status command. At least not yet. Hopefully in the future this ‘internal’ balance will be surfaced via the btrfs commands in a way we can use. But currently we ‘infer’ these internal balance by looking for zero size I think (from memory) and report the scant information we have on it’s progress as best we can.

So currently re:

I don’t think so, not just yet anyway. As we are currently doing most of what we can and it’s already a bit hacky as we have to, as stated, infer these balances anyway. But this forum post can server as a resource to the current state. Actually dealing with disk removal, in part due to this caveate that an internal balance, that is not reported by btrfs balance status, is invoked automatically, and the fact that they can be quite long running proved to be quite the challenge. We will likely revisit all of this stuff as we get our house more in order re python 3 and as btrfs hopefully exposes these internal balances by the normal means.

See the following pull request for how we currently handle these otherwise invisible ‘internal’ btrfs balance operations:

The text of that pr gives some details of what we do in these disk removal scenarios.

Hope that helps and thanks for ‘surfacing’ this current ‘short fall’ in the forum. I’d call it a feature currently, rather than a bug, as we at least have our own ‘make shift’ inference of this internal balance in progress. And I’d like to not add any more ‘magic’ in the hope that we can rely more on the underlying tools surfacing this in the normal means as things develop upstream.

Thanks again for yet another keen observation. Much appreciated.

3 Likes