summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-05-23 21:49:04 +0000
committerDamien F. Katz <damien@apache.org>2008-05-23 21:49:04 +0000
commit2d2c585d756d21231249909fb014f69da27e4edb (patch)
treea2ced328b6887982b8d48c1dff8cf0056ce79d02 /src
parent59a89fd650f4c419c5b2a6ea50ad6b1610fa8a10 (diff)
fix for missing conflict check during serialized update
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@659676 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_db.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index 67e64730..4cc7c91f 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -121,7 +121,7 @@ start_compact(MainPid) ->
delete_doc(MainPid, Id, Revisions) ->
DeletedDocs = [#doc{id=Id, revs=[Rev], deleted=true} || Rev <- Revisions],
- {ok, [Result]} = update_docs(MainPid, DeletedDocs, [new_edits]),
+ {ok, [Result]} = update_docs(MainPid, DeletedDocs, []),
{ok, Result}.
open_doc(MainPid, IdOrDocInfo) ->
@@ -291,13 +291,13 @@ update_docs(MainPid, Docs, Options) ->
% flush unwritten binaries to disk.
DocBuckets3 = [[doc_flush_binaries(Doc, Db#db.fd) || Doc <- Bucket] || Bucket <- DocBuckets2],
- case gen_server:call(MainPid, {update_docs, DocBuckets3, Options}) of
+ case gen_server:call(MainPid, {update_docs, DocBuckets3, [new_edits | Options]}) of
ok -> {ok, NewRevs};
retry ->
Db2 = get_db(MainPid),
DocBuckets4 = [[doc_flush_binaries(Doc, Db2#db.fd) || Doc <- Bucket] || Bucket <- DocBuckets3],
% We only retry once
- case gen_server:call(MainPid, {update_docs, DocBuckets4, Options}) of
+ case gen_server:call(MainPid, {update_docs, DocBuckets4, [new_edits | Options]}) of
ok -> {ok, NewRevs};
Else -> throw(Else)
end;
@@ -838,7 +838,7 @@ update_docs_int(Db, DocsList, Options) ->
end, {0, 0}, OldDocLookups),
% Merge the new docs into the revision trees.
- NoConflicts = lists:member(no_conflicts, Options),
+ NoConflicts = lists:member(new_edits, Options),
{ok, NewDocInfos, NewSeq} = merge_rev_trees(NoConflicts, DocsList2, OldDocInfos, [], LastSeq),
RemoveSeqs =