Ran
|
Files
305
|
Run time
20s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
<a href="https://github.com/tarantool/tarantool/commit/<a class=hub.com/tarantool/tarantool/commit/4282881c638ce50b74d3fc75369d63a48da04324">4282881c6<a href="https://github.com/tarantool/tarantool/commit/4282881c638ce50b74d3fc75369d63a48da04324">">xlog: fix fallocate vs read race posix_fallocate(), which is used for preallocating disk space for WAL files, increases the file size and fills the allocated space with zeros. The problem is a WAL file may be read by a relay thread at the same time it is written to. We try to handle the zeroed space in xlog_cursor (see xlog_cursor_next_tx()), however this turns out to be not enough, because transactions are written not atomically so it may occur that a writer writes half a transaction when a reader reads it. Without fallocate, the reader would stop at EOF until the rest of the transaction is written, but with fallocate it reads zeroes instead and thinks that the xlog file is corrupted while actually it is not. Fix this issue by using fallocate() with FALLOC_FL_KEEP_SIZE flag instead of posix_fallocate(). With the flag fallocate() won&#39;t increase the file size, it will only allocate disk space beyond EOF. Closes #3883 (cherry picked from commit </a><a class="double-link" href="https://github.com/tarantool/tarantool/commit/<a class="double-link" href="https://github.com/tarantool/tarantool/commit/b9db91e1cdcc97c269703420c7b292e0f125f0ec">b9db91e1c</a>">b9db91e1c</a><a href="https://github.com/tarantool/tarantool/commit/4282881c638ce50b74d3fc75369d63a48da04324">)
41008 of 49918 relevant lines covered (82.15%)
846882.91 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|