anchor.diff:      proc_lib:init_ack({ok, self()}),
       Sock = connect(),
       StartTime = now(),
  -    ensure_bucket(Sock, Bucket),
  +    ok = ensure_bucket(Sock, Bucket),
       wait_for_warmup(Sock),
       ns_log:log(?MODULE, 1, "Bucket ~p loaded on node ~p in ~p seconds.",
                  [Bucket, node(), timer:now_diff(now(), StartTime) div 1000000]),
  
positive.code: 
  
  ensure_bucket(Sock, Bucket) ->
      {Engine, ConfigString,
       BucketType, ExtraParams} = ns_bucket:config_string(Bucket),
      case mc_client_binary:select_bucket(Sock, Bucket) of
          ok ->
              ensure_bucket_config(Sock, Bucket, BucketType, ExtraParams);
          {memcached_error, key_enoent, _} ->
              case mc_client_binary:create_bucket(Sock, Bucket, Engine,
                                                  ConfigString) of
                  ok ->
                      ok = mc_client_binary:select_bucket(Sock, Bucket);
                  {memcached_error, key_eexists, <<"Bucket exists: stopping">>} ->
                      %% Waiting for an old bucket with this name to shut down
                      timer:sleep(1000),
                      ensure_bucket(Sock, Bucket);
                  Error ->
                      exit({bucket_create_error, Error})
              end;
          Error ->
              exit({bucket_select_error, Error})
      end.
  
  
  
negative.code:         X2 when is_binary(X2) ->
              ?log_info("Changing dbname of ~p from ~s to ~s", [Bucket, X2,
                                                                DBDirBin]),
              %% Just exit; this will delete and recreate the bucket
              exit(normal)
      end;
  ensure_bucket_config(Sock, _Bucket, memcached, _MaxSize) ->
      %% TODO: change max size of memcached bucket also
  