summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-06-16 20:06:15 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2011-06-16 20:06:15 +0000
commitf0aaa2c3c7f6bbb858b40a55267781f1bcde0f67 (patch)
treef8abdd3b6458eded8f89dd4abf147ac8bfff0488
parentd5da180b06b8711c72bf38e35c380a25804e018f (diff)
Merge revision 1136639 from trunk
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
-rw-r--r--src/couchdb/couch_view_compactor.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/couchdb/couch_view_compactor.erl b/src/couchdb/couch_view_compactor.erl
index 9a47f5f8..8eda43e9 100644
--- a/src/couchdb/couch_view_compactor.erl
+++ b/src/couchdb/couch_view_compactor.erl
@@ -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%)",