Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-20 Thread Jeremy Schneider
On 8/20/20 14:46, Tom Lane wrote: > There might be value in a user-invokable tool that runs in an existing > non-crashed database and looks for orphan files, but I'm not aware that > anyone has written one. (Race conditions against concurrent table > creation would be a problem; but probably that

Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-20 Thread Jason Myers
On Thu, Aug 20, 2020 at 5:46 PM Tom Lane wrote: > Jason Myers writes: > > However we were still seeing orphaned files on crash, and I believe I > > tracked it down to subsequent CREATE INDEX statements also creating these > > orphaned files (if they are running during a crash). > > Is that

Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-20 Thread Tom Lane
Jason Myers writes: > However we were still seeing orphaned files on crash, and I believe I > tracked it down to subsequent CREATE INDEX statements also creating these > orphaned files (if they are running during a crash). > Is that issue known as well? I don't believe I can use the same trick

Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-20 Thread Adrian Klaver
On 8/20/20 1:37 PM, Jason Myers wrote: On Tue, Aug 18, 2020 at 3:49 PM Adrian Klaver > wrote: > So from [1] you are using CREATE TABLE AS. Have you tried with: > > BEGIN; > CREATE TABLE some_table SELECT some_data FROM other_table LIMIT 1 WITH > NO DATA;

Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-20 Thread Jason Myers
On Tue, Aug 18, 2020 at 3:49 PM Adrian Klaver wrote: > So from [1] you are using CREATE TABLE AS. Have you tried with: > > BEGIN; > CREATE TABLE some_table SELECT some_data FROM other_table LIMIT 1 WITH > NO DATA; > COMMIT; > > The above gets you the table structure, but no data. > > BEGIN; >

Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-18 Thread Adrian Klaver
On 8/18/20 1:19 PM, Jason Myers wrote: > On Tue, Aug 18, 2020 at 3:49 PM Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: > Have you tried with: > BEGIN; > CREATE TABLE some_table SELECT some_data FROM other_table LIMIT 1 WITH > NO DATA; > COMMIT; > > The above gets you the

Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-18 Thread Jason Myers
> On Tue, Aug 18, 2020 at 3:49 PM Adrian Klaver wrote: > > Have you tried with: > BEGIN; > CREATE TABLE some_table SELECT some_data FROM other_table LIMIT 1 WITH > NO DATA; > COMMIT; > > The above gets you the table structure, but no data. > > BEGIN; > INSERT into some_table SELECT * FROM

Re: Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-18 Thread Adrian Klaver
On 8/18/20 12:35 PM, Jason Myers wrote: Postgres 12.4 I was directed in slack to mention here that we're being impacted by Postgres leaving orphaned pages in /base/ after a crash while a CREATE TABLE is being run in transaction. The issue is the same as the reproduction steps listed here

Orphaned relations after crash/sigkill during CREATE TABLE

2020-08-18 Thread Jason Myers
Postgres 12.4 I was directed in slack to mention here that we're being impacted by Postgres leaving orphaned pages in /base/ after a crash while a CREATE TABLE is being run in transaction. The issue is the same as the reproduction steps listed here [1], that is: - Start a CREATE TABLE