-
Notifications
You must be signed in to change notification settings - Fork 2
Comparing changes
Open a pull request
base repository: postgresql-cfbot/postgresql
base: cf/5162~1
head repository: postgresql-cfbot/postgresql
compare: cf/5162
- 5 commits
- 2 files changed
- 3 contributors
Commits on Apr 3, 2025
-
Fix autoprewarm neglect of tablespaces
While prewarming blocks from a dump file, autoprewarm_database_main() mistakenly ignored tablespace when detecting the beginning of the next relation to prewarm. Because RelFileNumbers are only unique within a tablespace, autoprewarm could miss prewarming blocks from a relation with the same RelFileNumber in a different tablespace. Though this situation is likely rare in practice, it's best to make the code correct. Do so by explicitly checking for the RelFileNumber when detecting a new relation. Reported-by: Heikki Linnakangas <[email protected]> Discussion: https://postgr.es/m/97c36982-603b-494a-95f4-aaf2a12ac27e%40iki.fi
Configuration menu - View commit details
-
Copy full SHA for da5ffbc - Browse repository at this point
Copy the full SHA da5ffbcView commit details -
Remove superfluous autoprewarm check
autoprewarm_database_main() prewarms blocks from the same database. It is passed an array of sorted BlockInfoRecords and a start and stop index into the array. The range represented should include only blocks belonging to global objects or blocks from a single database. Remove an unnecessary check that the current block is from the same database and add an assert to ensure this invariant remains.
Configuration menu - View commit details
-
Copy full SHA for a6c7f21 - Browse repository at this point
Copy the full SHA a6c7f21View commit details -
Refactor autoprewarm_database_main() in preparation for read stream
Autoprewarm prewarms blocks from a dump file representing the contents of shared buffers at the time it was dumped. It uses a sorted array of BlockInfoRecords, each representing a block from one of the cluster's databases and tables. autoprewarm_database_main() prewarms all the blocks from a single database. It is optimized to ensure we don't try to open the same relation or fork over and over again if it has been dropped or is invalid. The main loop handled this by carefully setting various local variables to sentinel values when a run of blocks should be skipped. This method won't work with the read stream API. A read stream can only be created for a single relation and fork combination. The callback has to be able to advance the position in the array to allow for reading ahead additional blocks, however the callback cannot try to open another relation or close the current relation. So, the main loop in autoprewarm_database_main() must also advance the position in the array of BlockInfoRecords. To make it compatible with the read stream API, change autoprewarm_database_main() to explicitly fast-forward in the array past the blocks belonging to an invalid relation or fork. This commit only implements the new control flow -- it does not use the read stream API. Co-authored-by: Nazir Bilal Yavuz <[email protected]> Co-authored-by: Melanie Plageman <[email protected]> Reviewed-by: Heikki Linnakangas <[email protected]> Reviewed-by: Daniel Gustafsson <[email protected]> Discussion: https://postgr.es/m/flat/CAN55FZ3n8Gd%2BhajbL%3D5UkGzu_aHGRqnn%2BxktXq2fuds%3D1AOR6Q%40mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 98d3496 - Browse repository at this point
Copy the full SHA 98d3496View commit details -
Use streaming read I/O in autoprewarm
Make a read stream for each valid fork of each valid relation represented in the autoprewarm dump file and prewarm those blocks through the read stream API instead of by directly invoking ReadBuffer(). Co-authored-by: Nazir Bilal Yavuz <[email protected]> Co-authored-by: Melanie Plageman <[email protected]> Reviewed-by: Heikki Linnakangas <[email protected]> Reviewed-by: Daniel Gustafsson <[email protected]> Reviewed-by: Andrey M. Borodin <[email protected]> (earlier versions) Reviewed-by: Kirill Reshke <[email protected]> (earlier versions) Reviewed-by: Matheus Alcantara <[email protected]> (earlier versions) Discussion: https://postgr.es/m/flat/CAN55FZ3n8Gd%2BhajbL%3D5UkGzu_aHGRqnn%2BxktXq2fuds%3D1AOR6Q%40mail.gmail.com
Configuration menu - View commit details
-
Copy full SHA for 15e22a2 - Browse repository at this point
Copy the full SHA 15e22a2View commit details -
[CF 5162] v14 - Use read streams in autoprewarm
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5162 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAAKRu_Yk5c9O_9pvKN0CxkDD+oOX2iVNaDc57k_wJke+jOOyQQ@mail.gmail.com Author(s): Nazir Bilal Yavuz
Commitfest Bot committedApr 3, 2025 Configuration menu - View commit details
-
Copy full SHA for 9bbc10e - Browse repository at this point
Copy the full SHA 9bbc10eView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/5162~1...cf/5162