From user-return-63801-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Fri May 3 04:06:03 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5A9D4180671 for ; Fri, 3 May 2019 06:06:03 +0200 (CEST) Received: (qmail 99488 invoked by uid 500); 3 May 2019 04:05:58 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 99477 invoked by uid 99); 3 May 2019 04:05:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 May 2019 04:05:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id DCB06C0620 for ; Fri, 3 May 2019 04:05:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.798 X-Spam-Level: * X-Spam-Status: No, score=1.798 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Sn29R4t6rMQs for ; Fri, 3 May 2019 04:05:55 +0000 (UTC) Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A1C0F5F3AF for ; Fri, 3 May 2019 04:05:54 +0000 (UTC) Received: by mail-vs1-f65.google.com with SMTP id r23so604026vsq.2 for ; Thu, 02 May 2019 21:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=EY2jEM95rB7H9aDcRfrcqdy4QOmwnzwLIJWkcPwX/Rc=; b=THpPSAOwWMc/syFOKP0S1AHMahEvs88kqXFiug+9bVbUovDDB4sfoO6KuFKbldusrG 3n8zI+pDyke+aelCAxvj7tiQxngoK9mq6pbJkHydpu+7Zt9HhN1sXkpgD20y4LufLrqQ i+mP96GUUSc4mZZcUjNwWVwxYL6XPk4jpuuVCuIr3AcHak2Vid27HS7gzodTCVnriqQe X6p9VRM+aJ+wPhaYDoCVkZaxlAvzxV680lGc22bdDLrqxHmFh9yiKvKmwnfft4MzzJNB LZx/wNJP6nNXeLDD2PiGG4R8Nm8qMOvKuH7z8dHlDMUrxJDEZY3+OevgpKs6qLd0z5UO Iyyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=EY2jEM95rB7H9aDcRfrcqdy4QOmwnzwLIJWkcPwX/Rc=; b=MJoOGDQiFDmYGT/XIJfblTslZXSlk3qT8hN0BvxBgugNHtvOt6ChfjPC65EQ/y1SUT J28ZX1GHBzz3chDGsOKe0/cjtdevMsp/gmcoqxZJXhEdMB9WwLwdnA8GsPq6JZHc2QQf LyH6jKP364L8GlmScpBwLcKkwNE8q5t556NWZFTw6ukGRN9v7YJT3NOsGDT5/BXSTdL/ 19SDbXRTVqQD/XW9JmSmvamFsS1cbUlwLYXBjvDtrvUkwK+72oSRytAKXtnJbR0ICyRR Ew77Mw2DhQ50+dR4uL30ikWVd7HOFCGkMB98IoigNppfM0qA82+OHcyJVBxua2XKwXfm clKA== X-Gm-Message-State: APjAAAWoK9T6/sC/BCizVYMmv1abirUKle1dJlPlYZUA8JV2+BPirG8z uBJkb9qZczOU8NM3M26GVX/TkgkQKUfGlgGDvD8oYP7R X-Google-Smtp-Source: APXvYqwWQ8RIz3lGZBsr19qvojnjnqqvZEh9niIK6IhLXiESp0XI66kza2LF6zdkgkOA5eL9mV4sLt79/4+RIulFhPU= X-Received: by 2002:a67:5c47:: with SMTP id q68mr3559013vsb.58.1556856353137; Thu, 02 May 2019 21:05:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shaurya Gupta Date: Fri, 3 May 2019 09:35:40 +0530 Message-ID: Subject: Re: Mixing LWT and normal operations for a partition To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary="000000000000e529510587f3dd5f" --000000000000e529510587f3dd5f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, *1. The below sequence of commands also does not appear to give an expected output.* Since, there is a delete command in the batch and then an LWT update using IF EXISTS, in the final result row with id =3D 5 must get deleted. cassandra@cqlsh> select * from demo.tweets; *id* | *body* | *latitude* | *longitude* | *time* | *user* ----+----------+----------+-----------+---------------------------------+--= ----- *5* | *old body* | *32.6448* | *78.21672* | *2019-01-14 18:30:00.000000+0000* | *user5* (1 rows) cassandra@cqlsh> cassandra@cqlsh> begin batch update demo.tweets SET body=3D'new body' where id =3D 5 IF EXISTS; delete from demo.tweets where id =3D 5 IF EXISTS; apply batch; *[applied]* ----------- *True* cassandra@cqlsh> select * from demo.tweets; *id* | *body* | *latitude* | *longitude* | *time* | *user* ----+----------+----------+-----------+------+------ *5* | *new body* | *null* | *null* | *null* | *null* (1 rows) cassandra@cqlsh> *2. On the contrary below sequence of commands gives the expected output:* cassandra@cqlsh> insert into demo.tweets (id, user, body, time, latitude, longitude) values (5, 'user5', 'old body', '2019-01-15', 32.644800, 78.216721); cassandra@cqlsh> cassandra@cqlsh> select * from demo.tweets; *id* | *body* | *latitude* | *longitude* | *time* | *user* ----+----------+----------+-----------+---------------------------------+--= ----- *5* | *old body* | *32.6448* | *78.21672* | *2019-01-14 18:30:00.000000+0000* | *user5* (1 rows) cassandra@cqlsh> delete from demo.tweets where id =3D 5 IF EXISTS; *[applied]* ----------- *True* cassandra@cqlsh> select * from demo.tweets; *id* | *body* | *latitude* | *longitude* | *time* | *user* ----+------+----------+-----------+------+------ (0 rows) cassandra@cqlsh> update demo.tweets SET body=3D'new body' where id =3D 5 IF EXISTS; *[applied]* ----------- *False* cassandra@cqlsh> select * from demo.tweets; *id* | *body* | *latitude* | *longitude* | *time* | *user* ----+------+----------+-----------+------+------ (0 rows) Thanks Shaurya On Fri, May 3, 2019 at 1:02 AM Shaurya Gupta wrote= : > One suggestion - I think Cassandra community is already having a drive to > update the documentation. This could be added to CQLSH documentation or > some other relevant documentation. > > On Fri, May 3, 2019 at 12:56 AM Shaurya Gupta > wrote: > >> Thanks Jeff. >> >> On Fri, May 3, 2019 at 12:38 AM Jeff Jirsa wrote: >> >>> No. Don=E2=80=99t mix LWT and normal writes. >>> >>> -- >>> Jeff Jirsa >>> >>> >>> > On May 2, 2019, at 11:43 AM, Shaurya Gupta >>> wrote: >>> > >>> > Hi, >>> > >>> > We are seeing really odd behaviour while try to delete a row which is >>> simultaneously being updated in a light weight transaction. >>> > The delete command succeeds and the LWT update fails with timeout >>> exception but still the next select statement shows that the row still >>> exists. This occurs ones in many such scenarios. >>> > >>> > Is it fine to mix LWT and normal operations for the same partition? I= s >>> it expected to work? >>> > >>> > Thanks >>> > Shaurya >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org >>> For additional commands, e-mail: user-help@cassandra.apache.org >>> >>> >> >> -- >> Shaurya Gupta >> >> >> > > -- > Shaurya Gupta > > > --=20 Shaurya Gupta --000000000000e529510587f3dd5f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,


