Re: POC: Sharing record typmods between backends
Thomas Munro <thomas.munro@enterprisedb.com>
Attachments
- shared-record-typmods-v9.patchset.tgz (application/x-gzip)
On Wed, Aug 23, 2017 at 11:58 PM, Thomas Munro <thomas.munro@enterprisedb.com> wrote: > On Wed, Aug 23, 2017 at 5:46 PM, Andres Freund <andres@anarazel.de> wrote: >> Notes for possible followup commits of the dshash API: >> - nontrivial portions of dsahash are essentially critical sections lest >> dynamic shared memory is leaked. Should we, short term, introduce >> actual critical section markers to make that more obvious? Should we, >> longer term, make this more failsafe / easier to use, by >> extending/emulating memory contexts for dsa memory? > > Hmm. I will look into this. Yeah, dshash_create() leaks the control object if the later allocation of the initial hash table array raises an error. I think that should be fixed -- please see 0001 in the new patch set attached. The other two places where shared memory is allocated are resize() and insert_into_bucket(), and both of those seem exception-safe to me: if dsa_allocate() elogs then nothing is changed, and the code after that point is no-throw. Am I missing something? >> - SharedRecordTypmodRegistryInit() is called from GetSessionDsmHandle() >> which calls EnsureCurrentSession(), but >> SharedRecordTypmodRegistryInit() does so again - sprinkling those >> around liberally seems like it could hide bugs. > > Yeah. Will look into this. One idea is to run InitializeSession() in InitPostgres() instead, so that CurrentSession is initialized at startup, but initially empty. See attached. (I realised that that terminology is a bit like a large volume called FRENCH CUISINE which turns out to have just one recipe for an omelette in it, but you have to start somewhere...) Better ideas? -- Thomas Munro http://www.enterprisedb.com
Commits
-
Remove TupleDesc remapping logic from tqueue.c.
- 6b65a7fe62e1 11.0 landed
-
Add support for coordinating record typmods among parallel workers.
- cc5f81366c36 11.0 landed
-
Improve division of labor between execParallel.c and nodeGather[Merge].c.
- 51daa7bdb39e 11.0 cited
-
Add minimal regression test for blessed record type transfer.
- d36f7efb39e1 11.0 landed
-
Consolidate the function pointer types used by dshash.c.
- d7694fc14870 11.0 landed
-
Fix unlikely shared memory leak after failure in dshash_create().
- 4569715bd6fa 11.0 landed
-
Refactor typcache.c's record typmod hash table.
- 35ea75632a56 11.0 landed
-
Add a hash_combine function for mixing hash values.
- 0052a0243d9c 11.0 landed
-
Backpatch introduction of TupleDescAttr(tupdesc, i).
- 8cda1fadd25b 9.2.23 landed
- 5b286cae3cc1 9.3.19 landed
- 3d58994eccb7 9.4.14 landed
- d778a77d38be 9.5.9 landed
- 6c036d01089c 9.6.5 landed
- d34a74dd064a 10.0 landed
-
Partially flatten struct tupleDesc so that it can be used in DSM.
- c6293249dc17 11.0 landed
-
Change tupledesc->attrs[n] to TupleDescAttr(tupledesc, n).
- 2cd708452400 11.0 landed