diff options
author | Damien F. Katz <damien@apache.org> | 2009-01-05 05:42:52 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-01-05 05:42:52 +0000 |
commit | 10eac24f530b5de1ea30c83518d3971f99890db6 (patch) | |
tree | f5565b0002ec028538c78b65febaddb675297596 /share/www/script/couch_tests.js | |
parent | 4228d249b4216d390aa1f8f063d09527c4dcbe6a (diff) |
Delayed commit patch. Allows documents to be saved immediately but fully committed asynchronously. On by default, to fully commit documents synchronously, use X-Couch-Full-Commit=true in the http header. We still needs to prevent committing view indexes ahead of data and to detect when a server has crashed causing potentially lost updates during remote replication (fixed by retrying the incremental replication).
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@731452 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/couch_tests.js')
-rw-r--r-- | share/www/script/couch_tests.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index f553435e..dbc70325 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -130,7 +130,11 @@ var tests = { T(db.open(existingDoc._id, {rev: existingDoc._rev}) != null); // make sure restart works + T(db.ensureFullCommit().ok); restartServer(); + + // make sure we can still open + T(db.open(existingDoc._id, {rev: existingDoc._rev}) != null); }, all_docs: function(debug) { var db = new CouchDB("test_suite_db"); @@ -1173,6 +1177,7 @@ var tests = { } T(db.view("test/no_docs").total_rows == 0) T(db.view("test/single_doc").total_rows == 1) + T(db.ensureFullCommit().ok); restartServer(); }; @@ -1214,7 +1219,8 @@ var tests = { T(db.deleteDoc(designDoc).ok); T(db.open(designDoc._id) == null); T(db.view("test/no_docs") == null); - + + T(db.ensureFullCommit().ok); restartServer(); T(db.open(designDoc._id) == null); T(db.view("test/no_docs") == null); @@ -2327,6 +2333,7 @@ var tests = { // compaction isn't instantaneous, loop until done while (db.info().compact_running) {}; + T(db.ensureFullCommit().ok); restartServer(); var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"); T(xhr.responseText == "This is a base64 encoded text") |