On Wed, Nov 16, 2022 at 12:41 PM Himanshu Upadhyaya < upadhyaya.himan...@gmail.com> wrote:
> > >> > + } >> > + >> > + /* Loop over offsets and validate the data in the >> predecessor array. */ >> > + for (OffsetNumber currentoffnum = FirstOffsetNumber; >> currentoffnum <= maxoff; >> > + currentoffnum = OffsetNumberNext(currentoffnum)) >> > + { >> > + HeapTupleHeader pred_htup; >> > + HeapTupleHeader curr_htup; >> > + TransactionId pred_xmin; >> > + TransactionId curr_xmin; >> > + ItemId pred_lp; >> > + ItemId curr_lp; >> > + >> > + ctx.offnum = predecessor[currentoffnum]; >> > + ctx.attnum = -1; >> > + >> > + if (ctx.offnum == 0) >> > + { >> > + /* >> > + * Either the root of the chain or an >> xmin-aborted tuple from >> > + * an abandoned portion of the HOT chain. >> > + */ >> >> Hm - couldn't we check that the tuple could conceivably be at the root of >> a >> chain? I.e. isn't HEAP_HOT_UPDATED? Or alternatively has an aborted xmin? >> >> > I don't see a way to check if tuple is at the root of HOT chain because > predecessor array will always be having either xmin from non-abandoned > transaction or it will be zero. We can't differentiate root or tuple > inserted via abandoned transaction. > > I was wrong here. I think this can be done and will be doing these changes in my next patch. -- Regards, Himanshu Upadhyaya EnterpriseDB: http://www.enterprisedb.com