Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Merge revision 1136639 from trunk
Browse files Browse the repository at this point in the history
    Human readable message on view compaction error  

    When a view has duplicated document IDs in the main btree,
    the view compactor exists. Unfortunatelly its exit reason is
    not human readable because it's an IOList.
    This patch improves the error message and logs it with an
    'error' level.

    Issue reported by Mike Leddy in ticket COUCHDB-999.



git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1136640 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
fdmanana committed Jun 16, 2011
1 parent d5da180 commit f0aaa2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/couchdb/couch_view_compactor.erl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ compact_group(Group, EmptyGroup) ->

Fun = fun({DocId, _ViewIdKeys} = KV, {Bt, Acc, TotalCopied, LastId}) ->
if DocId =:= LastId -> % COUCHDB-999
Msg = "Duplicates of ~s detected in ~s ~s - rebuild required",
exit(io_lib:format(Msg, [DocId, DbName, GroupId]));
?LOG_ERROR("Duplicates of document `~s` detected in view group `~s`"
", database `~s` - view rebuild, from scratch, is required",
[DocId, GroupId, DbName]),
exit({view_duplicated_id, DocId});
true -> ok end,
if TotalCopied rem 10000 =:= 0 ->
couch_task_status:update("Copied ~p of ~p Ids (~p%)",
Expand Down

0 comments on commit f0aaa2c

Please sign in to comment.