anchor.diff:      end;
   run(merge, _KeyGen, _ValueGen, State) ->
       case bitcask:needs_merge(State#state.file) of
  -        {true, _} ->
  -            {ElapsedUs, ok} = timer:tc(bitcask, merge, [State#state.filename]),
  -            io:format(user, "Merged in ~p seconds\n", [ElapsedUs / 1000000]),
  -            {ok, State};
  +        {true, Files} ->
  +            case bitcask_merge_worker:merge(State#state.filename, State#state.flags,
  +                                            Files) of
  +                ok ->
  +                    {ok, State};
  +                Other ->
  +                    {error, {merge_failed, Other}}
  +            end;
           false ->
               {ok, State}
       end.
  
positive.code: 
  -record(state, { file,
                   filename,
                   sync_interval,
                   last_sync }).
  
  
negative.code:         {error, Reason} ->
              ?FAIL_MSG("Failed to open bitcask in ~s: ~p\n", [Filename, Reason]);
          File ->
              %% Try to start the merge worker
              bitcask_merge_worker:start_link(),
              {ok, #state { file = File,
                            filename = Filename,
                            flags = Flags,
                            sync_interval = SyncInterval,
                            last_sync = os:timestamp() }}
      end.
  