Author: fdmanana Date: Thu Jun 16 20:06:15 2011 New Revision: 1136640 URL: http://svn.apache.org/viewvc?rev=1136640&view=rev Log: 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. Modified: couchdb/branches/1.1.x/src/couchdb/couch_view_compactor.erl Modified: couchdb/branches/1.1.x/src/couchdb/couch_view_compactor.erl URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_view_compactor.erl?rev=1136640&r1=1136639&r2=1136640&view=diff ============================================================================== --- couchdb/branches/1.1.x/src/couchdb/couch_view_compactor.erl (original) +++ couchdb/branches/1.1.x/src/couchdb/couch_view_compactor.erl Thu Jun 16 20:06:15 2011 @@ -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%)",