Re: when set track_commit_timestamp on, database system abort startup

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: 李海龙 <hailong(dot)li(at)qunar(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: when set track_commit_timestamp on, database system abort startup
Date: 2018-09-14 15:17:14
Message-ID: CAD21AoB5K1qJm+wj+TTCP-sFPiSdnd0LGd_pNAfi3VXrGKfdjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 14, 2018 at 4:27 PM, 李海龙 <hailong(dot)li(at)qunar(dot)com> wrote:
>
> HI, Dear pgsql-hackers
>
>
> The details are as follows:
>
>
> Environment:
>
> OS: CentOS 6.7 (Final), Linux 3.18.48-11.el6.x86_64 x86_64, 64-bit
>
>
> PostgreSQL:
>
> postgres=# select version();
> version
> ---------------------------------------------------------------------------------------------------------
> PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7
> 20120313 (Red Hat 4.4.7-16), 64-bit
> (1 row)
>
> postgres=# show wal_level ;
> wal_level
> -----------
> replica
> (1 row)
>
>
> When I enable the parameter track_commit_timestamp in postgresql.conf of a
> Base Backup (making a Base Backup from a standby and the
> track_commit_timestamp is off on it),
>

In addition to the above operation, I've reproduced this issue by
replaying a commit WAL record that sets the timestamp to a new page
during the crash recovery (or from restart).

It seems to me that the cause of this is that we could not extend
commitTs page since the COMMIT_TS_ZEROPAGE WAL wasn't generated at the
standby server whose track_commit_timestamp is off. So during
replaying the commit WAL record the startup process fails since the
corresponding commitTs page doesn't exist.

To fix that maybe we can disable commitTs if
controlFile->track_commit_timestamp == false and the
track_commit_timestamp == true even in crash recovery.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Travers 2018-09-14 15:21:59 Re: Code of Conduct plan
Previous Message Stephen Frost 2018-09-14 15:12:52 Re: Code of Conduct plan