Add annoying & verbose TODO reminder for FILL implementation fixing!

This commit is contained in:
Scott Lystig Fritchie 2014-10-01 18:58:50 +09:00
parent 1c5e8d3726
commit 22f46c329d
2 changed files with 2 additions and 0 deletions

View file

@ -261,6 +261,7 @@ trim_page(#proj{epoch=Epoch} = P, LPN) ->
fill_or_trim_page([], _Epoch, _LPN, _Func) ->
ok;
fill_or_trim_page([H|T], Epoch, LPN, Func) ->
%% io:format(user, "~s.erl line ~w: TODO: this 'fill or trim' logic is probably stupid, due to mis-remembering the CORFU paper, sorry! Commenting out this warning line is OK, if you wish to proceed with testing Corfurl. This code can change a fill into a trim. Those things are supposed to be separate, silly me, a fill should never automagically change to a trim.\n", [?MODULE, ?LINE]),
case corfurl_flu:Func(flu_pid(H), Epoch, LPN) of
Res when Res == ok; Res == error_trimmed ->
%% Detecting a race here between fills and trims is too crazy,

View file

@ -213,6 +213,7 @@ handle_call({{fill, ClientEpoch, _LogicalPN}, LC1}, _From,
{reply, {error_badepoch, LC2}, State};
handle_call({{fill, _ClientEpoch, LogicalPN}, LC1}, _From, State) ->
LC2 = lclock_update(LC1),
io:format(user, "~s.erl line ~w: TODO: this 'fill or trim' logic is probably stupid, due to mis-remembering the CORFU paper, sorry! Commenting out this warning line is OK, if you wish to proceed with testing Corfurl. This code can change a fill into a trim. Those things are supposed to be separate, silly me, a fill should never automagically change to a trim.\n", [?MODULE, ?LINE]),
{Reply, NewState} = do_trim_or_fill(fill, LogicalPN, State),
?EVENT_LOG({flu, fill, self(), LogicalPN, Reply}),
{reply, {Reply, LC2}, NewState};