postgresql/src/backend/access
Robert Haas 64b2e7ad91 Pass extra data to bgworkers, and use this to fix parallel contexts.
Up until now, the total amount of data that could be passed to a
background worker at startup was one datum, which can be a small as
4 bytes on some systems.  That's enough to pass a dsm_handle or an
array index, but not much else.  Add a bgw_extra flag to the
BackgroundWorker struct, allowing up to 128 bytes to be passed to
a new worker on any platform.

Use this to fix a problem I recently discovered with the parallel
context machinery added in 9.5: the master assigns each worker an
array index, and each worker subsequently assigns itself an array
index, and there's nothing to guarantee that the two sets of indexes
match, leading to chaos.

Normally, I would not back-patch the change to add bgw_extra, since it
is basically a feature addition.  However, since 9.5 is still in beta
and there seems to be no other sensible way to repair the broken
parallel context machinery, back-patch to 9.5.  Existing background
worker code can ignore the bgw_extra field without a problem, but
might need to be recompiled since the structure size has changed.

Report and patch by me.  Review by Amit Kapila.
2015-11-05 12:13:56 -05:00
..
brin Fix BRIN free space computations 2015-10-27 18:17:55 -03:00
common Re-Align *_freeze_max_age reloption limits with corresponding GUC limits. 2015-10-05 11:53:43 +02:00
gin Allow autoanalyze to add pages deleted from pending list to FSM 2015-09-23 15:33:51 +03:00
gist Fix bug introduced by microvacuum for GiST 2015-09-17 14:22:37 +03:00
hash Remove unnecessary variables in _hash_splitbucket(). 2015-04-03 16:49:44 -04:00
heap Fix serialization anomalies due to race conditions on INSERT. 2015-10-31 14:43:34 -05:00
index Plug RLS related information leak in pg_stats view. 2015-07-28 13:21:22 -07:00
nbtree Avoid calling PageGetSpecialPointer() on an all-zeros page. 2015-07-27 12:24:27 +03:00
rmgrdesc Code review for transaction commit timestamps 2015-09-29 14:40:56 -03:00
spgist Don't assume that PageIsEmpty() returns true on an all-zeros page. 2015-07-27 18:54:09 +03:00
tablesample Dodge portability issue (apparent compiler bug) in new tablesample code. 2015-07-25 19:42:32 -04:00
transam Pass extra data to bgworkers, and use this to fix parallel contexts. 2015-11-05 12:13:56 -05:00
Makefile TABLESAMPLE, SQL Standard and extensible 2015-05-15 14:37:10 -04:00