> On Oct 28, 2020, at 6:44 AM, Konstantin Knizhnik <k.knizh...@postgrespro.ru> 
> wrote:
> 
> Looks like there is no assumption that xmax should be set to 
> InvalidTransactionId when HEAP_XMAX_INVALID bit is set.
> And I didn't find any check  preventing cutoff_xid to be greater than XID of 
> some transaction which was aborted long time ago.

Nothing in your example suggests that cutoff_xid is wrong, so I'd assume that 
part is probably working ok.

Your data shows that HEAP_XMAX_INVALID and HEAP_UPDATED flags are both set.  
That should only happen if the updating transaction aborted.  But the query of 
clog is saying that it committed. Something is wrong with that.  How did the 
hint bits get set to HEAP_XMAX_INVALID if the transaction did commit.  Either 
some process is setting that hint bit when it shouldn't, or your clog is 
corrupted and returning a bogus answer about the xmax having been committed.  
Either way, you've got corruption.

Your question "preventing cutoff_xid to be greater than XID of some transaction 
which was aborted long time ago" seems to be ignoring that 
TransactionIdDidCommit(xid) is returning true, suggesting the transaction did 
not abort.

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





Reply via email to