anchor.diff:                         eviction_policy_cfg_string(BucketConfig, ItemEvictionPolicy,
                                                     EphemeralFullPolicy)]),
                   CFG1 = metadata_purge_age_cfg_string(EphemeralPurgeAge) ++ CFG,
  -                {CFG1, {MemQuota, DBSubDir, NumThreads, ItemEvictionPolicy, EphemeralFullPolicy,
  +                CFG2 = ht_size_cfg_string(BucketConfig) ++ CFG1,
  +                {CFG2, {MemQuota, DBSubDir, NumThreads, ItemEvictionPolicy, EphemeralFullPolicy,
                          DriftThresholds, EphemeralPurgeAge}, DBSubDir};
               memcached ->
                   {io_lib:format("cache_size=~B;uuid=~s", [MemQuota, BucketUUID]),
  
positive.code:                 %% MemQuota is our per-node bucket memory limit
                  CFG =
                      io_lib:format(
                        "ht_size=~B;ht_locks=~B;"
                        "max_size=~B;"
                        "dbname=~s;"
                        "backend=couchdb;couch_bucket=~s;max_vbuckets=~B;"
  
negative.code:             [];
          _ ->
              io_lib:format("ephemeral_metadata_purge_age=~p;", [PurgeAge])
      end.
  
  ht_size_cfg_string(BucketConfig) ->
      case proplists:get_value(ht_size, BucketConfig,
                               misc:getenv_int("MEMBASE_HT_SIZE", 0)) of
          0 ->
              [];
          X when is_integer(X) ->
              io_lib:format("ht_size=~B;", [X])
      end.
  
  -spec storage_mode([{_,_}]) -> atom().
  