ligurio / unreliablefs

A FUSE-based fault injection filesystem.
https://ligurio.github.io/unreliablefs/unreliablefs.1.html
MIT License
173 stars 9 forks source link

Add fault injection with 1-byte reads #92

Open ligurio opened 2 years ago

ligurio commented 2 years ago

Closes #86

ligurio commented 2 years ago

@vinipsmaker I made a patch that add a fault injection errinj_1byte_read that limits amount of data on every read() by a single byte. Could you check that fault injection works for you?

vinipsmaker commented 2 years ago

Could you check that fault injection works for you?

I think I can give it a try by next month.

Thanks for the patch. It should help one of my projects a lot.

ligurio commented 2 years ago

I think I can give it a try by next month.

Good, I will wait for your feedback.

ligurio commented 2 years ago

@vinipsmaker How to check the new fault injection with 1-byte read:

$ git clone https://github.com/ligurio/unreliablefs/
$ git checkout ligurio/gh-86
$ cd unreliablesfs
$ cmake .
$ make -j
$ mkdir source target
$ ./unreliablefs -basedir=./source target/
$ cat << EOF > target/unreliablefs.conf
[errinj_1byte_read]
op_regexp = .*
path_regexp = .*
probability = 80
EOF
$ umount source
vinipsmaker commented 2 years ago

I can give it a try this week. Will report back soon.

How to check the new fault injection with 1-byte read

Thanks for the heads-on tutorial. It'll make the test quicker.

vinipsmaker commented 2 years ago

It's not working at all.

The read() syscall returns -1 and errno is set to EINTR.

That's the log from unreliablefs:

errinj_1byte_read triggered on operation 'getattr', /home/vinipsmaker/Projetos/tabjson/test.BAK/jpat_changes.in
start of 1-byte read
errinj_1byte_read triggered on operation 'open', /home/vinipsmaker/Projetos/tabjson/test.BAK/jpat_changes.in
start of 1-byte read
errinj_1byte_read triggered on operation 'read', /home/vinipsmaker/Projetos/tabjson/test.BAK/jpat_changes.in
start of 1-byte read
errinj_1byte_read triggered on operation 'read', /home/vinipsmaker/Projetos/tabjson/test.BAK/jpat_changes.in
start of 1-byte read
errinj_1byte_read triggered on operation 'flush', /home/vinipsmaker/Projetos/tabjson/test.BAK/jpat_changes.in
start of 1-byte read
errinj_1byte_read triggered on operation 'lock', /home/vinipsmaker/Projetos/tabjson/test.BAK/jpat_changes.in
start of 1-byte read
errinj_1byte_read triggered on operation 'release', /home/vinipsmaker/Projetos/tabjson/test.BAK/jpat_changes.in
start of 1-byte read

Before it hits my call to read() the host for my plugin (gawk) performs some additional simple calls. My plugin controls the calls to read() so that's the part that matters to me.

ligurio commented 2 years ago

It's not working at all. The read() syscall returns -1 and errno is set to EINTR.

Thanks. I'll take a look.