Hi, While reading the data checksum code, I found that BuildRelationList() filters out non-temporary relations without storage, but does not apply the same filtering to temporary relations. As a result, temporary relations without storage, such as temporary views, are included in the list of relations to wait for even though they are irrelevant to checksum processing. For example, enabling data checksums can unnecessarily wait for a long-lived session that owns only a temporary view.
I think BuildRelationList() should exclude temporary relations without RELKIND_HAS_STORAGE(), matching the existing behavior for non-temporary relations. Attached patch implements this. Also there seems a small race condition. When enabling data checksums online, the launcher assigns the first worker to process the shared catalogs and prevents later workers from doing so. However, if that worker's database is dropped after it has been selected for processing but before checksum processing begins (a very small window), the worker fails without processing the shared catalogs, yet they are still marked as processed. As a result, later workers skip them, and checksum enabling can complete successfully even though the shared catalogs were never processed. To fix this, we should mark the shared catalogs as processed only after a worker completes successfully. Attached patch also implements this. Thoughts? Regards, -- Fujii Masao
v1-0001-Fix-data-checksum-processing-for-temp-relations-a.patch
Description: Binary data
