forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5df319f
committed
Fix memory leak and inefficiency in CREATE DATABASE ... STRATEGY WAL_LOG
RelationCopyStorageUsingBuffer() did not free the strategies used to accessthe source / target relation. They memory was released at the end of thetransaction, but when using a template database with a lot of relations, thetemporary leak can become big prohibitively big.RelationCopyStorageUsingBuffer() acquired the buffer for the target relationwith RBM_NORMAL, therefore requiring a read of a block guaranteed to bezero. Use RBM_ZERO_AND_LOCK instead.Reviewed-by: Robert Haas <robertmhaas@gmail.com>Discussion:https://postgr.es/m/20230321070113.o2vqqxogjykwgfrr@awork3.anarazel.deBackpatch: 15-, where STRATEGY WAL_LOG was introduced1 parentbbc1376 commit5df319f
1 file changed
+4
-3
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3833 | 3833 |
| |
3834 | 3834 |
| |
3835 | 3835 |
| |
3836 |
| - | |
3837 | 3836 |
| |
3838 |
| - | |
| 3837 | + | |
3839 | 3838 |
| |
3840 |
| - | |
3841 | 3839 |
| |
3842 | 3840 |
| |
3843 | 3841 |
| |
| |||
3855 | 3853 |
| |
3856 | 3854 |
| |
3857 | 3855 |
| |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
3858 | 3859 |
| |
3859 | 3860 |
| |
3860 | 3861 |
| |
|
0 commit comments
Comments
(0)