Re: Fix of fake unlogged LSN initialization

2019-10-28 Thread Michael Paquier
On Fri, Oct 25, 2019 at 09:54:53AM +0300, Heikki Linnakangas wrote: > No particular reason, it's just a nice round value in decimal. Well: $ pg_controldata | grep -i fake Fake LSN counter for unlogged rels: 0/3E8 ;p -- Michael signature.asc Description: PGP signature

Re: Fix of fake unlogged LSN initialization

2019-10-26 Thread Dilip Kumar
On Fri, Oct 25, 2019 at 7:42 AM tsunakawa.ta...@fujitsu.com wrote: > > From: Dilip Kumar > > I have noticed that in StartupXlog also we reset it with 1, you might > > want to fix that as well? > > > > StartupXLOG > > { > > ... > > /* > > * Initialize unlogged LSN. On a clean shutdown, it's restor

Re: Fix of fake unlogged LSN initialization

2019-10-26 Thread Michael Paquier
On Fri, Oct 25, 2019 at 02:11:55AM +, tsunakawa.ta...@fujitsu.com wrote: > Thanks for taking a look. I'm afraid my patch includes the fix for this part. Yes. And now this is applied and back-patched. -- Michael signature.asc Description: PGP signature

RE: Fix of fake unlogged LSN initialization

2019-10-25 Thread tsunakawa.ta...@fujitsu.com
From: Dilip Kumar > I have noticed that in StartupXlog also we reset it with 1, you might > want to fix that as well? > > StartupXLOG > { > ... > /* > * Initialize unlogged LSN. On a clean shutdown, it's restored from the > * control file. On recovery, all unlogged relations are blown away, so >

RE: Fix of fake unlogged LSN initialization

2019-10-25 Thread tsunakawa.ta...@fujitsu.com
From: Simon Riggs > From xlogdefs.h added by 9155580: > /* >* First LSN to use for "fake" LSNs. >* >* Values smaller than this can be used for special per-AM purposes. >*/ > #define FirstNormalUnloggedLSN ((XLogRecPtr) 1000) Yeah, I had seen it,

Re: Fix of fake unlogged LSN initialization

2019-10-24 Thread Michael Paquier
On Fri, Oct 25, 2019 at 02:07:04AM +, tsunakawa.ta...@fujitsu.com wrote: > From: Simon Riggs >> From xlogdefs.h added by 9155580: >> /* >> * First LSN to use for "fake" LSNs. >> * >> * Values smaller than this can be used for special per-AM purposes. >> */ >>

Re: Fix of fake unlogged LSN initialization

2019-10-24 Thread Michael Paquier
On Thu, Oct 24, 2019 at 01:57:45PM +0530, Dilip Kumar wrote: > I have noticed that in StartupXlog also we reset it with 1, you might > want to fix that as well? Tsunakawa-san's patch fixes that spot already. Grepping for unloggedLSN in the code there is only pg_resetwal on top of what you are men

Re: Fix of fake unlogged LSN initialization

2019-10-24 Thread Heikki Linnakangas
On 24/10/2019 15:08, Michael Paquier wrote: On Thu, Oct 24, 2019 at 11:57:33AM +0100, Simon Riggs wrote: I wonder why is that value 1000, rather than an aligned value or a whole WAL page? Good question. Heikki, why this choice? No particular reason, it's just a nice round value in decimal.

Re: Fix of fake unlogged LSN initialization

2019-10-24 Thread Michael Paquier
On Thu, Oct 24, 2019 at 11:57:33AM +0100, Simon Riggs wrote: > I wonder why is that value 1000, rather than an aligned value or a whole > WAL page? Good question. Heikki, why this choice? -- Michael signature.asc Description: PGP signature

Re: Fix of fake unlogged LSN initialization

2019-10-24 Thread Simon Riggs
On Mon, 21 Oct 2019 at 06:03, Michael Paquier wrote: > On Sat, Oct 19, 2019 at 05:03:00AM +, tsunakawa.ta...@fujitsu.com > wrote: > > The attached trivial patch fixes the initialization of the fake > > unlogged LSN. Currently, BootstrapXLOG() in initdb sets the initial > > fake unlogged LSN

Re: Fix of fake unlogged LSN initialization

2019-10-24 Thread Dilip Kumar
On Sat, Oct 19, 2019 at 3:18 PM tsunakawa.ta...@fujitsu.com wrote: > > Hello, > > > The attached trivial patch fixes the initialization of the fake unlogged LSN. > Currently, BootstrapXLOG() in initdb sets the initial fake unlogged LSN to > FirstNormalUnloggedLSN (=1000), but the recovery and p

Re: Fix of fake unlogged LSN initialization

2019-10-23 Thread Kyotaro Horiguchi
At Mon, 21 Oct 2019 14:03:47 +0900, Michael Paquier wrote in > On Sat, Oct 19, 2019 at 05:03:00AM +, tsunakawa.ta...@fujitsu.com wrote: > > The attached trivial patch fixes the initialization of the fake > > unlogged LSN. Currently, BootstrapXLOG() in initdb sets the initial > > fake unlogg

Re: Fix of fake unlogged LSN initialization

2019-10-20 Thread Michael Paquier
On Sat, Oct 19, 2019 at 05:03:00AM +, tsunakawa.ta...@fujitsu.com wrote: > The attached trivial patch fixes the initialization of the fake > unlogged LSN. Currently, BootstrapXLOG() in initdb sets the initial > fake unlogged LSN to FirstNormalUnloggedLSN (=1000), but the > recovery and pg_rese