Re: [HACKERS] Unlogged tables cleanup

2016-12-08 Thread Michael Paquier
On Fri, Dec 9, 2016 at 4:54 AM, Robert Haas wrote: > On Wed, Dec 7, 2016 at 11:20 PM, Michael Paquier > wrote: >> OK, I rewrote a bit the patch as attached. What do you think? > > Committed and back-patched all the way back to 9.2. Thanks! >>>

Re: [HACKERS] Unlogged tables cleanup

2016-12-08 Thread Robert Haas
On Wed, Dec 7, 2016 at 11:20 PM, Michael Paquier wrote: > OK, I rewrote a bit the patch as attached. What do you think? Committed and back-patched all the way back to 9.2. >> Right (I think). If we set and clear delayChkpt around this work, we >> don't need the

Re: [HACKERS] Unlogged tables cleanup

2016-12-07 Thread Michael Paquier
On Thu, Dec 8, 2016 at 6:03 AM, Robert Haas wrote: > Michael, your greetings were passed on to me with a request that I > look at this thread. Thanks for showing up! > On Fri, Nov 18, 2016 at 12:33 PM, Michael Paquier > wrote: More

Re: [HACKERS] Unlogged tables cleanup

2016-12-07 Thread Robert Haas
Michael, your greetings were passed on to me with a request that I look at this thread. On Fri, Nov 18, 2016 at 12:33 PM, Michael Paquier wrote: >>> More seriously, if there could be more details regarding that, I would >>> think that we could say something like

Re: [HACKERS] Unlogged tables cleanup

2016-11-18 Thread Michael Paquier
On Thu, Nov 17, 2016 at 7:06 AM, Robert Haas wrote: > Yeah, but surely it's obvious that if you don't WAL log it, it's not > going to work for archiving or streaming. It's a lot less obvious why > you have to WAL log it when you're not doing either of those things if >

Re: [HACKERS] Unlogged tables cleanup

2016-11-17 Thread Robert Haas
On Wed, Nov 16, 2016 at 11:55 PM, Michael Paquier wrote: > On Wed, Nov 16, 2016 at 7:09 PM, Robert Haas wrote: >> On Wed, Nov 16, 2016 at 3:54 PM, Michael Paquier >> wrote: >>> Indeed I missed this comment block.

Re: [HACKERS] Unlogged tables cleanup

2016-11-16 Thread Michael Paquier
On Wed, Nov 16, 2016 at 7:09 PM, Robert Haas wrote: > On Wed, Nov 16, 2016 at 3:54 PM, Michael Paquier > wrote: >> Indeed I missed this comment block. Please let me suggest the following >> instead: >> /* >> * Set up an init fork for an

Re: [HACKERS] Unlogged tables cleanup

2016-11-16 Thread Robert Haas
On Wed, Nov 16, 2016 at 3:54 PM, Michael Paquier wrote: > On Wed, Nov 16, 2016 at 11:45 AM, Robert Haas wrote: >> The header comment for heap_create_init_fork() says this: >> >> /* >> * Set up an init fork for an unlogged table so that it can be

Re: [HACKERS] Unlogged tables cleanup

2016-11-16 Thread Michael Paquier
On Wed, Nov 16, 2016 at 11:45 AM, Robert Haas wrote: > The header comment for heap_create_init_fork() says this: > > /* > * Set up an init fork for an unlogged table so that it can be correctly > * reinitialized on restart. Since we're going to do an immediate sync, we >

Re: [HACKERS] Unlogged tables cleanup

2016-11-16 Thread Robert Haas
On Thu, Nov 10, 2016 at 9:25 PM, Michael Paquier wrote: > On Thu, Nov 10, 2016 at 10:52 PM, Kuntal Ghosh > wrote: >> On Thu, Nov 10, 2016 at 3:42 PM, Michael Paquier >> wrote: >>> Nah. Looking at the code the fix

Re: [HACKERS] Unlogged tables cleanup

2016-11-10 Thread Michael Paquier
On Thu, Nov 10, 2016 at 10:52 PM, Kuntal Ghosh wrote: > On Thu, Nov 10, 2016 at 3:42 PM, Michael Paquier > wrote: >> Nah. Looking at the code the fix is quite obvious. >> heap_create_init_fork() is checking for XLogIsNeeded() to decide if >>

Re: [HACKERS] Unlogged tables cleanup

2016-11-10 Thread Kuntal Ghosh
On Thu, Nov 10, 2016 at 3:42 PM, Michael Paquier wrote: > On Thu, Nov 10, 2016 at 5:15 PM, Michael Paquier > wrote: >> Okay, so what happens is that the CREATE TABLESPACE record removes the >> tablespace directory and recreates a fresh one,

Re: [HACKERS] Unlogged tables cleanup

2016-11-10 Thread Michael Paquier
On Thu, Nov 10, 2016 at 5:15 PM, Michael Paquier wrote: > Okay, so what happens is that the CREATE TABLESPACE record removes the > tablespace directory and recreates a fresh one, but as no CREATE > records are created for unlogged tables the init fork is not >

Re: [HACKERS] Unlogged tables cleanup

2016-11-10 Thread Michael Paquier
On Thu, Nov 10, 2016 at 4:33 PM, Michael Paquier wrote: > On Thu, Nov 10, 2016 at 4:23 PM, konstantin knizhnik > wrote: >> No, it is latest sources from Postgres repository. >> Please notice that you should create new database and tablespace

Re: [HACKERS] Unlogged tables cleanup

2016-11-09 Thread Michael Paquier
On Thu, Nov 10, 2016 at 4:23 PM, konstantin knizhnik wrote: > No, it is latest sources from Postgres repository. > Please notice that you should create new database and tablespace to reproduce > this issue. > So actually the whole sequence is > > mkdir fs > initdb -D

Re: [HACKERS] Unlogged tables cleanup

2016-11-09 Thread konstantin knizhnik
On Nov 10, 2016, at 10:17 AM, Michael Paquier wrote: > > Hm.. I cannot reproduce what you see on Linux or macos. Perhaps you > have locally a standby pointing as well to this tablespace? No, it is latest sources from Postgres repository. Please notice that you should create new database and

Re: [HACKERS] Unlogged tables cleanup

2016-11-09 Thread Michael Paquier
On Thu, Nov 10, 2016 at 3:29 AM, Robert Haas wrote: > On Wed, Nov 9, 2016 at 11:56 AM, Konstantin Knizhnik > wrote: >> Now simulate server crash using using "pkill -9 postgres". >> >> knizhnik@knizhnik:~/dtm-data$ rm -f logfile ; pg_ctl -D

Re: [HACKERS] Unlogged tables cleanup

2016-11-09 Thread Robert Haas
On Wed, Nov 9, 2016 at 11:56 AM, Konstantin Knizhnik wrote: > Now simulate server crash using using "pkill -9 postgres". > > knizhnik@knizhnik:~/dtm-data$ rm -f logfile ; pg_ctl -D pgsql.master -l > logfile start > pg_ctl: another server might be running; trying to

[HACKERS] Unlogged tables cleanup

2016-11-09 Thread Konstantin Knizhnik
Hi, hackers I wonder if such behavior can be considered as a bug: knizhnik@knizhnik:~/dtm-data$ psql postgres psql (10devel) Type "help" for help. postgres=# create tablespace fs location '/home/knizhnik/dtm-data/fs'; CREATE TABLESPACE postgres=# set default_tablespace=fs; SET postgres=#