Re: BUG #16931: source code problem about commit_ts

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: zoulx1982(at)163(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16931: source code problem about commit_ts
Date: 2021-03-18 10:19:10
Message-ID: d5b98b4b-a3e3-8095-cfb9-aafb5dbe4f7b@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2021/03/18 13:36, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 16931
> Logged by: lx zou
> Email address: zoulx1982(at)163(dot)com
> PostgreSQL version: 13.2
> Operating system: Linux
> Description:
>
> Hi,
> recently i am reading commit ts code, and i have a problem about it.
> i found commit_ts_redo call TransactionTreeSetCommitTsData with last param
> `write_xlog` true,
> but RecordTransactionCommitPrepared and RecordTransactionCommit call
> TransactionTreeSetCommitTsData
> with `write_xlog` false, which cause there are never xlog with commit_ts -
> COMMIT_TS_SETTS type.
> thanks for your time.

I guess that TransactionTreeSetCommitTsData(write_xlog=true) is basically
used by some extensions using commit_ts.

IIUC commit_ts_redo() is called during recovery. So it's strange that
commit_ts_redo() calls TransactionTreeSetCommitTsData() with write_xlog=true
because no new WAL can be generated during recovery. Probably this is a bug,
and it should be called with write_xlog=false, instead. Patch attached.

Also one problem is that there is no test for WAL replay of COMMIT_TS_SETTS
for now. Maybe this is why we could not find that bug.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachment Content-Type Size
bugfix.patch text/plain 519 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ярослав Пашинский 2021-03-18 12:16:21 Re: BUG #16927: Postgres can`t access WAL files
Previous Message Thomas Munro 2021-03-18 09:21:34 Re: BUG #16925: ERROR: invalid DSA memory alloc request size 1073741824 CONTEXT: parallel worker