Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AB3D6200C46 for ; Tue, 14 Mar 2017 21:50:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A9E23160B63; Tue, 14 Mar 2017 20:50:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F2A9F160B89 for ; Tue, 14 Mar 2017 21:50:01 +0100 (CET) Received: (qmail 68504 invoked by uid 500); 14 Mar 2017 20:50:01 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 68446 invoked by uid 99); 14 Mar 2017 20:49:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2017 20:49:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 87BEFE00A4; Tue, 14 Mar 2017 20:49:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vatamane@apache.org To: commits@couchdb.apache.org Date: Tue, 14 Mar 2017 20:50:05 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [7/8] couch-replicator commit: updated refs/heads/63012-scheduler to eda73a2 archived-at: Tue, 14 Mar 2017 20:50:02 -0000 Prevent replicator manager change feeds from getting stuck Switch them them from `longpoll` to `normal` This would prevent them being stuck. That could happen if more than one `resume_scan` message arrives for the same shard. The first time a longpoll changef feed would finish and end sequence is checkpointed. But if another resume_scan arrives and database hasn't changed then the longpoll change feed would hang until db is updated. The reason there would be multiple `resume_scan` messages is because there is a race condition between db update handler and scanner component. They are both started asynchronously roughly at the same. Scanner finds new shard while db handler notices changes for those shards. If shards are modified quickly after they are discovered by the scanner both of those components would issue a resume_scan. The effect of this would be more pronounced if there are a large number of _replicator shards and constant db creation/deletion/updates. COUCHDB-2964 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/d00b9814 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/d00b9814 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/d00b9814 Branch: refs/heads/63012-scheduler Commit: d00b981445c03622497088eb872059ab4f48b298 Parents: f63efa7 Author: Nick Vatamaniuc Authored: Fri Mar 10 01:15:47 2017 -0500 Committer: Nick Vatamaniuc Committed: Fri Mar 10 01:15:47 2017 -0500 ---------------------------------------------------------------------- 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/d00b9814/src/couch_replicator_manager.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator_manager.erl b/src/couch_replicator_manager.erl index 2bcad69..85dd428 100644 --- a/src/couch_replicator_manager.erl +++ b/src/couch_replicator_manager.erl @@ -375,7 +375,7 @@ changes_reader({Server, Epoch}, DbName, Since) -> #changes_args{ include_docs = true, since = Since, - feed = "longpoll", + feed = "normal", timeout = infinity }, {json_req, null},