1. The below sequence of commands also does not appea= r to give an expected output.

Since, there is a delete command in the batch and the= n an LWT update using IF EXISTS, in the final result row with id =3D 5 must= get deleted.


cassandra@cqlsh> select * from demo.tweets;<= span class=3D"m_102055417018613122m_7773180653191872334gmail-Apple-converte= d-space">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0

=C2=A0id | body =C2=A0 =C2=A0 | latitude | <= /span>= longitude | <= span class=3D"m_102055417018613122m_7773180653191872334gmail-s3" style=3D"f= ont-variant-ligatures:no-common-ligatures;color:rgb(200,20,201)">time=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 | user

----+----------+--------= --+-----------+---------------------------------+-------

=C2=A0 5 | old body |=C2=A0 32.6448 |=C2=A0 78.21672 | 2019-01-14 18:30:00.000000+0000 | = user5<= /b>


(1 rows)=

cassandra@cqlsh>=C2=A0

=

cassandra@cqlsh> begin batch update demo.tweets SET body=3D&#= 39;new body' where id =3D 5 IF EXISTS; delete from demo.tweets where id= =3D 5 IF EXISTS; apply batch;

=

=C2=A0[applied]

-----------

=C2=A0 =C2=A0 =C2=A0 <= /span>T= rue


