anchor.diff:      %% Get the data root directory
       DataDir = filename:join(app_helper:get_prop_or_env(data_root, Config, eleveldb),
                               integer_to_list(Partition)),
  -    case open_db(DataDir, Config) of
  -        {ok, Ref, FinalConfig} ->
  -            S = #state { ref = Ref,
  -                         data_root = DataDir,
  -                         read_opts = config_value(read_options, FinalConfig, []),
  -                         write_opts = config_value(write_options, FinalConfig, []),
  -                         fold_opts = config_value(fold_options, FinalConfig, [{fill_cache, false}]),
  -                         config = FinalConfig },
  -            lager:debug("Partition ~p has initial state: ~p\n", [Partition, S]),
  -            {ok, S};
  +
  +    %% Initialize state
  +    S0 = init_state(DataDir, Config),
  +    case open_db(S0) of
  +        {ok, State} ->
  +            {ok, State};
           {error, Reason} ->
               {error, Reason}
       end.
  
positive.code: %% ===================================================================
  
  %% @private
  open_db(DataRoot, Config) ->
      %% Get the data root directory
      filelib:ensure_dir(filename:join(DataRoot, "dummy")),
  
  
negative.code: %% @doc Delete all objects from this eleveldb backend
  %% and return a fresh reference.
  -spec drop(state()) -> {ok, state()} | {error, term(), state()}.
  drop(State0) ->
      case eleveldb:destroy(State0#state.data_root, []) of
          ok ->
              case open_db(State0) of
                  {ok, State} ->
                      {ok, State};
                  {error, Reason} ->
                      {error, Reason, State0}
              end;
          {error, Reason} ->
              {error, Reason, State0}
      end.
  
  %% @doc Returns true if this eleveldb backend contains any
  