Don't score a rolling file
In giving an empty file a score of 0, a race condition was exposed. A file might not be active, but might still be rolling - and then cna get scored as 0, and immediately compacted. It will then be removed from the journal manifest. Check each file is not rolling before making it a candidate for rolling.
This commit is contained in:
parent
5f7d261a87
commit
808a858d09
2 changed files with 6 additions and 2 deletions
|
@ -307,7 +307,11 @@ handle_cast({compact, Checker, InitiateFun, CloseFun, FilterFun, Manifest0},
|
|||
% Don't want to process a queued call waiting on an old manifest
|
||||
[_Active|Manifest] = Manifest0,
|
||||
{FilterServer, MaxSQN} = InitiateFun(Checker),
|
||||
ok = clerk_scorefilelist(self(), Manifest),
|
||||
NotRollingFun =
|
||||
fun({_LowSQN, _FN, Pid, _LK}) ->
|
||||
not leveled_cdb:cdb_isrolling(Pid)
|
||||
end,
|
||||
ok = clerk_scorefilelist(self(), lists:filter(NotRollingFun, Manifest)),
|
||||
ScoringState =
|
||||
#scoring_state{filter_fun = FilterFun,
|
||||
filter_server = FilterServer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue