Commit 32373aa
committed
Fix aoco_relation_size() using wrong snapshot to read pg_aocsseg
aoco_relation_size() used GetLatestSnapshot() to read pg_aocsseg
catalog metadata. During ALTER TABLE SET DISTRIBUTED BY on AOCO
tables, the reader gang's GetLatestSnapshot() cannot see pg_aocsseg
rows written by the writer gang within the same distributed
transaction (uncommitted local xid), causing the function to return
0 bytes. This led to relpages=0 being passed to vac_update_relstats()
alongside a non-zero totalrows from sampling (which correctly uses
GetCatalogSnapshot()), triggering an assertion failure:
FailedAssertion: "Gp_role == GP_ROLE_UTILITY", vacuum.c:1738
Fix by passing NULL to GetAllAOCSFileSegInfo() so that
systable_beginscan() uses GetCatalogSnapshot() internally, consistent
with appendonly_relation_size() for AO row tables.1 parent 0efd878 commit 32373aa
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2044 | 2044 | | |
2045 | 2045 | | |
2046 | 2046 | | |
2047 | | - | |
2048 | 2047 | | |
2049 | 2048 | | |
2050 | 2049 | | |
2051 | 2050 | | |
2052 | 2051 | | |
2053 | 2052 | | |
2054 | | - | |
2055 | | - | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
2056 | 2066 | | |
2057 | 2067 | | |
2058 | 2068 | | |
| |||
2079 | 2089 | | |
2080 | 2090 | | |
2081 | 2091 | | |
2082 | | - | |
2083 | 2092 | | |
2084 | 2093 | | |
2085 | 2094 | | |
| |||
0 commit comments