Open kode54 opened 8 months ago
This still appears to be an issue.
Okay, I figured it out:
The problem here is not the calculation algorithm. The problem is that when the volumes are created, the btree_node_size option isn't populated, so the bucket size starts as 4096 (the block size of the volume), then gets increased to the min size of 128KiB, then from the device size of 18'000'000'000'000 ends up producing the ilog2 of 27, divided down to 6, round down power of two of 4, and scaling 131'072 by 4 to result in 512KiB.
The added drive, on the other hand, populates the btree_node_size option with 256KiB. The division and ilog2 still yields 6, rounded down to 4, but ends up scaling up 262'144, which results in 1024KiB.
I have created two qcow2 volumes roughly sized according to my two large hard drives:
and mounted them with qemu-nbd:
If I format them together:
Then they both end up with 512 KiB bucket size, like my first formatted drive:
If I format one, then add the second device (later) using
device add
, then the second drive ends up with 1024 KiB bucket size: