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 912E7927A for ; Fri, 6 Apr 2012 06:57:13 +0000 (UTC) Received: (qmail 13746 invoked by uid 500); 6 Apr 2012 06:57:13 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 13630 invoked by uid 500); 6 Apr 2012 06:57:11 -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 13612 invoked by uid 99); 6 Apr 2012 06:57:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 06:57:10 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of randall.leeds@gmail.com designates 209.85.215.52 as permitted sender) Received: from [209.85.215.52] (HELO mail-lpp01m010-f52.google.com) (209.85.215.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 06:57:04 +0000 Received: by lahi5 with SMTP id i5so2666981lah.11 for ; Thu, 05 Apr 2012 23:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=kv5wPRRZe8lL3uG0bIKKRtp+gD2Wo1GcjINDO/zkMeg=; b=BIDTn2zTspPiRxeE1d6vc201YaEbCNnqPLWGIImlLgZYdWfVAEt0jxfM9gkbUfegTr KbBOpbhqoEg1UMvzbQ4aGi2Frb/ULZTSGVkZKeFKqbuaWCGPH9omU8agbsDSqgC19wGM BPb9fnCPwjKe2dKx7puUDQgb5RI0jh5WU0XsiXbMhHph3UteWRCuOjlZz8o28CA9V8PN HhT0wUJMFyOpvCk/Z+r9CAJ+TDVc4uGZIWVCY9EOPIDgpCsnAqSdjHCRayfuF+wgm+q9 lqqSPPJUfiYN36+vUHo1fg5l9suRjOLhKSR6q/u3qLHspqxdGFxPepM5/9cDNrtfH+tc A4CA== MIME-Version: 1.0 Received: by 10.152.130.167 with SMTP id of7mr7024402lab.36.1333695402955; Thu, 05 Apr 2012 23:56:42 -0700 (PDT) Received: by 10.112.113.233 with HTTP; Thu, 5 Apr 2012 23:56:42 -0700 (PDT) In-Reply-To: <1333665006580-7441597.post@n2.nabble.com> References: <1333665006580-7441597.post@n2.nabble.com> Date: Thu, 5 Apr 2012 23:56:42 -0700 Message-ID: Subject: Re: 2 Posts at once causes problems From: Randall Leeds To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Apr 5, 2012 at 15:30, ashgavs wrote: > I did some testing on my client, and made two posts that get posted at > exactly the same time. =C2=A0We have long polling enabled so I waited for= a GET > to see if both made it successfully into the DB. =C2=A0Both posts went ou= t, but > we only got one GET back. So I checked the database, it had both document= s. > So what happened? Why did one get lost? If you re-issue the long poll GET with the last_seq returned do you see the other POST? It is expected that long polling may only give you the first of the two POST if the GET was initiated before the POST. > > The robot makes literally thousands of posts in a short period of time. I= ts > constantly sending the DB information. My theory is that if a user and th= e > robot make a post at exactly the same time, its possible that the user wi= ll > not GET back both posts from the DB, almost like a threading issue. Do yo= u > have any thoughts? Have you seen anything like this before? If you are starting the GET at the same time as the POST there could have been a small race condition: https://issues.apache.org/jira/browse/COUCHDB-1363 -Randall