Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A38DC10A9C for ; Mon, 31 Mar 2014 13:45:03 +0000 (UTC) Received: (qmail 79109 invoked by uid 500); 31 Mar 2014 13:45:02 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 78971 invoked by uid 500); 31 Mar 2014 13:45:00 -0000 Mailing-List: contact dev-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 dev@couchdb.apache.org Received: (qmail 78955 invoked by uid 99); 31 Mar 2014 13:44:57 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2014 13:44:57 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9AD7890800B; Mon, 31 Mar 2014 13:44:57 +0000 (UTC) From: benoitc To: dev@couchdb.apache.org Reply-To: dev@couchdb.apache.org References: In-Reply-To: Subject: [GitHub] couchdb-fabric pull request: 1993 bigcouch couch mrview Content-Type: text/plain Message-Id: <20140331134457.9AD7890800B@tyr.zones.apache.org> Date: Mon, 31 Mar 2014 13:44:57 +0000 (UTC) Github user benoitc commented on a diff in the pull request: https://github.com/apache/couchdb-fabric/pull/1#discussion_r11115574 --- Diff: src/fabric_view_reduce.erl --- @@ -84,6 +74,30 @@ handle_message({rexi_EXIT, Reason}, Worker, State) -> {error, Resp} end; +%% HACK: this just sends meta once. Instead we should move the counter logic +%% from the #view_row handle_message below into this function and and pass the +%% meta call through maybe_send_row. This will also be more efficient doing it +%% here as it's one less worker round trip reply. +%% Prior to switching to couch_mrview, the fabric_view_reduce implementation +%% did not get a total_and_offset call, whereas now we do. We now use this +%% message as a clean way to indicate to couch_mrview_http:view_cb that the +%% reduce response is starting. +handle_message({meta, Meta}, {_Worker, From}, State) -> + gen_server:reply(From, ok), + #collector{ + callback = Callback, + user_acc = AccIn + } = State, + + {Go, Acc} = case get(meta_sent) of + undefined -> + put(meta_sent, true), --- End diff -- what is the usage of this key? Looks like you only erasing it. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---