couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1027228 - in /couchdb/branches/1.0.x: share/www/script/test/design_docs.js src/couchdb/couch_view_group.erl
Date Mon, 25 Oct 2010 18:28:15 GMT
Author: fdmanana
Date: Mon Oct 25 18:28:14 2010
New Revision: 1027228

URL: http://svn.apache.org/viewvc?rev=1027228&view=rev
Log:
Merged revision 1027215 from trunk:

GET /db/_design/doc/_info should not trigger an update.
Closes COUCHDB-858.

Patch by Klaus Trainer. Thanks Klaus.

Modified:
    couchdb/branches/1.0.x/share/www/script/test/design_docs.js
    couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl

Modified: couchdb/branches/1.0.x/share/www/script/test/design_docs.js
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/share/www/script/test/design_docs.js?rev=1027228&r1=1027227&r2=1027228&view=diff
==============================================================================
--- couchdb/branches/1.0.x/share/www/script/test/design_docs.js (original)
+++ couchdb/branches/1.0.x/share/www/script/test/design_docs.js Mon Oct 25 18:28:14 2010
@@ -93,15 +93,37 @@ function() {
   T(xhr.status == 200);
   TEquals("javascript", JSON.parse(xhr.responseText).language);
 
+  var prev_view_sig = db.designInfo("_design/test").view_index.signature;
+
+  db.bulkSave(makeDocs(1, numDocs + 1));
+
   // test that we get design doc info back
   var dinfo = db.designInfo("_design/test");
   TEquals("test", dinfo.name);
   var vinfo = dinfo.view_index;
   TEquals(51, vinfo.disk_size);
   TEquals(false, vinfo.compact_running);
-  TEquals("3f88e53b303e2342e49a66c538c30679", vinfo.signature);
+  // test that GET /db/_design/test/_info
+  // hasn't triggered an update of the views
+  TEquals(prev_view_sig, vinfo.signature, 'ddoc sig');
+  for (var loop = 0; loop < 2; loop++) {
+    T(db.view("test/all_docs_twice", {stale: "ok"}).total_rows === 0);
+    T(db.view("test/single_doc", {stale: "ok"}).total_rows === 0);
+    T(db.view("test/summate", {stale: "ok"}).rows.length === 0);
+    T(db.ensureFullCommit().ok);
+    restartServer();
+  };
 
-  db.bulkSave(makeDocs(1, numDocs + 1));
+  // test that POST /db/_view_cleanup
+  // doesn't trigger an update of the views
+  T(db.viewCleanup().ok);
+  for (var loop = 0; loop < 2; loop++) {
+    T(db.view("test/all_docs_twice", {stale: "ok"}).total_rows == 0);
+    T(db.view("test/single_doc", {stale: "ok"}).total_rows == 0);
+    T(db.view("test/summate", {stale: "ok"}).rows.length == 0);
+    T(db.ensureFullCommit().ok);
+    restartServer();
+  };
 
   // test that the _all_docs view returns correctly with keys
   var results = db.allDocs({startkey:"_design", endkey:"_design0"});
@@ -112,9 +134,9 @@ function() {
     for (var i = 0; i < numDocs; i++) {
       T(rows[2*i].key == i+1);
       T(rows[(2*i)+1].key == i+1);
-    }
-    T(db.view("test/no_docs").total_rows == 0)
-    T(db.view("test/single_doc").total_rows == 1)
+    };
+    T(db.view("test/no_docs").total_rows == 0);
+    T(db.view("test/single_doc").total_rows == 1);
     T(db.ensureFullCommit().ok);
     restartServer();
   };

Modified: couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl?rev=1027228&r1=1027227&r2=1027228&view=diff
==============================================================================
--- couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl (original)
+++ couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl Mon Oct 25 18:28:14 2010
@@ -85,15 +85,10 @@ init({InitArgs, ReturnPid, Ref}) ->
             ignore;
         _ ->
             couch_db:monitor(Db),
-            Owner = self(),
-            Pid = spawn_link(
-                fun()-> couch_view_updater:update(Owner, Group) end
-            ),
             {ok, RefCounter} = couch_ref_counter:start([Fd]),
             {ok, #group_state{
                     db_name=couch_db:name(Db),
                     init_args=InitArgs,
-                    updater_pid = Pid,
                     group=Group,
                     ref_counter=RefCounter}}
         end;



Mime
View raw message