You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2018/07/23 14:16:03 UTC
[couchdb] 02/03: hackish idempotency
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a commit to branch user-partitioned-dbs-wip
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f89bc9ef79c5b0cc9db0402886e98349e0b5e004
Author: Robert Newson <rn...@apache.org>
AuthorDate: Mon Jul 23 13:17:50 2018 +0100
hackish idempotency
---
src/couch_mrview/include/couch_mrview.hrl | 1 +
src/couch_mrview/src/couch_mrview_util.erl | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/couch_mrview/include/couch_mrview.hrl b/src/couch_mrview/include/couch_mrview.hrl
index 094b1d5..a3ba4b6 100644
--- a/src/couch_mrview/include/couch_mrview.hrl
+++ b/src/couch_mrview/include/couch_mrview.hrl
@@ -88,6 +88,7 @@
conflicts,
callback,
sorted = true,
+ updated = false,
partitioned,
partition,
extra = []
diff --git a/src/couch_mrview/src/couch_mrview_util.erl b/src/couch_mrview/src/couch_mrview_util.erl
index 9ebee00..55f1b06 100644
--- a/src/couch_mrview/src/couch_mrview_util.erl
+++ b/src/couch_mrview/src/couch_mrview_util.erl
@@ -578,6 +578,9 @@ validate_args(Args) ->
Args.
+update_args(#mrargs{updated=true} = Args, _Options) -> % hackish idempotencies
+ Args;
+
update_args(#mrargs{} = Args, Options) ->
GroupLevel = determine_group_level(Args),
@@ -598,7 +601,8 @@ update_args(#mrargs{} = Args, Options) ->
end_key_docid=EKDocId,
group_level=GroupLevel
},
- partition_mrargs(Args1, Options).
+ Args2 = partition_mrargs(Args1, Options),
+ Args2#mrargs{updated = true}.
validate_and_update_args(#mrargs{} = Args) ->