anchor.diff:      end,
   
       %% effectful
  -    ensure_can_db_compact(Db#db.name, SizeInfo),
  +    ensure_can_db_compact(DbName, SizeInfo),
   
       ?log_info("Compacting ~p", [DbName]),
       Ret = case VBucket of
                 master ->
                     compact_master_vbucket(BucketName, DbName);
                 _ ->
  -                  ns_memcached:compact_vbucket(binary_to_list(BucketName), VBucket, Options)
  +                  ns_memcached:compact_vbucket(Bucket, VBucket, Options)
             end,
       ?log_info("Compaction of ~p has finished with ~p", [DbName, Ret]),
       Ret.
  
positive.code: 
      file_needs_compaction(DataSize, FileSize, FragThreshold, MinFileSize).
  
  maybe_compact_vbucket(BucketName, {VBucket, DbName} = VBucketAndDb,
                        Config, Force, Options) ->
      Db = open_db_or_fail(BucketName, VBucketAndDb),
  
      SizeInfo = try
                     {ok, DbInfo} = couch_db:get_db_info(Db),
                     db_size_info(DbInfo)
                 after
                     couch_db:close(Db)
                 end,
  
      case Force orelse vbucket_needs_compaction(SizeInfo, Config) of
  
negative.code:                                     [BucketName]),
                            true;
                        false ->
                            bucket_needs_compaction(BucketName, Total - 1, Config)
                    end,
  
                DoCompact orelse exit(normal),
  
                ?log_info("Compacting databases for bucket ~s", [BucketName]),
  
                TriggerType = case Force of
                                  true ->
                                      manual;
  