Re: Write skew anmalies are found in SERIALIZABLE isolation

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Write skew anmalies are found in SERIALIZABLE isolation
Date: 2019-10-04 07:28:10
Message-ID: db8a32be-e3e3-a01f-b03c-a812481ac63d@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)bowt(dot)ie>;
> *Date: * Fri, Oct 4, 2019 05:05 AM
> *To: * "张舒燕"<51184501183(at)stu(dot)ecnu(dot)edu(dot)cn>;
> *Cc: * "pgsql-bugs"<pgsql-bugs(at)lists(dot)postgresql(dot)org>;
> *Subject: * Re: Write skew anmalies are found in SERIALIZABLE isolation
> On Thu, Oct 3, 2019 at 9:18 AM 张舒燕 <51184501183(at)stu(dot)ecnu(dot)edu(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2019-10-04 08:10:08 Re: BUG #16035: STATEMENT_TIMEOUT not working when we have single quote usage inside CTE which is used in inner sql
Previous Message Tom Lane 2019-10-04 05:52:07 Re: BUG #16037: Assertion fails in varbit_out