You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2010/04/22 20:28:24 UTC
svn commit: r936997 - in /couchdb/branches/0.11.x:
share/www/script/test/compact.js src/couchdb/couch_db_updater.erl
Author: kocolosk
Date: Thu Apr 22 18:28:23 2010
New Revision: 936997
URL: http://svn.apache.org/viewvc?rev=936997&view=rev
Log:
compaction preserves instance_start_time. Closes COUCHDB-744
Modified:
couchdb/branches/0.11.x/share/www/script/test/compact.js
couchdb/branches/0.11.x/src/couchdb/couch_db_updater.erl
Modified: couchdb/branches/0.11.x/share/www/script/test/compact.js
URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/share/www/script/test/compact.js?rev=936997&r1=936996&r2=936997&view=diff
==============================================================================
--- couchdb/branches/0.11.x/share/www/script/test/compact.js (original)
+++ couchdb/branches/0.11.x/share/www/script/test/compact.js Thu Apr 22 18:28:23 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/branches/0.11.x/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/src/couchdb/couch_db_updater.erl?rev=936997&r1=936996&r2=936997&view=diff
==============================================================================
--- couchdb/branches/0.11.x/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/branches/0.11.x/src/couchdb/couch_db_updater.erl Thu Apr 22 18:28:23 2010
@@ -158,8 +158,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]),