From 22f46c329d6bab74f365d1290832a4f22934dce8 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Wed, 1 Oct 2014 18:58:50 +0900 Subject: [PATCH] Add annoying & verbose TODO reminder for FILL implementation fixing! --- prototype/corfurl/src/corfurl.erl | 1 + prototype/corfurl/src/corfurl_flu.erl | 1 + 2 files changed, 2 insertions(+) diff --git a/prototype/corfurl/src/corfurl.erl b/prototype/corfurl/src/corfurl.erl index cfb8f82..660e419 100644 --- a/prototype/corfurl/src/corfurl.erl +++ b/prototype/corfurl/src/corfurl.erl @@ -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, diff --git a/prototype/corfurl/src/corfurl_flu.erl b/prototype/corfurl/src/corfurl_flu.erl index 759afca..c092761 100644 --- a/prototype/corfurl/src/corfurl_flu.erl +++ b/prototype/corfurl/src/corfurl_flu.erl @@ -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};