GitXplorerGitXplorer
a

iofailuresim

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
b87f5205bfc2464f1c1016d7069d4bd20579208a

add CRASH_FAILURE_ONE_IN for immediate crashes

aajkr committed 6 years ago
Unverified
5af8c44c1393d4bd5e3f43071c1df91201522363

seed random

aajkr committed 6 years ago
Unverified
4c33691f22dafecfb000d5d9c9b61da60267c038

kill process, not process group

aajkr committed 6 years ago
Unverified
946377bfe0307989b3a2e6e5d204f0ee3c1f820a

initial commit

aajkr committed 6 years ago

README

The README file for this repository.

iofailuresim

Simulator of hard resets and fsync failures for applications that write append-only files. Assumes the application uses the C standard library's write(), fdatasync(), and fsync() for writing and syncing data.

Compile

gcc -std=c99 -fPIC -shared -o libiofailuresim.so iofailuresim.c -ldl

Run

LD_PRELOAD=./libiofailuresim.so <your application>

Configure

  • CRASH_FAILURE_ONE_IN=<n>: During a sync operation, crash the process immediately with a probability of 1/n. All unsynced writes are lost since they are buffered in process memory.
  • SYNC_FAILURE_ONE_IN=<n>: A sync operation will return failure with a probability of 1/n. All unsynced writes for the file are dropped to simulate the failure.
  • CRASH_AFTER_SYNC_FAILURE=<0|1>: If set to one, the program will kill itself some time after the first simulated sync failure. It does not happen immediately to allow the system to get itself into a weird state in case it doesn't handle sync failures properly.