couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r936996 - in /couchdb/trunk: share/www/script/test/compact.js src/couchdb/couch_db_updater.erl
Date Thu, 22 Apr 2010 18:26:42 GMT
Author: kocolosk
Date: Thu Apr 22 18:26:42 2010
New Revision: 936996

URL: http://svn.apache.org/viewvc?rev=936996&view=rev
Log:
compaction preserves instance_start_time. Closes COUCHDB-744

Modified:
    couchdb/trunk/share/www/script/test/compact.js
    couchdb/trunk/src/couchdb/couch_db_updater.erl

Modified: couchdb/trunk/share/www/script/test/compact.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/compact.js?rev=936996&r1=936995&r2=936996&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/compact.js (original)
+++ couchdb/trunk/share/www/script/test/compact.js Thu Apr 22 18:26:42 2010
@@ -31,6 +31,7 @@ couchTests.compact = function(debug) {
   T(db.save(binAttDoc).ok);
 
   var originalsize = db.info().disk_size;
+  var start_time = db.info().instance_start_time;
 
   for(var i in docs) {
       db.deleteDoc(docs[i]);
@@ -43,6 +44,7 @@ couchTests.compact = function(debug) {
   T(db.last_req.status == 202);
   // compaction isn't instantaneous, loop until done
   while (db.info().compact_running) {};
+  T(db.info().instance_start_time == start_time);
 
   T(db.ensureFullCommit().ok);
   restartServer();

Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=936996&r1=936995&r2=936996&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Thu Apr 22 18:26:42 2010
@@ -161,8 +161,12 @@ handle_cast({compact_done, CompactFilepa
                 fun(Value, _Offset, Acc) -> {ok, [Value | Acc]} end, []),
         {ok, NewLocalBtree} = couch_btree:add(NewDb#db.local_docs_btree, LocalDocs),
 
-        NewDb2 = commit_data( NewDb#db{local_docs_btree=NewLocalBtree,
-                main_pid = Db#db.main_pid,filepath = Filepath}),
+        NewDb2 = commit_data(NewDb#db{
+            local_docs_btree = NewLocalBtree,
+            main_pid = Db#db.main_pid,
+            filepath = Filepath,
+            instance_start_time = Db#db.instance_start_time
+        }),
 
         ?LOG_DEBUG("CouchDB swapping files ~s and ~s.",
                 [Filepath, CompactFilepath]),



Mime
View raw message