On 6/23/23 15:18, Ashutosh Bapat wrote: > ... > > I reviewed 0001 and related parts of 0004 and 0008 in detail. > > I have only one major change request, about > typedef struct xl_seq_rec > { > RelFileLocator locator; > + bool created; /* creates a new relfilenode (CREATE/ALTER) */ > > I am not sure what are the repercussions of adding a member to an existing WAL > record. I didn't see any code which handles the old WAL format which doesn't > contain the "created" flag. IIUC, the logical decoding may come across > a WAL record written in the old format after upgrade and restart. Is > that not possible? >
I don't understand why would adding a new field to xl_seq_rec be an issue, considering it's done in a new major version. Sure, if you generate WAL with old build, and start with a patched version, that would break things. But that's true for many other patches, and it's irrelevant for releases. > But I don't think it's necessary. We can add a > decoding routine for RM_SMGR_ID. The decoding routine will add relfilelocator > in XLOG_SMGR_CREATE record to txn->sequences hash. Rest of the logic will work > as is. Of course we will add non-sequence relfilelocators as well but that > should be fine. Creating a new relfilelocator shouldn't be a frequent > operation. If at all we are worried about that, we can add only the > relfilenodes associated with sequences to the hash table. > Hmmmm, that might work. I feel a bit uneasy about having to keep all relfilenodes, not just sequences ... regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company