https://github.com/vi/outoforderfs
FUSE single-file filesystem simulating dirty block device shutdown (each write is delayed randomly)
https://github.com/vi/outoforderfs
Last synced: about 1 year ago
JSON representation
FUSE single-file filesystem simulating dirty block device shutdown (each write is delayed randomly)
- Host: GitHub
- URL: https://github.com/vi/outoforderfs
- Owner: vi
- License: mit
- Created: 2016-03-20T00:16:27.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-20T23:41:21.000Z (over 10 years ago)
- Last Synced: 2025-04-15T14:13:27.585Z (about 1 year ago)
- Language: Rust
- Size: 20.5 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# outoforderfs
FUSE single-file filesystem simulating dirty block device shutdown (each write is delayed randomly)
```
$ target/debug/outoforderfs
Usage: outoforderfs source_file mountpoint_file blocksize maxtime_ms maxdirtyblocks
outoforderfs 'mirrors' source file to mountpoint_file,
but writes to mountpoint_file get delivered
to source_file after a random delay, in random order.
The reason is to see what happens of some other FS in case of
surprise removal (or sudden shutdown) of the storage.
Example session (approximate):
1$ dd if=/dev/zero bs=4096 count=2560 of=sf.dat
1$ touch mp.dat
1$ outoforderfs sf.dat mp.dat 4096 10000 100
1$ (switch to a new tab)
2$ mkfs mp.dat
2$ mount mp.dat -o loop mnt
2$ start using mnt (filling with logs, creating sqlite, etc)
1$ ^C
1$ outoforderfs sf.dat mp.dat 4096 10000 100
2$ umount mnt
2$ mount mp.dat -o loop mnt
2$ inspect mnt for breakage, incomplete/zeroed files, etc
```
Eye-catcher:
```
$ ./visualtest.sh
# write 80 spaces to sf.dat
+ target/debug/outoforderfs sf.dat mp.dat 1 5000 1000
# write 80 dots to mp.dat
# Contant of sf.dat against time
.
. .
. ..
. . . . ..
. . . . ..
. . . . ..
. . . . . ..
. . . . . ..
.. . . . . . . ..
.. . . . . . . ..
.. . . . . . . ..
.. . . . . . . ..
.. . . . . . . ..
.. . . . . . . ..
.. . . . . . . . ..
... . . . . . . . . ..
... . . . . . . . . ..
... . . . . . . . . ..
... . . . . . . . . ..
... . . . . . . . . . . ..
. ... . . . . . . . . . . ..
. .... . . . . . . . . . . ..
. .... . . . . . . . . . . ..
. .... . . . . . . . . . . . ..
. .... . . . . . . . . . . . ..
. .... . . . . . . . . . . . . ..
. .... . . . . . . . .. . . . . ..
. .... . . . . . . . .. . . . . ..
. .... . . . . . . . .. . . . . ..
. ..... . .. . . . . . .. . . . . ..
. ..... . .. . . . . . .. . . . . ..
. ..... . .. . . . . . .. . . . . .. ..
. ..... . .. . . . . . .. . . . . .. ..
. ..... . .. . . .. . . .. . . . . .. ..
. ..... . .. . . .. . . .. . . . . .. ..
. ..... . .. . . .. . . .. . . . . .. ..
.. ..... . .. . . .. . . .. . . . . ... ..
.. ..... . .. . . .. . . .. . . . . . ... ..
.. ..... . .. . . .. . . .... . . . . . ... ..
.. ..... . .. . . .. . . .... . . . . . ... ..
.. ..... . .. . . .. . . . .... . . . . . . ... ..
. .. ..... . .. . . .. . . . .... . . . . . . ... ..
. .. ..... . .. . . .. . . . .... ... . . . . . ... ..
. .. ..... . .. . . .. . . . .... ... . . . . . ... ..
. .. ..... . .. . . .. . . . .... ... . . . . . ... ..
. . .. ..... . .. . . .. . . . .... ... . . . . . ... ..
. . .. ..... . .. . . .. .. . . .... ... . . . . . ... ..
. . .. ..... . .. . . .. .. . . .... ... . . . . . ... ..
. . .. ..... . . .. . . .. .. . . .... ... . . . . . ... ..
# Now write 80 asterisks to mp.dat
. . .. ..... . . .. .. . .. .. . . .... ... . . . . . ... ..
. . .. ..... . . .. .. . .. .. . . .... ... . . . . . ... ..
. . *. ..... . . .. ..*. .. .. * . .... ... . . . . *. ... ..
. . *. ..... . . .. ..*. .. .. * . .... ... * . . . *. ... ..
. . *. ..... . . .. ..*. .. .. * . .... ... * . . . *. ... ..
. *. *. ..... . . .. ..*. .. .. * . .... ... * . . . *. ... ..
. *. *. ...*. . . .. ..*. .. .. * . .... ... * . . . *. ... ..
. *. *. ...*. . . .. ..*. .. .. * . .... ... * . . . *. ... ..
. *. *. ...*. . . .. ..*. .. .* * . .... ... * . . . *. ... ..
. *. *. ...*. . . .. ..*. .. .* * . .... ... * . . . *. ... ..
. *. *. ...*. . . .. ..*. .. .* * . .... ... * . . . *. ... ..
. *. *. ...*. . . .. ..*. .. .* * . .... ... * .*. . *. ... ..
. *. *. ...*. . . .. ..*. .. .* * . .*.. ... * .*. . ** ... ..
. *. *. ...*. . . .. ..*. .. .* * . .*.. ... * .*. . ** ... ..
. *. *. ...*. . . .. ..*. .. .* * . .*.. ... * .*. . ** ... ..
. *. *. ...*. . . .. ..*. .. * .* * . .*.. ... * .*. . ** ... ..
. *. *. ...** * *. .. ..*. .. * .* * . .*.. ... * .*. . ** ... ..
. *. *. ...** * *. .. ..*. .. * .* * . .*.. ... * .*. . ** ... ..
. *. *. ...** * *. .. ..*. .. * .* * . .*.. ... * .*. . ** ... ..
. *. *. ...** * *. .. ..*. .. * .* * . .*.. ... * .*. . ** ... ..
. *. *. ...** * *. .. ..*. .. * .* * * . .*.. ... * .*. . ** ... ..
. *. *. ...** * *. .. ..*. .* * .* * * . .*.. ... * .*. . ** ...* ..
. *. *. ...** * **. .. ..*. .* * .* * * . .*.. *... * .*. . ** ...* ..
. *. *. ...** * **.*.. ..*. .* * .* * * . .*.. *... * .*. . ** ...* ..
. *. *. ...** * **.*.. ..*.*.* * .* * * . .*..**... * .*. . *** ...* ..
. *. *. ...** * **.*.. ..*.*.* * .* * * . .*..**... * .*. . *** ...* ..
*. *. *. ...** * **.*.. ..*.*.* * .* * * . .*..**... * .*. . *** ...* ..
*. *.* *. ...** * **.*.. ..*.*.* * .* * * . .*..**...* * .*. . *** ...* ..
*. *.* *. ...** * **.*.. ..*.*.* * .* * * . .*..**...* * .*. . *** ...* ..
*. *.* *. ...** * **.*..*..*.*.* * ** * * **.*..**...* * .*. . *** ...**..
*. *.* *.*...** * **.*..*..*.*.* * ** * * **.*..**...* * .*. . *** ..***..
*. *.* *.*...** * **.*..*..*.*.*** ** * * **.*..**.*.* * .*. . *** ..***..
**.**.* *.*...** * **.*..*..*.*.*** ** * * **.*..**.*.* * .*. . *** ..***..
**.**.* *.*...** * **.*..*..*.*.*** ** * * **.*..**.*.* **.*. . *** ..***..
**.**.* *.*...**** **.*..*..*.*.*** ** * ** **.*..****.* **.*. . *****..***..
**.**.* *.*...**** **.*..*..*.*.*** *** * ** **.*..****.* **.*.*. *****..***..
**.**.* **.*...**** **.**.*..*.*.*** *** * ** **.*..****.* **.*.*. *****..***..
**.**.* **.*...**** **.**.*..*.*.*** *** * ** **.*..****.* **.*.*. *****..***..
**.**.* **.*...**** **.**.*..*.*.*** *** * ** **.*..****.* **.*.*. *****..***..
**.**.* **.*...**** **.**.*..*.*.*** ***** *****.*..****.* **.*.*. *****..***..
**.**.****.*...**** **.**.*..*.*.*** ***** *****.*..****.* **.*.*. *****..***..
**.**.****.*...*******.**.*..*.*.*** ***** *****.*..****.****.*.*. *****..***..
**.**.******..********.**.*..*.*.*** ***** *****.*..****.****.*.*. *******.***.*
**.**.*******.********.**.*..*.*.***************.*..****.****.*.*.********.***.*
**.**.*******.********.**.*..*.*.***************.*..****.****.*.*.********.***.*
**.**.*******.********.**.*..*.*.***************.*..****.****.*.*.********.***.*
**.**.*******.********.**.*..*.*.***************.*..****.****.*.*.********.***.*
**.**.*******.********.**.*..*.*.***************.*..****.****.*.*.********.***.*
**.*******************.**.*..*.*.***************.*..****.****.*.*.********.***.*
**.*******************.**.*..*.*.***************.*..****.****.*.*.********.***.*
**.*******************.**.*..*.*.***************.*..****.****.*.*.********.***.*
^C
16 dirty blocks lost
```