postgresql/src/include
Daniel Gustafsson bf25e5571b Improve handling of concurrent checksum requests
When pg_{enable|disable}_data_checksums is called while checksums are
being enabled or disabled, the already running launcher is detected
and the new desired state is recorded.  Processing will then pick up
the new state and change its operation to fulfill the new request.
If the same state is requested but with different cost values, the
new cost values will take effect on the next relation processed.

The previous coding had a complex logic of starting a new launcher
for this, which is now avoided with the shared mem structure instead
used to signal current processing.

This makes the logic more robust, and fixes a bug where the launcher
would erroneously revert back to the "off" state.

Access to the shared memory is also protected with LWLocks in all
cases.  Since the shmem structure is used for signalling between
the worker and the launcher, and there can be only one of each,
there were no concurrency issues detected but it's better to stick
to proper locking protocol should this ever be updated to handle
multiple workers.

Author: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Reviewed-by: SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/9197F930-DDEB-4CAC-82A2-16FEC715CCE8@yesql.se
2026-04-30 13:41:53 +02:00
..
access Improve handling of concurrent checksum requests 2026-04-30 13:41:53 +02:00
archive Update copyright for 2026 2026-01-01 13:24:10 -05:00
backup Update copyright for 2026 2026-01-01 13:24:10 -05:00
bootstrap Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
catalog Reduce presence of syscache.h in src/include/ 2026-04-09 08:49:36 +09:00
commands Harmonize function parameter names for Postgres 19. 2026-04-22 12:47:19 -04:00
common Add log file support to logging.c 2026-04-13 10:44:02 +02:00
datatype Update copyright for 2026 2026-01-01 13:24:10 -05:00
executor Fix incorrect logic for hashed IN / NOT IN with non-strict operators 2026-04-24 14:03:12 +12:00
fe_utils Harden astreamer tar parsing logic against archives it can't handle. 2026-04-02 12:20:36 -04:00
foreign Add support for importing statistics from remote servers. 2026-04-08 19:15:00 +09:00
jit jit: No backport::SectionMemoryManager for LLVM 22. 2026-04-03 14:55:11 +13:00
lib Use standard C23 and C++ attributes if available 2026-04-01 08:15:02 +02:00
libpq Remove RADIUS support. 2026-04-08 22:38:43 +12:00
mb Remove MULE_INTERNAL encoding. 2026-04-08 17:40:06 +12:00
nodes Add EXPLAIN (IO) instrumentation for TidRangeScan 2026-04-07 23:25:05 +02:00
optimizer Fix var_is_nonnullable() to handle invalid NOT NULL constraints 2026-04-15 09:38:56 +09:00
parser Mark JumbleState as a const in the post_parse_analyze hook 2026-04-07 15:22:49 +09:00
partitioning Update copyright for 2026 2026-01-01 13:24:10 -05:00
pch Update copyright for 2026 2026-01-01 13:24:10 -05:00
port Allow retrieving x86 TSC frequency/flags from CPUID 2026-04-07 13:00:24 -04:00
portability Add missing PGDLLIMPORT markings 2026-04-08 15:49:33 +02:00
postmaster Harmonize function parameter names for Postgres 19. 2026-04-22 12:47:19 -04:00
regex Update copyright for 2026 2026-01-01 13:24:10 -05:00
replication Harmonize function parameter names for Postgres 19. 2026-04-22 12:47:19 -04:00
rewrite Fix bogus calls in remove_self_join_rel() 2026-04-27 10:40:37 +09:00
snowball Update to latest Snowball sources. 2026-01-05 15:22:37 -05:00
statistics Add support for importing statistics from remote servers. 2026-04-08 19:15:00 +09:00
storage aio: Adjust I/O worker pool automatically. 2026-04-08 19:08:32 +12:00
tcop SQL Property Graph Queries (SQL/PGQ) 2026-03-16 10:14:18 +01:00
tsearch Harmonize function parameter names for Postgres 19. 2026-04-22 12:47:19 -04:00
utils Fix var_is_nonnullable() to handle invalid NOT NULL constraints 2026-04-15 09:38:56 +09:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
fmgr.h Improve type handling of varlena structures 2026-02-11 07:33:24 +09:00
funcapi.h Remove bits* typedefs. 2026-03-30 16:12:08 -05:00
getopt_long.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
Makefile Fix build inconsistency due to the generation of wait-event code 2026-02-02 08:02:39 +09:00
meson.build Ensure that all three build methods install the same set of files. 2026-02-16 15:20:15 -05:00
miscadmin.h Add missing PGDLLIMPORT markings 2026-04-08 15:49:33 +02:00
pg_config.h.in Add errdetail() with PID and UID about source of termination signal. 2026-04-07 10:22:33 -04:00
pg_config_manual.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_getopt.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_trace.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
pgstat.h Fix double-free in pg_stat_autovacuum_scores. 2026-04-09 13:07:06 -05:00
pgtar.h Harden astreamer tar parsing logic against archives it can't handle. 2026-04-02 12:20:36 -04:00
pgtime.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
port.h Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
postgres.h Change PointerGetDatum() back to a macro 2026-04-17 22:14:40 +03:00
postgres_ext.h Move pg_int64 back to postgres_ext.h 2025-09-16 10:48:56 +02:00
postgres_fe.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
varatt.h Improve type handling of varlena structures 2026-02-11 07:33:24 +09:00
windowapi.h Update copyright for 2026 2026-01-01 13:24:10 -05:00