anchor.diff:          ?LOG_INFO("Compaction file still behind main file "
               "(update seq=~p. compact update seq=~p). Retrying.",
               [Db#db.update_seq, NewSeq]),
  -        couch_file:close(NewFd),
  +        close_db(NewDb),
           Pid = spawn_link(fun() -> start_copy_compact(Db) end),
           Db2 = Db#db{compactor_pid=Pid},
           {noreply, Db2}
  
positive.code:     {ok, NewFd} = couch_file:open(CompactFilepath),
      {ok, NewHeader} = couch_file:read_header(NewFd, ?HEADER_SIG),
      #db{update_seq=NewSeq} = NewDb =
              init_db(Db#db.name, CompactFilepath, NewFd, NewHeader),
      case Db#db.update_seq == NewSeq of
      true ->
          % suck up all the local docs into memory and write them to the new db
  
negative.code:                 [Filepath, CompactFilepath]),
          file:delete(Filepath),
          ok = file:rename(CompactFilepath, Filepath),
          close_db(Db),
          ok = gen_server:call(Db#db.main_pid, {db_updated, NewDb2}),
          ?LOG_INFO("Compaction for db \"~s\" completed.", [Db#db.name]),
          {noreply, NewDb2#db{compactor_pid=nil}};
  