Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i06Zp-0004M6-JW for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Aug 2019 16:01:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i06Yp-0008Bn-Rr for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Aug 2019 16:00:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i05Yb-0003IM-TD for pgsql-bugs@lists.postgresql.org; Tue, 20 Aug 2019 14:56:22 +0000 Received: from mout.web.de ([212.227.17.11]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i05YY-0006t6-PN for pgsql-bugs@lists.postgresql.org; Tue, 20 Aug 2019 14:56:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1566312968; bh=VQ/+nN6lV3kWGtOw+vXmQSI968vlMWko0QabohdVT90=; h=X-UI-Sender-Class:Date:In-Reply-To:References:Subject:To:CC:From; b=YYflgGnOzz37wfWvzmuuTqrckEktoswv0Wh/iu2AHZTfQgpEDnuTL4rzVSAjZLQbz WmsLaIURprEoHPsxINz6Dg5UPDkrSrN/qHTIWMV6ATA69k2ZwsUT6QdWDp0lPLg1pM 3NsPbKG14rNfndO5uZjvNe5OoCOqUKvHTQkt29UU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from android-3b501eb22dd4134a ([79.206.38.244]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MUFGo-1hrwN81JTO-00QxBs; Tue, 20 Aug 2019 16:56:08 +0200 Date: Tue, 20 Aug 2019 16:56:06 +0200 User-Agent: K-9 Mail for Android In-Reply-To: References: <15967-ae7fd939200f4547@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----6N3TEX7NQ7Q9Y6RHIH4QA09OJVGBMK" Content-Transfer-Encoding: 7bit Subject: Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems To: Merlin Moncure ,Jeff Janes CC: ziegenberg@web.de,pgsql-bugs From: Christoph Ziegenberg Message-ID: <6F9C0D52-A45B-4D2E-A558-F15170301C0A@web.de> X-Provags-ID: V03:K1:xqdOe1+iHunJ4KjHSSnRvrewNVNZ67lu18Dtf34U6AJm/wxyHln 3ZBekmuhYW2nVj6/g5ab3jHNAopDKvXrzXwwebcS91QDtBmFdNbI86YYoPzDXCJT2+Vnk07 8vHgQ9Ym4D+buLCrJHdfwqn1FoQNkaICNClTaXa4ruoH9jTEfaVrciT4aDBKMcQVo57+Jgs mdU5EeWVUbWRiktcN+I7A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:YG41W9hUclI=:5g5J+YVFtY4hksd3RsXfA+ M28lnHFg7NKxLGeAZYuWApkiMUZc9wJcgG47Ar9gSkSAkXgsKCKjHstbeTK7s4lO5+pVox4UF /HMHnAjUWhucIWy9kJfGK289By/msrefpvC2ux6+IRQgyds8TatUp7Fy9TpKtMUhSELFJMMuZ UvlCQkqBcPJK6dHg/qmGE+MsqFRx9nAIFGAeKlWJ6X4vCtxhNh8Cb2QUfzCfmr5pwuf8wzg1F orG87ansjrtERQNBwu9dFal8Oi865yv8ucugoSZ1yvm3jY+p40H1sPzzHXCO4aRdzsarJZt2D /XoQ54y7iEWJlxn/m2UCWAzOPsbUoydBYhnDslcXTJyxiC+LkK4zBWqPbvUhOLslaTAjErBtw KXLMkBr60u9G4b0mz2uGjLYNFWtHwbmn5Iqy5suM0KaI4tPQoXLs+cmf/UMVW0e454omr+Axq +V4/UbuxHybZfVdjDguj0lwVQo9BUVu4JgP4nWeN3/sCSS6waQgBdODjIPrj9n4frGThHD3gq JRdA+W/T25A2kYgABH+JxwJ5jMySG+4N7MvBnffHoH8eThwuYqhzfFpyKfBg0MH5T9ShB2JHB +y1Ktg7GXQpX8tY+ag95TAeKfbPjfzel/5QzwFzeYuhBozCcs/tPekvqHDCgVcjBOnfFY+CTL 1IyOzDVhWErDHA9gq19Obq6pQ7BElhzQvJCQO4a3X0TySfwqb+yzaW58ux1EFr7RuVgQe0KuX AoYO8rPgUj7511V2EvGO6jZXAbukb/DQaUzZOpnpU4sJo1Cv5aSiQlg09ezVbWBCdx7dIJT88 EOprOA+Ws1JgLrLF8HyPCIi8PRuJ3yayg8X7EoTihpygHEfYL6uAIm+4vNMP3n9/WPEEVkqpm OW2yRo4VhJ0iZNRSEHk2O6PPGbN32dWecqQZZZR8U/44JUYfANXOanKDQ4vtGhCYmnbpW3PSo ddjau5paFqXZXXbrz656r8iuj0x+yyQgE6dvZsM78i2h0m/D+VJcf0r/HWfdSxl0W6cVPaXEJ EjBd66gfAKZxQKIOZR5ZASR42Y2u3hnx02JNcmL8Yt7KM0rIr302pox/f9/gBHIfQXcbF1k+U /rLmraKjvWKD708zjHKB2QTBgavINfjY2DxHgi5lrfdzYcTqFibmgGi6WR6cspHtzKKC69hel J9oVoi+FnSFDGAJi6dSBhLeBEdv8TNCOKrRsqkpAAMNUx4nA== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------6N3TEX7NQ7Q9Y6RHIH4QA09OJVGBMK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable New info: We could also reproduce it with Postgres 10=2E10 32bit on Windows Server 2= 016 and 9=2E6=2E8 64bit on Ubuntu (18=2Ex)=2E So also the 32bit version is = affected, as well as 9=2Ex versions=2E Current test state: We (2 of my colleagues and me) are currently trying to create an independe= nt test, but at the moment it only occurrs within the specific application= =2E Of course we search for an error in the application first, checked the con= nection settings, tracked all statements=2E=2E=2E there is nothing special,= only a handful of SELECTS and UPDATES, then the sequence generation and th= e (sometimes failing) INSERT, and another INSERT (no sequence generate here= ) and UPDATE following=2E In all cases we tested with the Postgres default = configuration=2E We could see that wrapping the selection of NEXTVAL() in a transaction (wh= ich 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= =2E At the moment we don't have a real idea how to proceed=2E Next step planne= d is to simulate all of the aforementioned requests done by the application= , because they seem to influence the behavior=2E Background: The application is written in PHP (different versions used in the tests, 7= =2E2 - 7=2E4 I guess), runs on Apache/IIS (FastCGI) and uses the PDO extens= ion for the communication with Postgres=2E Christoph Am 20=2E August 2019 16:21:08 MESZ schrieb Merlin Moncure : >On Tue, Aug 20, 2019 at 9:14 AM Jeff Janes >wrote: >>> >>> >>> I did many tests: >> >> >> Can you include the code which implements those tests? >> >> I can't reproduce with something like this: > >+1 this=2E This would be a very embarrassing and serious problem should >it be proven to be valid=2E We would however need to rule out issues >in the test code itself=2E The best possible approach in terms of >verification would be a =2Esql only test with reproduction via pgbench >-f (IMO)=2E > >merlin ------6N3TEX7NQ7Q9Y6RHIH4QA09OJVGBMK Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable New info:
We could also reproduce it with Postg= res 10=2E10 32bit on Windows Server 2016 and 9=2E6=2E8 64bit on Ubuntu (18= =2Ex)=2E So also the 32bit version is affected, as well as 9=2Ex versions= =2E

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

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

We could = see that wrapping the selection of NEXTVAL() in a transaction (which should= n't have any effect?) reduced the problem in one case, but it was still pos= sible to reproduce the error with an increased number of requests=2E
At the moment we don't have a real idea how to proceed=2E Next step planne= d is to simulate all of the aforementioned requests done by the application= , because they seem to influence the behavior=2E

Background:
The = application is written in PHP (different versions used in the tests, 7=2E2 = - 7=2E4 I guess), runs on Apache/IIS (FastCGI) and uses the PDO extension f= or the communication with Postgres=2E

Christoph


Am 20=2E August 2019 16:21:08 MESZ schrieb Merlin Moncure= <mmoncure@gmail=2Ecom>:
On Tue, Aug 20, 2019 at 9:14 AM Jeff Janes <jeff=
=2Ejanes@gmail=2Ecom> wrote:


I did = many tests:


Can you include the code which impleme= nts those tests?

I can't reproduce with something like this:

+1 this=2E This would be a very embarrassing and serious pro= blem should
it be proven to be valid=2E We would however need to rule = out issues
in the test code itself=2E The best possible approach in ter= ms of
verification would be a =2Esql only test with reproduction via pgb= ench
-f (IMO)=2E

merlin
------6N3TEX7NQ7Q9Y6RHIH4QA09OJVGBMK--