anchor.diff:                        check_period(Config)
                 end,
   
  +              case bucket_exists(BucketName) of
  +                  true ->
  +                      ok;
  +                  false ->
  +                      %% bucket's gone; so just terminate normally
  +                      exit(normal)
  +              end,
  +
                 AllBucketDbs = all_bucket_dbs(BucketName),
   
                 %% In certain cases some of the databases might not exists yet
  
positive.code:     Buckets =
          case Buckets0 of
              [] ->
                  [list_to_binary(Bucket) ||
                      Bucket <- ns_bucket:get_bucket_names(membase)];
              _ ->
                  Buckets0
          end,
  
negative.code:         true ->
              {missing, R}
      end.
  
  bucket_exists(BucketName) ->
      case ns_bucket:get_bucket_light(binary_to_list(BucketName)) of
          {ok, Config} ->
              (ns_bucket:bucket_type(Config) =:= membase) andalso
                  lists:member(node(), ns_bucket:bucket_nodes(Config));
          not_present ->
              false
      end.
  