Commit af930e6
committed
Again fix initialization of auto-tuned effective_cache_size.
The previous method was overly complex and underly correct; in particular,
by assigning the default value with PGC_S_OVERRIDE, it prevented later
attempts to change the setting in postgresql.conf, as noted by Jeff Janes.
We should just assign the default value with source PGC_S_DYNAMIC_DEFAULT,
which will have the desired priority relative to the boot_val as well as
user-set values.
There is still a gap in this method: if there's an explicit assignment of
effective_cache_size = -1 in the postgresql.conf file, and that assignment
appears before shared_buffers is assigned, the code will substitute 4 times
the bootstrap default for shared_buffers, and that value will then persist
(since it will have source PGC_S_FILE). I don't see any very nice way
to avoid that though, and it's not a case to be expected in practice.
The existing comments in guc-file.l look forward to a redesign of the
DYNAMIC_DEFAULT mechanism; if that ever happens, we should consider this
case as one of the things we'd like to improve.1 parent a4c8f14 commit af930e6
2 files changed
+13
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4107 | 4107 | | |
4108 | 4108 | | |
4109 | 4109 | | |
4110 | | - | |
4111 | | - | |
4112 | | - | |
4113 | | - | |
4114 | | - | |
4115 | | - | |
4116 | | - | |
4117 | | - | |
4118 | | - | |
4119 | | - | |
| 4110 | + | |
4120 | 4111 | | |
4121 | 4112 | | |
4122 | 4113 | | |
| |||
4130 | 4121 | | |
4131 | 4122 | | |
4132 | 4123 | | |
4133 | | - | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
4134 | 4130 | | |
4135 | 4131 | | |
4136 | 4132 | | |
4137 | 4133 | | |
4138 | 4134 | | |
4139 | | - | |
4140 | | - | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
4141 | 4138 | | |
4142 | | - | |
4143 | | - | |
4144 | | - | |
4145 | | - | |
4146 | | - | |
4147 | | - | |
4148 | | - | |
4149 | | - | |
| 4139 | + | |
| 4140 | + | |
4150 | 4141 | | |
4151 | 4142 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
| |||
0 commit comments