Anonymous avatar Anonymous committed 2224be8

better faster reaping of tombstoned records

Comments (0)

Files changed (1)

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});
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.