Skip to content

Commit

Permalink
don't delete view groups that fail to open
Browse files Browse the repository at this point in the history
...but log a message instead. Fixes COUCHDB-1445.

Patch from Randall Leeds <randall@apache.org>
asf commit-id: 10202bfe2b5e573598b7aa1a0cd7e02de13cf2a7
  • Loading branch information
benoitc committed Nov 10, 2012
1 parent 77dd0e1 commit f702029
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/couch_mrview/src/couch_mrview_index.erl
Expand Up @@ -19,6 +19,7 @@
-export([compact/3, swap_compacted/2]).


-include_lib("couch/include/couch_db.hrl").
-include_lib("couch_mrview/include/couch_mrview.hrl").


Expand Down Expand Up @@ -93,8 +94,9 @@ open(Db, State) ->
NewSt = couch_mrview_util:reset_index(Db, Fd, State),
{ok, NewSt#mrst{fd_monitor=erlang:monitor(process, Fd)}}
end;
Error ->
(catch couch_mrview_util:delete_files(DbName, Sig)),
{error, Reason} = Error ->
?LOG_ERROR("Failed to open view file '~s': ~s",
[IndexFName, file:format_error(Reason)]),
Error
end.

Expand Down

0 comments on commit f702029

Please sign in to comment.