postgresql/src/backend/storage
Heikki Linnakangas ee937f0409 Fix data loss when restarting the bulk_write facility
If a user started a bulk write operation on a fork with existing data
to append data in bulk, the bulk_write machinery would zero out all
previously written pages up to the last page written by the new
bulk_write operation.

This is not an issue for PostgreSQL itself, because we never use the
bulk_write facility on a non-empty fork. But there are use cases where
it makes sense. TimescaleDB extension is known to do that to merge
partitions, for example.

Backpatch to v17, where the bulk_write machinery was introduced.

Author: Matthias van de Meent <boekewurm+postgres@gmail.com>
Reported-By: Erik Nordström <erik@timescale.com>
Reviewed-by: Erik Nordström <erik@timescale.com>
Discussion: https://www.postgresql.org/message-id/CACAa4VJ%2BQY4pY7M0ECq29uGkrOygikYtao1UG9yCDFosxaps9g@mail.gmail.com
2024-11-22 16:28:24 +02:00
..
aio Remove unused #include's from backend .c files 2024-10-27 08:26:50 +01:00
buffer Remove a useless cast to (void *) in hash_search() call 2024-11-14 09:30:14 +01:00
file Remove unused #include's from backend .c files 2024-10-27 08:26:50 +01:00
freespace freespace: Don't return blocks past the end of the main fork. 2024-04-13 08:34:20 -07:00
ipc Assign a child slot to every postmaster child process 2024-11-14 16:12:28 +02:00
large_object Deduplicate code in LargeObjectExists and myLargeObjectExists. 2024-09-12 21:45:42 +09:00
lmgr Assign a child slot to every postmaster child process 2024-11-14 16:12:28 +02:00
page Use pg_memory_is_all_zeros() in PageIsVerifiedExtended() 2024-11-18 11:52:35 +09:00
smgr Fix data loss when restarting the bulk_write facility 2024-11-22 16:28:24 +02:00
sync Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
Makefile Provide API for streaming relation data. 2024-04-03 00:49:46 +13:00
meson.build Provide API for streaming relation data. 2024-04-03 00:49:46 +13:00