Re: posgres 12 bug (partitioned table)

From: Pavel Biryukov <79166341370(at)yandex(dot)ru>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: posgres 12 bug (partitioned table)
Date: 2020-08-12 08:06:23
Message-ID: 52371597219372@mail.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

<div> </div><div>With "wrap around" update when the same xmin value is assigned to the row (leading to concurrency detection problem) the solution may be to make sure in Postgres that the new xmin value is different from previous (freezed row with xmin before "wrap around")</div><div> </div><div>-- <br />С уважением, Павел</div><div> </div><div> </div><div> </div><div>11.08.2020, 21:39, "Andres Freund" &lt;andres(at)anarazel(dot)de&gt;:</div><blockquote><p>Hi,<br /><br />On 2020-08-11 21:31:52 +0300, Pavel Biryukov wrote:</p><blockquote> Entity Framework is an ORM for .Net (and .Net Core). It has different providers<br /> for different databases (NpgSql for Postgres). It uses Optimistic concurrency.<br /> The common use case is to use xmin as "concurrency token".<br />  <br /> In code we make "var e = new Entity();", "dbContext.Add(e)" and<br /> "dbContext.SaveChanges()" (smth like that), and EF Core constructs sql for us,<br /> classical ORM;<br />  <br /> When new row is inserted, EF makes an insert with "RETURNING xmin" to keep it<br /> as concurrency token for further updates (update is made like "where id = [id]<br /> AND xmin=[xmin]" to be sure the row hasn't been updated by other clients).</blockquote><p><br />That's not really a safe use of xmin, e.g. it could have wrapped around<br />leading you to not notice a concurrent modification. Nor does it<br />properly deal with multiple statements within a transaction. Perhaps<br />those are low enough risk for you, but I don't xmin is a decent building<br />block for this kind of thing.<br /><br />Greetings,<br /><br />Andres Freund</p></blockquote>

Attachment Content-Type Size
unknown_filename text/html 1.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Wilm Hoyer 2020-08-12 09:35:04 AW: posgres 12 bug (partitioned table)
Previous Message PG Bug reporting form 2020-08-12 07:51:27 BUG #16579: In some areas of UTC+8, "CST" in the log is recognized as the wrong time zone when importing these

Browse pgsql-hackers by date

  From Date Subject
Next Message Marco Atzeri 2020-08-12 08:18:00 Re: remove some ancient port hacks
Previous Message Peter Eisentraut 2020-08-12 07:12:07 remove some ancient port hacks