test: vinyl: test recovery after incomplete splits
The idea behind the test is simple - create several invalid range files, i.e. those left from previous dumps and incomplete splits, then restart the server and check that the content of the space was not corrupted. To make it possible, we need to (1) prevent the garbage collector from removing unused range files and (2) make the split procedure fail after successfully writing the first range. We use error injection to achieve that. The test runs as follows: 1. Disable garbage collection with the aid of error injection. 2. Add a number of tuples to the test space that would make it split. Rewrite them several times with different values so that different generations of ranges on disk would have different contents. 3. Inject error to the split procedure. 4. Rewrite the tuples another couple of rounds. This should trigger split which is going to fail leaving invalid range files with newer ids on the disk. 5. Restart the server and check that the test space content was not corrupted.
Showing
- src/box/vinyl.c 13 additions, 3 deletionssrc/box/vinyl.c
- src/errinj.h 2 additions, 0 deletionssrc/errinj.h
- test/box/errinj.result 4 additions, 0 deletionstest/box/errinj.result
- test/vinyl/recover.result 81 additions, 0 deletionstest/vinyl/recover.result
- test/vinyl/recover.test.lua 47 additions, 0 deletionstest/vinyl/recover.test.lua
- test/vinyl/suite.ini 1 addition, 1 deletiontest/vinyl/suite.ini
Loading
Please register or sign in to comment