On Wed, May 25, 2022 at 8:16 AM Kyotaro Horiguchi <[email protected]> wrote: > > It does "fix" the case of [1]. But AFAIS > RelationSyncEntry.replicate_valid is only used to inhibit repeated > loading in get_rel_sync_entry and the function doesn't seem to be > assumed to return a invalid entry. (Since the flag is not checked > nowhere else.) > > For example pgoutput_change does not check for the flag of the entry > returned from the function before uses it, which is not seemingly > safe. (I didn't check further, though) > > Don't we need to explicitly avoid using invalid entries outside the > function? >
We decide that based on pubactions in the callers, so even if entry is valid, it won't do anything. Actually, we don't need to avoid setting replication_valid flag as some of the publications for the table may be already present. We can check if the publications_valid flag is set while trying to validate the entry. Now, even if we don't find any publications the replicate_valid flag will be set but none of the actions will be set, so it won't do anything in the caller. Is this better than the previous approach? -- With Regards, Amit Kapila.
skip_missing_pubs.2.patch
Description: Binary data
