gpcheckcat: add check for orphaned TOAST tables
There are four main types of orphan TOAST tables: - Double Orphan TOAST tables due to a missing reltoastrelid in pg_class and a missing pg_depend entry. - Bad Reference Orphaned TOAST tables due to a missing reltoastrelid in pg_class. - Bad Dependency Orphaned TOAST tables due to a missing entry in pg_depend. - Mismatch Orphaned TOAST tables due to reltoastrelid in pg_class pointing to an incorrect TOAST table. Repair scripts are done on a per-segment basis since catalog changes are required. Note: A repair script cannot be generated for mismatch orphan TOAST tables because the current repair implmentation does not work with two or more tables, so let the user repair manually for safety. A manual catalogue change is needed to fix by updating the pg_depend TOAST table entry and setting the refobjid field to the correct dependent table. Similarly, we do not attempt to repair double-orphan situations. Authored-by: NKalen Krempely <kkrempely@pivotal.io> Co-Authored-by: NMark Sliva <msliva@pivotal.io> Co-Authored-by: NJamie McAtamney <jmcatamney@pivotal.io> Co-authored-by: NJimmy Yih <jyih@pivotal.io>
Showing
想要评论请 注册 或 登录