Do not lock tables in get_tables_to_repack - Mailing list pgsql-hackers

From cca5507
Subject Do not lock tables in get_tables_to_repack
Date
Msg-id tencent_9F290B256A3F52B66542F1140E32ECC64309@qq.com
Whole thread
Responses Re: Do not lock tables in get_tables_to_repack
Re: Do not lock tables in get_tables_to_repack
List pgsql-hackers
Hi hackers,

When doing a whole database repack, we build a list of repackable
tables and take a lock on them to prevent concurrent drops. But
concurrent drops can always happen after we build the list because
we process each table in a separate transaction. The
ConditionalLockRelationOid() also makes the default behavior like
SKIP_LOCKED, which is unexpected.

To remove the locks, we need to make repack_is_permitted_for_relation()
handles concurrent drops correctly: it should not report an error
when failing to search the syscache in pg_class_aclcheck(). Use
pg_class_aclcheck_ext() instead to detect a concurrent drop. Also
check the return value of get_rel_name().

Thoughts?

--
Regards,
ChangAo Chen

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: pg_restore handles extended statistics inconsistently with statistics data
Next
From: Tender Wang
Date:
Subject: Re: assertion failure with unique index + partitioning + join