Re: Missing update of all_hasnulls in BRIN opclasses
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Justin Pryzby <pryzby@telsasoft.com>,
Matthias van de Meent <boekewurm+postgres@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2023-05-19T01:04:13Z
Lists: pgsql-hackers
On 5/18/23 20:45, Tomas Vondra wrote: > ... > > 0001 fixes the issue. 0002 is the original fix, and 0003 is just the > pageinspect changes (for master only). > > For the backbranches, I thought about making the code more like master > (by moving some of the handling from opclasses to brin.c), but decided > not to. It'd be low-risk, but it feels wrong to kinda do what the master > does under "oi_regular_nulls" flag. > I've now pushed all these patches into relevant branches, after some minor last-minute tweaks, and so far it didn't cause any buildfarm issues. Assuming this fully fixes the NULL-handling for BRIN, this leaves just the deadlock issue discussed in [1]. It seems rather unfortunate all these issues went unnoticed / unreported essentially since BRIN was introduced in 9.5. To some extent it might be explained by fairly low likelihood of actually hitting the issue (just the right timing, concurrency with summarization, NULL values, ...). It took me quite a bit of time and luck to (accidentally) hit these issues while stress testing the code. But there's also the problem of writing tests for this kind of thing. To exercise the interesting parts (e.g. the union_tuples), it's necessary to coordinate the order of concurrent steps - but what's a good generic way to do that (which we could do in TAP tests)? In manual testing it's doable by setting breakpoints on a particular lines, and step through the concurrent processes that way. But that doesn't seem like a particularly great solution for regression tests. I can imagine adding some sort of "probes" into the code and then attaching breakpoints to those, but surely we're not the first project needing this ... regards [1] https://www.postgresql.org/message-id/261e68bc-f5f5-5234-fb2c-af4f583513c0@enterprisedb.com -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Show empty BRIN ranges in brin_page_items
- 428c0cae929b 16.0 landed
-
Fix handling of empty ranges and NULLs in BRIN
- 3581cbdcd64f 16.0 landed
- fc7dc728d1a6 11.21 landed
- d78a66d92c73 12.16 landed
- e187693239ad 15.4 landed
- 40d465cafce0 14.9 landed
- 6c512fc6e90d 13.12 landed
-
Fix handling of NULLs when merging BRIN summaries
- b511d7323df6 11.21 landed
- d42ffda685f5 12.16 landed
- 2b1ab28b9dc9 13.12 landed
- 3f1356e5d60a 14.9 landed
- 80f64b90088a 15.4 landed
- 3ec8a3bfb547 16.0 landed
-
Move IS [NOT] NULL handling from BRIN support functions
- 72ccf55cb99c 14.0 cited