Re: pg11.1: dsa_area could not attach to segment
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Sergei Kornilov <sk@zsrv.org>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2019-02-14T16:20:10Z
Lists: pgsql-hackers
On Fri, Feb 15, 2019 at 01:12:35AM +1300, Thomas Munro wrote: > The problem is that a DSM handle (ie a random number) can be reused > for a new segment immediately after the shared memory object has been > destroyed but before the DSM slot has been released. Now two DSM > slots have the same handle, and dsm_attach() can be confused by the > old segment and give up. > > Here's a draft patch to fix that. It also clears the handle in a case > where it wasn't previously cleared, but that wasn't strictly > necessary. It just made debugging less confusing. Thanks. Do you think that plausibly explains and resolves symptoms of bug#15585, too? Justin
Commits
-
Fix race in dsm_attach() when handles are reused.
- 6c0fb9418925 12.0 landed
- bd195071fd2b 9.4.22 landed
- b7c8766d3480 9.5.17 landed
- cb0680573f7b 9.6.13 landed
- cb3d674e1709 10.8 landed
- faf132449c0c 11.3 landed
-
Refactor pid, random seed and start time initialization.
- 197e4af9d5da 12.0 cited