summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2017-08-03 17:42:24 -0400
committerNick Vatamaniuc <nickva@users.noreply.github.com>2017-08-03 18:07:18 -0400
commit1ba42081779dfea2d4d09af00744ab4667ffd941 (patch)
treec1e9394a595c26f5e1501c8a2ea34323b14fb2d0
parent408096f5537793a057bdcf2a1db01aee9c3f74dd (diff)
downloadcouchdb-1ba42081779dfea2d4d09af00744ab4667ffd941.tar.gz
Allow replicator application to always update replicator docs
Previously when updating the document with the error or failed states the document body will not pass the validation function and will consequently crash either the scheduler or the doc processor.
-rw-r--r--src/couch_replicator/src/couch_replicator_js_functions.hrl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/couch_replicator/src/couch_replicator_js_functions.hrl b/src/couch_replicator/src/couch_replicator_js_functions.hrl
index 9b11e8a59..d41043309 100644
--- a/src/couch_replicator/src/couch_replicator_js_functions.hrl
+++ b/src/couch_replicator/src/couch_replicator_js_functions.hrl
@@ -53,6 +53,11 @@
var isReplicator = (userCtx.roles.indexOf('_replicator') >= 0);
var isAdmin = (userCtx.roles.indexOf('_admin') >= 0);
+ if (isReplicator) {
+ // Always let replicator update the replication document
+ return;
+ }
+
if (newDoc._replication_state === 'failed') {
// Skip validation in case when we update the document with the
// failed state. In this case it might be malformed. However,