Re: FailedAssertion("pd_idx == pinfo->nparts", File: "execPartition.c", Line: 1689)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andy Fan <zhihui.fan1213@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Amit Langote <amitlangote09@gmail.com>,
Justin Pryzby <pryzby@telsasoft.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-08-07T00:32:33Z
Lists: pgsql-hackers
Attachments
- v3-0001-add-execution-delay-testing.patch (text/x-diff) patch v3-0001
Andy Fan <zhihui.fan1213@gmail.com> writes: > Attached is the v2 patch. Forgot to mention that I'd envisioned adding this as a src/test/modules/ module; contrib/ is for things that we intend to expose to users, which I think this isn't. I played around with this and got the isolation test I'd experimented with yesterday to work with it. If you revert 7a980dfc6 then the attached patch will expose that bug. Interestingly, I had to add an explicit AcceptInvalidationMessages() call to reproduce the bug; so apparently we do none of those between planning and execution in the ordinary query code path. Arguably, that means we're testing a scenario somewhat different from what can happen in live databases, but I think it's OK. Amit's recipe for reproducing the bug works because there are other relation lock acquisitions (and hence AcceptInvalidationMessages calls) later in planning than where he asked us to wait. So this effectively tests a scenario where a very late A.I.M. call within the planner detects an inval event for some already-planned relation, and that seems like a valid-enough scenario. Anyway, attached find a reviewed version of your patch plus a test scenario contributed by me (I was too lazy to split it into two patches). Barring objections, I'll push this tomorrow or so. (BTW, I checked and found that this test does *not* expose the problems with Amit's original patch. Not sure if it's worth trying to finagle it so it does.) regards, tom lane
Commits
-
Support testing of cases where table schemas change after planning.
- 6f0b632f083b 14.0 landed
-
Fix matching of sub-partitions when a partitioned plan is stale.
- f992da210ff8 12.4 landed
- c43a36fa8fff 13.0 landed
- 7a980dfc6c15 14.0 landed
-
Speed up planning when partitions can be pruned at plan time.
- 428b260f87e8 12.0 cited
-
Allow ATTACH PARTITION with only ShareUpdateExclusiveLock.
- 898e5e3290a7 12.0 cited