Commits

Anonymous committed 233fb99

sync dets table on startup and before is_empty check

  • Participants
  • Parent commits 2a3f743

Comments (0)

Files changed (1)

apps/riak/src/riak_dets_backend.erl

                                    {min_no_slots, 8192},
                                    {max_no_slots, 16777216}]) of
         {ok, DetsName} ->
+            io:format("~p~n", [dets:info(DetsName)]),
+            ok = dets:sync(DetsName),
             {ok, #state{table=DetsName, path=TablePath}};
         {error, Reason}  ->
             riak:stop("dets:open_file failed"),
     dets:foldl(Fun, Acc, T).
 
 is_empty(#state{table=T}) ->
+    ok = dets:sync(T),
     dets:info(T, size) =:= 0.
 
 drop(#state{table=T, path=P}) ->