summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2009-04-27 19:08:33 +0000
committerDamien F. Katz <damien@apache.org>2009-04-27 19:08:33 +0000
commitf5d752a3c5f1c05962a7b693b54636967bfa7a5d (patch)
tree6af66ef375bf44ba6f2b83b53fea4e366a81cfdc /src/couchdb
parent37541bbf91d09ad0200f2c26c7a3f79fdf050801 (diff)
Fix and test for COUCHDB-334 where a database with delayed commits pending is considered idle, and subject to losing changes when shutdown
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@769109 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_db.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index a4b79ae5..db865482 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -691,11 +691,11 @@ terminate(Reason, _Db) ->
handle_call({open_ref_count, OpenerPid}, _, #db{fd_ref_counter=RefCntr}=Db) ->
ok = couch_ref_counter:add(RefCntr, OpenerPid),
{reply, {ok, Db}, Db};
-handle_call(is_idle, _From,
- #db{fd_ref_counter=RefCntr, compactor_pid=Compact}=Db) ->
+handle_call(is_idle, _From, #db{fd_ref_counter=RefCntr, compactor_pid=Compact,
+ waiting_delayed_commit=Delay}=Db) ->
% Idle means no referrers. Unless in the middle of a compaction file switch,
% there are always at least 2 referrers, couch_db_updater and us.
- {reply, (Compact == nil) and (couch_ref_counter:count(RefCntr) == 2), Db};
+ {reply, (Delay == nil) and (Compact == nil) and (couch_ref_counter:count(RefCntr) == 2), Db};
handle_call({db_updated, #db{fd_ref_counter=NewRefCntr}=NewDb}, _From,
#db{fd_ref_counter=OldRefCntr}) ->
case NewRefCntr == OldRefCntr of