On 2020-Aug-31, Hao Wu wrote:
> I tested the patch provided by Alvaro. It seems not well in REPEATABLE READ.
> -- the tuples from tpart_2 are gone.
> gpadmin=*# select * from tpart;
> i | j
> ----+----
> 10 | 10
> 50 | 50
> (2 rows)
Interesting example, thanks. It seems this can be fixed without
breaking anything else by changing the planner so that it includes
detached partitions when we are in a snapshot-isolation transaction.
Indeed, the results from the detach-partition-concurrently-1.spec
isolation test are more satisfying with this change.
The attached v2, on current master, includes that change, as well as
fixes a couple of silly bugs in the previous one.
(Because of experimenting with git workflow I did not keep the 0001
part split in this one, but that part is unchanged from v1.)
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services