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 4D015200B92 for ; Wed, 28 Sep 2016 22:38:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4BCDD160AD3; Wed, 28 Sep 2016 20:38:05 +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 8BF89160AB8 for ; Wed, 28 Sep 2016 22:38:04 +0200 (CEST) Received: (qmail 33016 invoked by uid 500); 28 Sep 2016 20:38:03 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 32993 invoked by uid 99); 28 Sep 2016 20:38:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2016 20:38:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 52F111A60E0 for ; Wed, 28 Sep 2016 20:38:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.65 X-Spam-Level: ***** X-Spam-Status: No, score=5.65 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RDNS_NONE=3] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=open-net.biz Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 5HmkTFoVF6AI for ; Wed, 28 Sep 2016 20:37:59 +0000 (UTC) Received: from open-net.biz (unknown [195.69.166.187]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D533C5FB18 for ; Wed, 28 Sep 2016 20:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=open-net.biz; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tBVn9wOYvhkVjtpA/Qiw8tA4TA3rCty/Prjl8QUAiY8=; b=p/tlk/FHeydtssQyIKVKHU5zE svGXJFixgAXrD1aGFH5Wc+BU7cVAoo6IY9iVcpub2AY56+AK6OkbHI+sE9VPC60p/qc6Vnh2EKm2q P0n2eybufLDA0Oew4IAlKjDVB9URyfpRZzJp7camP2oCQg5MwxNSW1OSOsP9ITNLUZhK4iwBsDmYt soCskptRLmx9krhltSoEj0XFihPrmAb0UR1uLyniP0FYiJ4i9FKg49meqZQZ8x+MCbHsJqSzsOQ4g oSqJ5Y+DkLGa/OBtPVt8WgZxoH4SyMybJsqa4r5iyEGBLkpgIO0y1r69eAPu1mRtjI7cNuOllB9N0 ycOzfPlhA==; Received: from [88.87.6.162] (port=59473 helo=[192.168.69.120]) by teddy.icnhost.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1bpLc6-0008KZ-9M for user@couchdb.apache.org; Wed, 28 Sep 2016 23:37:58 +0300 Subject: Re: Issue with Reduce - NOT SOLVED. To: user@couchdb.apache.org References: <7b1ecc57-b507-b34f-a85c-0aa04b9e8c3e@open-net.biz> <05d50a29-6be8-509a-5609-b5bf281bdf91@open-net.biz> <1403E181-E596-4AFA-B78D-2714D334D155@apache.org> From: Kiril Stankov Message-ID: <334716d1-7788-2bfc-4c2f-056fe5b3513b@open-net.biz> Date: Wed, 28 Sep 2016 23:37:56 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------271FBC24B53D7C7A1C5B215C" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - teddy.icnhost.net X-AntiAbuse: Original Domain - couchdb.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - open-net.biz X-Get-Message-Sender-Via: teddy.icnhost.net: authenticated_id: kiril@open-net.biz X-Authenticated-Sender: teddy.icnhost.net: kiril@open-net.biz X-Source: X-Source-Args: X-Source-Dir: archived-at: Wed, 28 Sep 2016 20:38:05 -0000 --------------271FBC24B53D7C7A1C5B215C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Well, actually, it got from bad to worst. Compact view doesn't fix the problem anymore. Now I always get wrong output. Modifying the reduce to return just vals.length returns always 2. I found that the issue appears after each insertion of new doc to the DB. Any help will be highly appreciated, this is a production environment... :( ------------------------------------------------------------------------ *With best regards,* Kiril Stankov, On 28.9.2016 г. 22:15, Jan Lehnardt wrote: > Thanks! > > Do you have any more info on the type of operating system this runs on, the file system situation, etc? > > Best > Jan > -- > >> On 28 Sep 2016, at 17:47, Kiril Stankov wrote: >> >> Sure. See below. >> >> The view filters documents from all docs, the reduce gives statistics >> depending on values. >> Very simple. >> >> An interesting thing is that when it breaks vals.length always equals 2. >> >> BTW - just happened again, second time today. Compact of the view always >> fixes this. >> >> View: >> >> function(doc) { >> if(doc.status!='deleted' && (!doc.endUser || doc.forwarded) && >> !doc.pID) { >> emit(null, [(doc.status=='new'),(doc.status=='forwarded')]); >> } >> } >> >> Reduce: >> >> function(keys, vals, rereduce) { >> // reduce function >> >> var result = {'new':0, 'total':vals.length,forwarded:0}; >> for(var i = 0; i < vals.length; i++) { >> result.new += vals[i][0]?1:0; >> result.forwarded+= vals[i][1]?1:0; >> } >> return result; >> } >> >> Thanks! >> >> >> On 28.9.2016 г. 18:16, Jan Lehnardt wrote: >>> Heya, >>> >>> Can you share the view code? >>> >>> Best >>> Jan >>> -- >>> >>>> On 28 Sep 2016, at 15:38, Kiril Stankov wrote: >>>> >>>> Hi, >>>> >>>> I just saw this again. >>>> Reduce didn't work until compacting the View. >>>> >>>> This starts to be a serious problem. >>>> Any help or suggestion how to debug this will be appreciated. >>>> >>>> Thanks! >>>> >>>> ------------------------------------------------------------------------ >>>> *With best regards,* >>>> Kiril Stankov, >>>> >>>> On 24.9.2016 г. 20:43, Kiril Stankov wrote: >>>>> Hi all, >>>>> >>>>> I use CouchDb 1.6 and have a view with reduce (same on all databases), >>>>> which returns some statistics. >>>>> >>>>> Suddenly, today, it started returning strange things, and I think that >>>>> the problem was that vals.length was returning 0. There are only few >>>>> dozens docs in this DB. >>>>> I have a replication DB where everything worked fine, checked that the >>>>> code is exactly the same. >>>>> >>>>> After compacting the views on the first DB, it also started showing the >>>>> correct values. >>>>> >>>>> Any idea what could cause this? View corruption? There are plenty of >>>>> resources (disk, memory) on the host machine. >>>>> >> --------------271FBC24B53D7C7A1C5B215C--