Skip to content
Snippets Groups Projects
Commit 8e040375 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Konstantin Osipov
Browse files

xlog: use coeio in xdir_collect_garbage to unlink files from tx

Since xdir_collect_garbage() uses unlink() to remove files, vylog calls
it from a coeio thread so as not to block tx. This is error-prone,
because the vylog xdir is modified from tx so if garbage collection
races with log rotation, the behavior is undefined. Let's add an
argument to xdir_collect_garbage() specifying whether it should unlink
files with unlink() or coeio_unlink(), and call it directly from tx,
without the use of a coeio task.

Also, add a return code to xdir_collect_garbage(), which is set to 0 on
success or to -1 in case the function failed to delete a file. It will
be used in the following patch.
parent 8ec4b2c8
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment