RE: Streaming decoding fails with "unexpected table_index_fetch_tuple call during logical decoding" when a relation has a TOASTed conbin (follow-up to BUG #18641) - Mailing list pgsql-bugs

From Hayato Kuroda (Fujitsu)
Subject RE: Streaming decoding fails with "unexpected table_index_fetch_tuple call during logical decoding" when a relation has a TOASTed conbin (follow-up to BUG #18641)
Date
Msg-id TY5PR01MB18314D78378E3EB0468D5F368F5952@TY5PR01MB18314.jpnprd01.prod.outlook.com
Whole thread
In response to Re: Streaming decoding fails with "unexpected table_index_fetch_tuple call during logical decoding" when a relation has a TOASTed conbin (follow-up to BUG #18641)  (Jiří Kavalík <jiri.kavalik@comgate.cz>)
Responses Re: Streaming decoding fails with "unexpected table_index_fetch_tuple call during logical decoding" when a relation has a TOASTed conbin (follow-up to BUG #18641)
List pgsql-bugs
Hi Jiří,

Thanks for the test. I understood that no issues were found for now.

> One question while reading the patch, not a problem I could trigger: the depth
> is incremented in systable_beginscan* and decremented in systable_endscan* only
> if CheckXidAlive is valid, and that is evaluated separately at each end. If
> CheckXidAlive changed while a scan was open, the counter would be off by one.
> I could not find a path where that happens. Error paths look fine, since
> AbortTransaction/AbortSubTransaction call ResetLogicalStreamingState(). If a
> SysScanDesc field is acceptable despite the header concern, remembering in the
> scan whether it was counted would make the pairing explicit.

Hmm, I'm not excited to modify the exposed data structure yet, unless there is a
real issue. Per my analysis, SysScanDescData only contains pointers (8 bytes),
it does not have any paddings. This meant we need to modify a size of the data
structure, it might cause failures somewhere.
Also, the existing code has the same possibility while turning on/off bsysscan,
right? So I feel it's already accepted.
(Of course, we must fix if it causes a real failure)

Best regards,
Hayato Kuroda
FUJITSU LIMITED


pgsql-bugs by date:

Previous
From: Narayanan Venkateswaran
Date:
Subject: Re: BUG #19737: Empty `JSON_OBJECT` cannot use documented `ON NULL` or unique-key clauses
Next
From: Jiří Kavalík
Date:
Subject: Re: Streaming decoding fails with "unexpected table_index_fetch_tuple call during logical decoding" when a relation has a TOASTed conbin (follow-up to BUG #18641)