cass= andra@cqlsh> select * from demo.tweets;


=C2=A0id= | body =C2=A0= =C2=A0 | lati= tude | longitude | = time | user

----+--------= --+----------+-----------+------+------

=C2= =A0 5 | ne= w body | = =C2=A0 =C2=A0 null |=C2=A0 =C2=A0 =C2=A0 null | null | null

(1 rows)

cassandra@cqlsh><= span class=3D"m_102055417018613122m_7773180653191872334gmail-Apple-converte= d-space">=C2=A0



2. On the contrary below sequence of = commands gives the expected output:


cassandra@cqlsh> insert into=C2=A0 demo.= tweets (id, user, body, time, latitude, longitude) values (5, 'user5= 9;, 'old body', '2019-01-15', 32.644800, 78.216721);=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cassandra@cqlsh>= =C2=A0

cassandra@cqlsh>= ; select * from demo.tweets;


=C2= =A0id | body =C2=A0 =C2=A0 | latitude | longitude= | time=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |= user

=

----+----------+----------+----= -------+---------------------------------+-------

=C2=A0 5 | = old body |=C2=A0 32.64= 48 |=C2=A0 78.21672= | 2019-01-14 18:30:00.000000+0000 | user5


(1 rows)

cassandra@cqlsh> delete from demo.tweets where id =3D 5 IF EXISTS;

=

<= span class=3D"m_102055417018613122gmail-Apple-converted-space">=C2=A0[applied]

-----------

=C2=A0 =C2=A0 =C2=A0 True


cassandra@cqlsh> select * from demo.tweets;


=C2=A0id | body | latitude | longitude | time | user

----+------+----------+-----------+------+--= ----

=

(0 rows)<= /p>

cassandra@cqlsh> update = demo.tweets SET body=3D'new body' where id =3D 5 IF EXISTS;<= /p>


<= /p>

=C2=A0[applied]

<= span class=3D"m_102055417018613122gmail-s1" style=3D"font-variant-ligatures= :no-common-ligatures">-----------

=C2=A0=C2=A0 =C2=A0 False


cas= sandra@cqlsh> select * from demo.tweets;


=C2=A0id | body | latitude= | longitude | time | user

----+------+----------+-----------+------+------<= /span>


(0 rows)


Thanks

Shaurya=




On Fri, May 3, 2019 at 1:02 AM Shaurya Gu= pta <shaurya= .nsit@gmail.com> wrote:
One suggestion - I think Cassandra communit= y is already having a drive to update the documentation. This could be adde= d to CQLSH documentation or some other relevant documentation.

On Fri, May 3= , 2019 at 12:56 AM Shaurya Gupta <shaurya.nsit@gmail.com> wrote:
Thanks Jeff.
On= Fri, May 3, 2019 at 12:38 AM Jeff Jirsa <jjirsa@gmail.com> wrote:
No. Don=E2=80=99t mix LWT and norma= l writes.

--
Jeff Jirsa


> On May 2, 2019, at 11:43 AM, Shaurya Gupta <shaurya.nsit@gmail.com> wrote:<= br> >
> Hi,
>
> We are seeing really odd behaviour while try to delete a row which is = simultaneously being updated in a light weight transaction.
> The delete command succeeds and the LWT update fails with timeout exce= ption but still the next select statement shows that the row still exists. = This occurs ones in many such scenarios.
>
> Is it fine to mix LWT and normal operations for the same partition? Is= it expected to work?
>
> Thanks
> Shaurya

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org



--
Shaurya Gupta

<= br>


--
Shaurya Gupta




--
Sh= aurya Gupta


--000000000000e529510587f3dd5f--