| 1 |
Persistent Memory Development Kit |
| 2 |
|
| 3 |
This is src/test/blk_recovery/README. |
| 4 |
|
| 5 |
This directory contains a unit test for pmemblk recovery. It works only |
| 6 |
in non-debug mode. |
| 7 |
|
| 8 |
The program in blk_recovery.c takes a block size, file and two LBAs. |
| 9 |
A write to the first LBA is performed, then the arena map data structure |
| 10 |
protections are modified to be read-only, then the remaining LBA is written. |
| 11 |
|
| 12 |
For example: |
| 13 |
|
| 14 |
./blk_recovery 4096 file1 5 10 |
| 15 |
|
| 16 |
this will call pmemblk_open() on file1, call pmemblk_write() for LBA 5 |
| 17 |
(causing all the layout to be written), then it will change the memory |
| 18 |
protection on the arena map area to read-only. Next, pmemblk_write() |
| 19 |
is called for for LBA 10 and SIGSEGV is caught and reported. Finally, |
| 20 |
pmemblk_check() is called. |
| 21 |
|
| 22 |
This is not a perfect simulation of a system interruption, but does allow |
| 23 |
creating a file where a write was interrupted before updating the map. |