Re: Unlogged tables cleanup

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unlogged tables cleanup
Date: 2016-11-10 07:17:18
Message-ID: CAB7nPqQpo98UazhL-Ywc_u3w+_+m4vpw1xYZ7xgfYcXGzz+HZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 10, 2016 at 3:29 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Nov 9, 2016 at 11:56 AM, Konstantin Knizhnik
> <k(dot)knizhnik(at)postgrespro(dot)ru> wrote:
>> Now simulate server crash using using "pkill -9 postgres".
>>
>> knizhnik(at)knizhnik:~/dtm-data$ rm -f logfile ; pg_ctl -D pgsql.master -l
>> logfile start
>> pg_ctl: another server might be running; trying to start server anyway
>> server starting
>> knizhnik(at)knizhnik:~/dtm-data$ psql postgres
>> psql (10devel)
>> Type "help" for help.
>>
>> postgres=# select * from foo;
>> ERROR: could not open file "pg_tblspc/16384/PG_10_201611041/12289/16385":
>> No such file or directory
>>
>> knizhnik(at)knizhnik:~/dtm-data$ ls fs
>> PG_10_201611041
>> knizhnik(at)knizhnik:~/dtm-data$ ls fs/PG_10_201611041/
>>
>> So all relation directory is removed!
>> It happens only for first table created in tablespace.
>> If you create table in Postgres data directory everything is ok: first
>> segment of relation is truncated but not deleted.
>
> Whoa. There should be an _init fork that doesn't get removed, and
> without removing the _init fork you shouldn't be able to remove the
> directory that contains it.

Hm.. I cannot reproduce what you see on Linux or macos. Perhaps you
have locally a standby pointing as well to this tablespace?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Scheid 2016-11-10 07:17:58 Re: Fwd: Re: [CORE] temporal tables (SQL2011)
Previous Message Michael Paquier 2016-11-10 06:54:58 Re: Bug in comparison of empty jsonb arrays to scalars