bcachefs icon indicating copy to clipboard operation
bcachefs copied to clipboard

3 replicas with erasure codeing fails with 2 defective drives

Open b-r-o-w-n opened this issue 3 years ago • 2 comments

This is a test of raid 6 using this format:

./bcachefs format -f --erasure_code /dev/sda /dev/sdb /dev/sdc /dev/sde --data_replicas=3 --metadata_replicas=3 --data_replicas_required=2 --metadata_replicas_required=2

If the above format is the equivalent to raid 6 then removing 2 drives should be ok.

kernel: 5.15.0-gd9b3fe55be51 bcachefs-tools: v0.1-453-g7b15324

If I pull sda and sdb at the same time the test file is not readable. Note that there are 4 drives in use.

This passes when erasure coding is not enabled.

This seems to be related to if the first drive is pulled in the test. pull sda and sdb : fail pull sdc and sde: pass pull sdb and sdc: pass pull sda and sde: fail

The test is: create a new filesystem and mount it ./bcachefs format -f --erasure_code /dev/sda /dev/sdb /dev/sdc /dev/sde --data_replicas=3 --metadata_replicas=3 --data_replicas_required=2 --metadata_replicas_required=2

mount -t bcachefs /dev/sda:/dev/sdb:/dev/sdc:/dev/sde /mnt/bcachefs

create some test data: cd /mnt/bcachefs/ dd if=/dev/urandom bs=1M count=500 > test_data md5sum test_data

pull drives...

test file contents: md5sum test_data md5sum: test_data: Input/output error

If you need any additional info just ask.

b-r-o-w-n avatar Feb 15 '22 17:02 b-r-o-w-n

_replicas_required is a synonym for _replicas, so you've effectively just set redundancy levels to 2.

@koverstreet should we nerf these flags they're just causing confusion?

YellowOnion avatar Mar 17 '22 22:03 YellowOnion

Yes we should

koverstreet avatar Mar 19 '22 12:03 koverstreet