From 638a45e8cb1982d69de38f2003603be0b685a581 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Tue, 25 Feb 2014 14:53:35 +0900 Subject: [PATCH] Partial fix for model problem in honest write-vs-trim race --- prototype/corfurl/test/corfurl_pulse.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/prototype/corfurl/test/corfurl_pulse.erl b/prototype/corfurl/test/corfurl_pulse.erl index 58364b2..98f295b 100644 --- a/prototype/corfurl/test/corfurl_pulse.erl +++ b/prototype/corfurl/test/corfurl_pulse.erl @@ -414,7 +414,14 @@ check_trace(Trace0, _Cmds, _Seed) -> end, Dict1, [X || X={mod_start,_,_,_} <- StEnds]), Dict3 = lists:foldl( fun({mod_end, w_1, LPN, Pg}, D) -> - orddict:store(LPN, [Pg], D); + Vs1 = orddict:fetch(LPN, D), + %% We've written a page. error_unwriten is + %% now impossible; any other binary() is + %% also impossible. However, there may be + %% a trim operation that's still in flight! + Vs2 = [V || V <- Vs1, V /= error_unwritten, + not is_binary(V)], + orddict:store(LPN, [Pg|Vs2], D); ({mod_end, WType, LPN, _Pg}, D) when WType == w_ft; WType == w_tt -> orddict:store(LPN, [error_trimmed], D);