summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep_db_listener.erl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-23 15:50:26 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-23 15:50:26 +0000
commit5dcc10a9ad8b180431bee49cc1b36a8f0859ff71 (patch)
tree9014fbe569ae9af2c3ad91027a1729ecafe79e8a /src/couchdb/couch_rep_db_listener.erl
parent1b07ac052dd87d5dd255ebc328e9b8e66fac21c5 (diff)
Merged revision 1038172 from trunk:
Replicator DB: added underscore prefix to the replication document fields that are meant to to be set/updated only by the replicator. This makes it more clear to end users that those fields are meant to be used internally by CouchDB. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1038173 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_db_listener.erl')
-rw-r--r--src/couchdb/couch_rep_db_listener.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/couchdb/couch_rep_db_listener.erl b/src/couchdb/couch_rep_db_listener.erl
index 5a5ab164..e4e8b246 100644
--- a/src/couchdb/couch_rep_db_listener.erl
+++ b/src/couchdb/couch_rep_db_listener.erl
@@ -156,7 +156,7 @@ process_change({Change}) ->
true ->
rep_doc_deleted(DocId);
false ->
- case couch_util:get_value(<<"state">>, RepProps) of
+ case couch_util:get_value(<<"_replication_state">>, RepProps) of
<<"completed">> ->
replication_complete(DocId);
<<"error">> ->
@@ -166,8 +166,8 @@ process_change({Change}) ->
undefined ->
maybe_start_replication(DocId, JsonRepDoc);
_ ->
- ?LOG_ERROR("Invalid value for the `state` property of the "
- "replication document `~s`", [DocId])
+ ?LOG_ERROR("Invalid value for the `_replication_state` property"
+ " of the replication document `~s`", [DocId])
end
end,
ok.
@@ -201,13 +201,13 @@ maybe_start_replication(DocId, JsonRepDoc) ->
maybe_tag_rep_doc(DocId, {Props} = JsonRepDoc, RepId, OtherDocId) ->
- case couch_util:get_value(<<"replication_id">>, Props) of
+ case couch_util:get_value(<<"_replication_id">>, Props) of
RepId ->
ok;
_ ->
?LOG_INFO("The replication specified by the document `~s` was already"
" triggered by the document `~s`", [DocId, OtherDocId]),
- couch_rep:update_rep_doc(JsonRepDoc, [{<<"replication_id">>, RepId}])
+ couch_rep:update_rep_doc(JsonRepDoc, [{<<"_replication_id">>, RepId}])
end.
@@ -222,11 +222,11 @@ start_replication({RepProps} = RepDoc, {Base, Ext} = RepId, UserCtx) ->
couch_rep:update_rep_doc(
RepDoc,
[
- {<<"state">>, <<"error">>},
- {<<"replication_id">>, ?l2b(element(1, RepId))}
+ {<<"_replication_state">>, <<"error">>},
+ {<<"_replication_id">>, ?l2b(Base)}
]
),
- ?LOG_ERROR("Error starting replication ~p: ~p", [RepId, Error])
+ ?LOG_ERROR("Error starting replication `~s`: ~p", [Base ++ Ext, Error])
end.
rep_doc_deleted(DocId) ->