Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Retry merge

  • Loading branch information...
commit 5008271292e9cdf1bcf5aed8b1ba019c240b6549 1 parent 51d803f
@jtuple jtuple authored
Showing with 19 additions and 7 deletions.
  1. +19 −7 src/bitcask_merge_delete.erl
View
26 src/bitcask_merge_delete.erl
@@ -167,16 +167,18 @@ multiple_merges_during_fold_test_body() ->
bitcask:has_setuid_bit(F)])
end,
PutSome(),
- MR=bitcask:merge(Dir),
- ?debugFmt("MR: ~p~n", [MR]),
- Count1 = CountSetuids(),
- true = (Count1 > 0),
+ Count1 = merge_until(Dir, 0, CountSetuids),
+ %% MR=bitcask:merge(Dir),
+ %% ?debugFmt("MR: ~p~n", [MR]),
+ %% Count1 = CountSetuids(),
+ %% true = (Count1 > 0),
PutSome(),
bitcask:merge(Dir),
PutSome(),
- bitcask:merge(Dir),
- Count2 = CountSetuids(),
- true = (Count2 > Count1),
+ merge_until(Dir, Count1, CountSetuids),
+ %% bitcask:merge(Dir),
+ %% Count2 = CountSetuids(),
+ %% true = (Count2 > Count1),
SlowPid ! go_ahead,
timer:sleep(500),
@@ -189,4 +191,14 @@ multiple_merges_during_fold_test_body() ->
throw(fail)
end.
+merge_until(Dir, MinCount, CountSetuids) ->
+ bitcask:merge(Dir),
+ Count = CountSetuids(),
+ if (Count > MinCount) ->
+ Count;
+ true ->
+ timer:sleep(100),
+ merge_until(Dir, MinCount, CountSetuids)
+ end.
+
-endif. %% TEST
Please sign in to comment.
Something went wrong with that request. Please try again.