Re: Avoid orphaned objects dependencies, take 3
Alexander Lakhin <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-04-24T12:00:00Z
Lists: pgsql-hackers
Attachments
- test-broken-deps.sh.txt (text/plain)
Hi Bertrand, 24.04.2024 11:38, Bertrand Drouvot wrote: >> Please find attached v2 that should not produce the issue anymore (I launched a >> lot of attempts without any issues). v1 was not strong enough as it was not >> always checking for the dependent object existence. v2 now always checks if the >> object still exists after the additional lock acquisition attempt while recording >> the dependency. >> >> I still need to think about v2 but in the meantime could you please also give >> v2 a try on you side? > I gave more thought to v2 and the approach seems reasonable to me. Basically what > it does is that in case the object is already dropped before we take the new lock > (while recording the dependency) then the error message is a "generic" one (means > it does not provide the description of the "already" dropped object). I think it > makes sense to write the patch that way by abandoning the patch's ambition to > tell the description of the dropped object in all the cases. > > Of course, I would be happy to hear others thought about it. > > Please find v3 attached (which is v2 with more comments). Thank you for the improved version! I can confirm that it fixes that case. I've also tested other cases that fail on master (most of them also fail with v1), please try/look at the attached script. (There could be other broken-dependency cases, of course, but I think I've covered all the representative ones.) All tested cases work correctly with v3 applied — I couldn't get broken dependencies, though concurrent create/drop operations can still produce the "cache lookup failed" error, which is probably okay, except that it is an INTERNAL_ERROR, which assumed to be not easily triggered by users. Best regards, Alexander
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid orphaned objects dependencies
- 2fbb21170e90 19 (unreleased) landed
- 5100bdbd3ba2 14 (unreleased) landed
- 5fa137727db0 15 (unreleased) landed
- d9bc0d96c247 16 (unreleased) landed
- 3a9909eda207 17 (unreleased) landed
- c8cd3d6976f7 18 (unreleased) landed
-
Don't try to record dependency on a dropped column's datatype
- fd93ee100830 19 (unreleased) landed
- 36b6ed2606e1 14 (unreleased) landed
- ef3d7b15e4cd 15 (unreleased) landed
- d44cd467471c 16 (unreleased) landed
- c1588f92a915 17 (unreleased) landed
- f9d5a52da4ca 18 (unreleased) landed