You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2016/08/15 06:58:41 UTC

couch-replicator commit: updated refs/heads/3104-fix-replicator-manager-changes-feed-checkpoint to 40a0876

Repository: couchdb-couch-replicator
Updated Branches:
  refs/heads/3104-fix-replicator-manager-changes-feed-checkpoint [created] 40a087630


Fix replicator manager `stop` change feed callback

```
changes_reader_cb({stop, EndSeq, _Pending}, ...) ->
   ...
```

at one point used to handle changes from `fabric:changes`. It was later
optimized to use shard change feeds, but shard change feed callbacks don't get
pending info with the `stop` message.

As a result replicator manager would always rescan all the changes in a shard
on any new change.

For reference, where `couch_changes.erl` calls the callback:
 https://github.com/apache/couchdb-couch/blob/master/src/couch_changes.erl#L654

Jira: COUCHDB-3104


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/40a08763
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/40a08763
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/40a08763

Branch: refs/heads/3104-fix-replicator-manager-changes-feed-checkpoint
Commit: 40a087630b9b6688fe2db87f1e8adc7972c4a0c9
Parents: c233bea
Author: Nick Vatamaniuc <va...@gmail.com>
Authored: Mon Aug 15 02:50:56 2016 -0400
Committer: Nick Vatamaniuc <va...@gmail.com>
Committed: Mon Aug 15 02:50:56 2016 -0400

----------------------------------------------------------------------
 src/couch_replicator_manager.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/40a08763/src/couch_replicator_manager.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_manager.erl b/src/couch_replicator_manager.erl
index c36526d..cb38133 100644
--- a/src/couch_replicator_manager.erl
+++ b/src/couch_replicator_manager.erl
@@ -388,7 +388,7 @@ changes_reader_cb({change, Change, _}, _, {Server, DbName, Epoch}) ->
             ok
     end,
     {Server, DbName, Epoch};
-changes_reader_cb({stop, EndSeq, _Pending}, _, {Server, DbName, Epoch}) ->
+changes_reader_cb({stop, EndSeq}, _, {Server, DbName, Epoch}) ->
     Msg = {rep_db_checkpoint, DbName, EndSeq},
     ok = gen_server:call(Server, Msg, infinity),
     {Server, DbName, Epoch};