pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: Write skew anmalies are found in SERIALIZABLE isolation
Date: Fri, 4 Oct 2019 10:28:10 +0300
Message-ID: <db8a32be-e3e3-a01f-b03c-a812481ac63d@postgrespro.ru> (raw)
In-Reply-To: <tencent_23282A58707254AC62CACD2C@qq.com>
References: <tencent_24A036EA059BFBC667810DBE@qq.com>
	<CAH2-Wzn64_qtaiDY4iCLGx5JtUGf13KSgxAecWVFJdNq5=6vpg@mail.gmail.com>
	<tencent_23282A58707254AC62CACD2C@qq.com>

On 04.10.2019 4:36, 张舒燕 wrote:
> We have tested versions of 9.4.0, 9.6.0, 10.0, 11.0 and 11.5 and found 
> the Bug on all of them.
>
> We have wrong statements in the last email.
> "If each transaction only read one item with secondary index and write 
> another item with primary index, write skew anomalies are more ( -> 
> less) likely to occur."
> "At last, we run the same join SQL, and more ( -> less) anomalies can 
> be found. The corresponding test program is Test2.java."
> There are less anomalies can be found in the second situation using 
> Test2.java.
>
> And some mistakes in our test programs have been fixed.
>
> Best regards ,
> Shuyan Zhang, ECNU

I do not think that this problem is somehow related with "write skew 
anomalies".
The type of "col" is decimal, but you are extracting it as "double", 
making conversion and loosing precision.
Then you perform some manipulations using Java BigDecimal class, convert 
result to string (which also does some rounding) and subtract this value 
from the column.
As a result of this conversions  your original  assumption that 
(x+y)*0.9 < (x+y) may be wrong.
Please try to reproduce the problem using integer type  and I am almost 
sure that you will not able to get this anomalies.


> ------------------ Original ------------------
> *From: * "Peter Geoghegan"<pg@bowt.ie>;
> *Date: * Fri, Oct 4, 2019 05:05 AM
> *To: * "张舒燕"<51184501183@stu.ecnu.edu.cn>;
> *Cc: * "pgsql-bugs"<pgsql-bugs@lists.postgresql.org>;
> *Subject: * Re: Write skew anmalies are found in SERIALIZABLE isolation
> On Thu, Oct 3, 2019 at 9:18 AM 张舒燕 <51184501183@stu.ecnu.edu.cn> wrote:
> > When we set the isolation level to SERIALIZABLE, we observed some 
> wirte skew anmalies.
>
> What version of PostgreSQL did you test? Does this bug affect all 
> versions?
>
> -- 
> Peter Geoghegan

-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

view thread (4+ messages)

Message-ID: <db8a32be-e3e3-a01f-b03c-a812481ac63d@postgrespro.ru>
Permalink:  ../db8a32be-e3e3-a01f-b03c-a812481ac63d@postgrespro.ru/
Also on:    postgresql.org/message-id/db8a32be-e3e3-a01f-b03c-a812481ac63d@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: k.knizhnik@postgrespro.ru
  Subject: Re: Write skew anmalies are found in SERIALIZABLE isolation
  In-Reply-To: <db8a32be-e3e3-a01f-b03c-a812481ac63d@postgrespro.ru>
  References: <tencent_24A036EA059BFBC667810DBE@qq.com> <CAH2-Wzn64_qtaiDY4iCLGx5JtUGf13KSgxAecWVFJdNq5=6vpg@mail.gmail.com> <tencent_23282A58707254AC62CACD2C@qq.com> <db8a32be-e3e3-a01f-b03c-a812481ac63d@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox