Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems

From: Christoph Ziegenberg <ziegenberg(at)web(dot)de>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>,Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: ziegenberg(at)web(dot)de,pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems
Date: 2019-08-20 14:56:06
Message-ID: 6F9C0D52-A45B-4D2E-A558-F15170301C0A@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

New info:
We could also reproduce it with Postgres 10.10 32bit on Windows Server 2016 and 9.6.8 64bit on Ubuntu (18.x). So also the 32bit version is affected, as well as 9.x versions.

Current test state:
We (2 of my colleagues and me) are currently trying to create an independent test, but at the moment it only occurrs within the specific application.

Of course we search for an error in the application first, checked the connection settings, tracked all statements... there is nothing special, only a handful of SELECTS and UPDATES, then the sequence generation and the (sometimes failing) INSERT, and another INSERT (no sequence generate here) and UPDATE following. In all cases we tested with the Postgres default configuration.

We could see that wrapping the selection of NEXTVAL() in a transaction (which shouldn't have any effect?) reduced the problem in one case, but it was still possible to reproduce the error with an increased number of requests.

At the moment we don't have a real idea how to proceed. Next step planned is to simulate all of the aforementioned requests done by the application, because they seem to influence the behavior.

Background:
The application is written in PHP (different versions used in the tests, 7.2 - 7.4 I guess), runs on Apache/IIS (FastCGI) and uses the PDO extension for the communication with Postgres.

Christoph

Am 20. August 2019 16:21:08 MESZ schrieb Merlin Moncure <mmoncure(at)gmail(dot)com>:
>On Tue, Aug 20, 2019 at 9:14 AM Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
>wrote:
>>>
>>>
>>> I did many tests:
>>
>>
>> Can you include the code which implements those tests?
>>
>> I can't reproduce with something like this:
>
>+1 this. This would be a very embarrassing and serious problem should
>it be proven to be valid. We would however need to rule out issues
>in the test code itself. The best possible approach in terms of
>verification would be a .sql only test with reproduction via pgbench
>-f (IMO).
>
>merlin

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Petar Masev 2019-08-20 15:10:03 Postgres 11.5.1 failed installation
Previous Message Merlin Moncure 2019-08-20 14:21:08 Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems