-----Original Message-----
From: liuhuailing@fujitsu.com <liuhuailing@fujitsu.com>
Sent: Tuesday, December 14, 2021 4:55 PM
To: pgsql-hackers@postgresql.org
Subject: Question about HEAP_XMIN_COMMITTED
Hi
I did the following steps on PG.
1. Building a synchronous streaming replication environment.
2. Executing the following SQL statements on primary (1) postgres=# CREATE EXTENSION pageinspect; (2) postgres=# begin; (3) postgres=# select txid_current(); (4) postgres=# create table mytest6(i int); (6) postgres=# insert into mytest6 values(1); (7) postgres=# commit;
3. Executing the following SQL statements on standby (8) postgres=# select * from mytest6; i --- 1 (1 row) (9) postgres=# SELECT t_infomask FROM heap_page_items(get_raw_page('pg_class', 0)) where t_xmin=502※;
t_infomask ------------ 2049 (1 row) ※502 is the transaction ID returned by step (3) above.
In the result of step (9),the value of the t_infomask field is 2049(0x801) which means that HEAP_XMAX_INVALID and HEAP_HASNULL flags were setted, but HEAP_XMIN_COMMITTED flag was not setted.
According to source , when step (8) was executed,SetHintBits function were called to set HEAP_XMIN_COMMITTED.
however, the minRecoveryPoint value was not updated. So HEAP_XMIN_COMMITTED flag was not setted successfully.
After CheckPoint, select from mytest6 again in another session, we can see HEAP_XMIN_COMMITTED flag was setted.
So my question is that before checkpoint, HEAP_XMIN_COMMITTED flag was not setted correctly, right?
Or we need to move minRecoveryPoint forword to make HEAP_XMIN_COMMITTED flag setted correctly when first select from mytest6.
Best Regards, LiuHuailing
--
以上
Liu Huailing
--------------------------------------------------
Liu Huailing
Development Department III
Software Division II
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue, Nanjing, 210012, China
TEL : +86+25-86630566-8439
COINS: 7998-8439
FAX : +86+25-83317685
MAIL : liuhuailing@cn.fujitsu.com
--------------------------------------------------