Fix assertion failure when vacuuming an AO table in utility mode.
There's an assertion in vac_update_relstats(), that if num_tuples is non-zero, num_pages must also be non-zero. Makes sense: if the table takes up no space, there can't be any tuples in it. But we hit that case, on vacuum of an AO table in the QD node in utility mode. The QD has the total tuple counts in each AO segment in the pg_aoseg table, across the whole cluster, but it doesn't have the physical sizes. So it reported N tuples, but 0 bytes. We started hitting that assertion after commit c0ce2eb9, which fixed the rounding in RelationGuessNumberOfBlocks(), so that it now returns 0 blocks, for 0-byte relation. It used to return 1, which masked the problem. Fix by reporting 0 tuples and 0 blocks in the QD. That's a change from the old behaviour, which was to report N tuples and 1 block, but it's consistent with heap tables. Reviewed-by: NJacob Champion <pchampion@pivotal.io> Reviewed-by: NAshwin Agrawal <aagrawal@pivotal.io>
Showing
想要评论请 注册 或 登录