anchor.diff:      true = ets:delete_all_objects(?ATIMES),
       St#st{cur_size=0}.
   
  -maybe_spawn_shard_writer(DbName, Shards) ->
  +maybe_spawn_shard_writer(DbName, Shards, IdleTimeout) ->
       case ets:member(?OPENERS, DbName) of
           true ->
               ignore;
           false ->
  -            spawn_shard_writer(DbName, Shards)
  -    end.
  -
  -spawn_shard_writer(DbName, Shards) ->
  -    erlang:spawn(fun() -> shard_writer(DbName, Shards) end).
  -
  -shard_writer(DbName, Shards) ->
  +            spawn_shard_writer(DbName, Shards, IdleTimeout)
  +    end.
  +
  +spawn_shard_writer(DbName, Shards, IdleTimeout) ->
  +    erlang:spawn(fun() -> shard_writer(DbName, Shards, IdleTimeout) end).
  +
  +shard_writer(DbName, Shards, IdleTimeout) ->
       try
           receive
               write ->
                   true = ets:insert(?SHARDS, Shards);
               cancel ->
                   ok
  -        after ?WRITE_IDLE_TIMEOUT ->
  +        after IdleTimeout ->
               ok
           end
       after
           true = ets:delete_object(?OPENERS, {DbName, self()})
       end.
   
  -flush_write(DbName, Writer) ->
  +flush_write(DbName, Writer, WriteTimeout) ->
       Ref = erlang:monitor(process, Writer),
       Writer ! write,
       receive
  
positive.code:     filter_shards_by_name(Name, [S|Matches], Ss);
  filter_shards_by_name(Name, Matches, [_|Ss]) ->
      filter_shards_by_name(Name, Matches, Ss).
  
negative.code:             ok;
          {'DOWN', Ref, _, _, Error} ->
              erlang:exit({mem3_shards_bad_write, Error})
      after WriteTimeout ->
          erlang:exit({mem3_shards_write_timeout, DbName})
      end.
  
  