Remove redundant ftruncate() for POSIX DSM memory.
authorThomas Munro <tmunro@postgresql.org>
Thu, 14 Jul 2022 07:23:35 +0000 (19:23 +1200)
committerThomas Munro <tmunro@postgresql.org>
Thu, 14 Jul 2022 11:56:22 +0000 (23:56 +1200)
commit712704d3539e5ed6807e0b46fddaaf8ed47c2403
tree27343b27c62cc9027aad76b2400fd166878708b5
parent4518c798b2b9a84958eca4cde6e7e450b6150da6
Remove redundant ftruncate() for POSIX DSM memory.

In early releases of the DSM infrastructure, it was possible to resize
segments.  That was removed in release 12 by commit 3c60d0fa.  Now the
ftruncate() + posix_fallocate() sequence during DSM segment creation has
a redundant step: we're always extending from zero to the desired size,
so we might as well just call posix_fallocate().

Let's also include the remaining ftruncate() call (non-Linux POSIX
systems) in the wait event reporting, for good measure.

Discussion: https://postgr.es/m/CA%2BhUKGJSm-nq8s%2B_59zb7NbFQF-OS%3DxTnTAiGLrQpuSmU2y_1A%40mail.gmail.com
src/backend/storage/ipc/dsm_impl.c