Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-24 Thread Robert Haas
On Tue, Nov 23, 2021 at 1:36 PM Robert Haas wrote: > Attached please find the test case not for commit as > v2-0001-dubious-test-case.patch; the fix, for commit and now with a > proper commit message as > v2-0002-Fix-corner-case-failure-to-detect-improper-timeli.patch; and > the back-ported test c

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-23 Thread Robert Haas
On Wed, Nov 17, 2021 at 5:01 PM Robert Haas wrote: > In rescanLatestTimeLine(), the problem is IMHO probably serious enough > to justify a separate commit with back-patching. On second thought, I think it's better not to back-patch this fix. It turns out that, while it's easy enough to back-patch

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-21 Thread Amul Sul
On Fri, Nov 19, 2021 at 12:43 AM Robert Haas wrote: > > On Thu, Nov 18, 2021 at 7:30 AM Amul Sul wrote: > > Somehow with and without patch I am getting the same log. > > Try applying the attached 0001-dubious-test-cast.patch for you and see > if that fails. It does for me. If so, then try applyin

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-19 Thread Alvaro Herrera
On 2021-Nov-18, Robert Haas wrote: > On Thu, Nov 18, 2021 at 2:21 PM Alvaro Herrera > wrote: > > Would it work to start postmaster directly instad of using pg_ctl, and > > then rely on (say) pg_isready? > > I *think* that pg_isready would also fail, because the documentation > says "pg_isready

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-19 Thread Robert Haas
On Thu, Nov 18, 2021 at 4:49 PM Tom Lane wrote: > Robert Haas writes: > > On Thu, Nov 18, 2021 at 3:14 PM Tom Lane wrote: > >> I'm a little dubious that this test case is valuable enough to > >> mess around with a nonstandard postmaster startup protocol, though. > > > The problem that I have wit

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Tom Lane
Robert Haas writes: > On Thu, Nov 18, 2021 at 3:14 PM Tom Lane wrote: >> I'm a little dubious that this test case is valuable enough to >> mess around with a nonstandard postmaster startup protocol, though. > The problem that I have with the present situation is that the test > coverage of xlog.

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Robert Haas
On Thu, Nov 18, 2021 at 3:14 PM Tom Lane wrote: > Robert Haas writes: > > There's a second place where the patch needs to wait for something > > also, and that one I've crudely kludged with sleep(10). If anybody > > around here who is good at figuring out how to write clever TAP tests > > can tel

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Tom Lane
Robert Haas writes: > There's a second place where the patch needs to wait for something > also, and that one I've crudely kludged with sleep(10). If anybody > around here who is good at figuring out how to write clever TAP tests > can tell me how to fix this test to be non-stupid, I will happily

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Robert Haas
On Thu, Nov 18, 2021 at 2:21 PM Alvaro Herrera wrote: > Would it work to start postmaster directly instad of using pg_ctl, and > then rely on (say) pg_isready? I *think* that pg_isready would also fail, because the documentation says "pg_isready returns 0 to the shell if the server is accepting c

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Alvaro Herrera
On 2021-Nov-18, Robert Haas wrote: > Unfortunately, this test case isn't remotely committable as-is, and I > don't know how to make it so. The main problem is that, although you > can start up a server with nothing in pg_wal, no restore_command, and > no archive command, pg_ctl will not believe th

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Robert Haas
On Thu, Nov 18, 2021 at 7:30 AM Amul Sul wrote: > Somehow with and without patch I am getting the same log. Try applying the attached 0001-dubious-test-cast.patch for you and see if that fails. It does for me. If so, then try applying 0002-fix-the-bug.patch and see if that makes it pass. Unfortu

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Amul Sul
On Thu, Nov 18, 2021 at 3:31 AM Robert Haas wrote: > > I spent a lot of time trying to figure out why xlog.c has global > variables ReadRecPtr and EndRecPtr instead of just relying on the > eponymous structure members inside the XLogReaderState. I concluded > that the values are the same at most p

xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-17 Thread Robert Haas
I spent a lot of time trying to figure out why xlog.c has global variables ReadRecPtr and EndRecPtr instead of just relying on the eponymous structure members inside the XLogReaderState. I concluded that the values are the same at most points in the code, and thus that we could just use xlogreaders