Commits

Anonymous committed 2224be8

better faster reaping of tombstoned records

  • Participants
  • Parent commits 210375d

Comments (0)

Files changed (1)

File src/riak_delete.erl

             case Reply of
                 ok -> 
                     spawn(
-                      fun()-> reap(Bucket,Key,RemainingTime,Timeout,ReqId) end);
+                      fun()-> reap(Bucket,Key,Timeout,ReqId) end);
                 _ -> nop
             end,
             riak_eventer:notify(riak_delete, delete_reply, {ReqId, Reply}),
             Client ! {ReqId, X}
     end.
 
-reap(Bucket, Key, WaitTime, Timeout, ReqId) ->
-    timer:sleep(WaitTime),
+reap(Bucket, Key, Timeout, ReqId) ->
     {ok,C} = riak:local_client(),
-    case C:get(Bucket,Key,1,Timeout) of
+    {ok, Ring} = riak_ring_manager:get_my_ring(),
+    BucketProps = riak_bucket:get_bucket(Bucket, Ring),
+    N = proplists:get_value(n_val,BucketProps),
+    case C:get(Bucket,Key,N,Timeout) of
         {error, notfound} ->
             riak_eventer:notify(riak_delete, finalize_reap, 
                                 {ReqId, Bucket, Key, ok});