forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit560bb56
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 parenta70e6e4 commit560bb56
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3756 | 3756 | | |
3757 | 3757 | | |
3758 | 3758 | | |
3759 | | - | |
3760 | 3759 | | |
3761 | | - | |
| 3760 | + | |
3762 | 3761 | | |
3763 | | - | |
3764 | 3762 | | |
3765 | 3763 | | |
3766 | 3764 | | |
| |||
3778 | 3776 | | |
3779 | 3777 | | |
3780 | 3778 | | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
3781 | 3782 | | |
3782 | 3783 | | |
3783 | 3784 | | |
| |||
0 commit comments
Comments
(0)