Merge lp:~stub/charms/trusty/postgresql/bug-1415490-max_prepared_transactions into lp:charms/trusty/postgresql
- Trusty Tahr (14.04)
- bug-1415490-max_prepared_transactions
- Merge into trunk
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 118 | ||||||||||||
Proposed branch: | lp:~stub/charms/trusty/postgresql/bug-1415490-max_prepared_transactions | ||||||||||||
Merge into: | lp:charms/trusty/postgresql | ||||||||||||
Diff against target: |
665 lines (+105/-87) 7 files modified
Makefile (+3/-1) config.yaml (+72/-64) hooks/helpers.py (+2/-4) hooks/hooks.py (+14/-15) hooks/test_hooks.py (+0/-1) templates/postgresql.conf.tmpl (+13/-0) test.py (+1/-2) |
||||||||||||
To merge this branch: | bzr merge lp:~stub/charms/trusty/postgresql/bug-1415490-max_prepared_transactions | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Barry Price | Approve | ||
Review Queue (community) | automated testing | Needs Fixing | |
charmers | Pending | ||
Review via email: mp+250611@code.launchpad.net |
Commit message
Description of the change
Add some tunables needed for Launchpad and Landscape deployments.
Also remove a config item that has done nothing for ages, and remove beta
comments about the no-longer beta PostgreSQL 9.4.
- 120. By Stuart Bishop
-
Fix unittests
Review Queue (review-queue) wrote : | # |
- 121. By Stuart Bishop
-
delint
Review Queue (review-queue) wrote : | # |
This items has failed automated testing! Results available here http://
- 122. By Stuart Bishop
-
delint
Review Queue (review-queue) wrote : | # |
This items has failed automated testing! Results available here http://
Review Queue (review-queue) wrote : | # |
This items has failed automated testing! Results available here http://
Review Queue (review-queue) wrote : | # |
This items has failed automated testing! Results available here http://
- 123. By Stuart Bishop
-
Checkpoint tuning options
Barry Price (barryprice) wrote : | # |
Looks good to me, +1
Preview Diff
1 | === modified file 'Makefile' | |||
2 | --- Makefile 2014-10-24 06:31:15 +0000 | |||
3 | +++ Makefile 2015-03-12 10:18:52 +0000 | |||
4 | @@ -34,6 +34,7 @@ | |||
5 | 34 | trial test.PG91Tests | 34 | trial test.PG91Tests |
6 | 35 | trial test.PG92Tests | 35 | trial test.PG92Tests |
7 | 36 | trial test.PG93Tests | 36 | trial test.PG93Tests |
8 | 37 | trial test.PG94Tests | ||
9 | 37 | 38 | ||
10 | 38 | integration_test_91: | 39 | integration_test_91: |
11 | 39 | @echo "PostgreSQL 9.1 integration tests, ${SERIES}" | 40 | @echo "PostgreSQL 9.1 integration tests, ${SERIES}" |
12 | @@ -48,13 +49,14 @@ | |||
13 | 48 | trial test.PG93Tests | 49 | trial test.PG93Tests |
14 | 49 | 50 | ||
15 | 50 | integration_test_94: | 51 | integration_test_94: |
17 | 51 | @echo "PostgreSQL 9.4 (beta) integration tests, ${SERIES}" | 52 | @echo "PostgreSQL 9.4 integration tests, ${SERIES}" |
18 | 52 | trial test.PG94Tests | 53 | trial test.PG94Tests |
19 | 53 | 54 | ||
20 | 54 | lint: | 55 | lint: |
21 | 55 | @echo "Lint check (flake8)" | 56 | @echo "Lint check (flake8)" |
22 | 56 | @flake8 -v \ | 57 | @flake8 -v \ |
23 | 57 | --exclude hooks/charmhelpers,hooks/_trial_temp \ | 58 | --exclude hooks/charmhelpers,hooks/_trial_temp \ |
24 | 59 | --ignore=E402 \ | ||
25 | 58 | hooks testing tests test.py | 60 | hooks testing tests test.py |
26 | 59 | 61 | ||
27 | 60 | sync: | 62 | sync: |
28 | 61 | 63 | ||
29 | === modified file 'config.yaml' | |||
30 | --- config.yaml 2015-02-11 21:05:42 +0000 | |||
31 | +++ config.yaml 2015-03-12 10:18:52 +0000 | |||
32 | @@ -2,7 +2,7 @@ | |||
33 | 2 | admin_addresses: | 2 | admin_addresses: |
34 | 3 | default: "" | 3 | default: "" |
35 | 4 | type: string | 4 | type: string |
37 | 5 | description: | | 5 | description: > |
38 | 6 | A comma-separated list of IP Addresses (or single IP) admin tools like | 6 | A comma-separated list of IP Addresses (or single IP) admin tools like |
39 | 7 | pgAdmin3 will connect from, this is most useful for developers running | 7 | pgAdmin3 will connect from, this is most useful for developers running |
40 | 8 | juju in local mode who need to connect tools like pgAdmin to a postgres. | 8 | juju in local mode who need to connect tools like pgAdmin to a postgres. |
41 | @@ -12,14 +12,14 @@ | |||
42 | 12 | locale: | 12 | locale: |
43 | 13 | default: "C" | 13 | default: "C" |
44 | 14 | type: string | 14 | type: string |
46 | 15 | description: | | 15 | description: > |
47 | 16 | Locale of service, defining language, default collation order, | 16 | Locale of service, defining language, default collation order, |
48 | 17 | and default formatting of numbers, currency, dates & times. Can only be | 17 | and default formatting of numbers, currency, dates & times. Can only be |
49 | 18 | set when deploying the first unit of a service. | 18 | set when deploying the first unit of a service. |
50 | 19 | encoding: | 19 | encoding: |
51 | 20 | default: "UTF-8" | 20 | default: "UTF-8" |
52 | 21 | type: string | 21 | type: string |
54 | 22 | description: | | 22 | description: > |
55 | 23 | Default encoding used to store text in this service. Can only be | 23 | Default encoding used to store text in this service. Can only be |
56 | 24 | set when deploying the first unit of a service. | 24 | set when deploying the first unit of a service. |
57 | 25 | extra-packages: | 25 | extra-packages: |
58 | @@ -29,23 +29,12 @@ | |||
59 | 29 | dumpfile_location: | 29 | dumpfile_location: |
60 | 30 | default: "None" | 30 | default: "None" |
61 | 31 | type: string | 31 | type: string |
63 | 32 | description: | | 32 | description: > |
64 | 33 | Path to a dumpfile to load into DB when service is initiated. | 33 | Path to a dumpfile to load into DB when service is initiated. |
65 | 34 | config_change_command: | ||
66 | 35 | default: "reload" | ||
67 | 36 | type: string | ||
68 | 37 | description: | | ||
69 | 38 | The command to run whenever config has changed. Accepted values | ||
70 | 39 | are "reload" or "restart" - any other value will mean neither is | ||
71 | 40 | executed after a config change (which may be desired, if you're | ||
72 | 41 | running a production server and would rather handle these out of | ||
73 | 42 | band). Note that postgresql will still need to be reloaded | ||
74 | 43 | whenever authentication and access details are updated, so | ||
75 | 44 | disabling either doesn't mean PostgreSQL will never be reloaded. | ||
76 | 45 | version: | 34 | version: |
77 | 46 | default: null | 35 | default: null |
78 | 47 | type: string | 36 | type: string |
80 | 48 | description: | | 37 | description: > |
81 | 49 | Version of PostgreSQL that we want to install. Supported versions | 38 | Version of PostgreSQL that we want to install. Supported versions |
82 | 50 | are "9.1", "9.2", "9.3". The default version for the deployed Ubuntu | 39 | are "9.1", "9.2", "9.3". The default version for the deployed Ubuntu |
83 | 51 | release is used when the version is not specified. | 40 | release is used when the version is not specified. |
84 | @@ -65,6 +54,13 @@ | |||
85 | 65 | default: 100 | 54 | default: 100 |
86 | 66 | type: int | 55 | type: int |
87 | 67 | description: Maximum number of connections to allow to the PG database | 56 | description: Maximum number of connections to allow to the PG database |
88 | 57 | max_prepared_transactions: | ||
89 | 58 | default: 0 | ||
90 | 59 | type: int | ||
91 | 60 | description: > | ||
92 | 61 | Maximum number of prepared two phase commit transactions, waiting | ||
93 | 62 | to be committed. Defaults to 0. as using two phase commit without | ||
94 | 63 | a process to monitor and resolve lost transactions is dangerous. | ||
95 | 68 | ssl: | 64 | ssl: |
96 | 69 | default: "True" | 65 | default: "True" |
97 | 70 | type: string | 66 | type: string |
98 | @@ -72,7 +68,7 @@ | |||
99 | 72 | log_min_duration_statement: | 68 | log_min_duration_statement: |
100 | 73 | default: -1 | 69 | default: -1 |
101 | 74 | type: int | 70 | type: int |
103 | 75 | description: | | 71 | description: > |
104 | 76 | -1 is disabled, 0 logs all statements | 72 | -1 is disabled, 0 logs all statements |
105 | 77 | and their durations, > 0 logs only | 73 | and their durations, > 0 logs only |
106 | 78 | statements running at least this number | 74 | statements running at least this number |
107 | @@ -92,7 +88,7 @@ | |||
108 | 92 | log_temp_files: | 88 | log_temp_files: |
109 | 93 | default: "-1" | 89 | default: "-1" |
110 | 94 | type: string | 90 | type: string |
112 | 95 | description: | | 91 | description: > |
113 | 96 | Log creation of temporary files larger than the threshold. | 92 | Log creation of temporary files larger than the threshold. |
114 | 97 | -1 disables the feature, 0 logs all temporary files, or specify | 93 | -1 disables the feature, 0 logs all temporary files, or specify |
115 | 98 | the threshold size with an optional unit (eg. "512KB", default | 94 | the threshold size with an optional unit (eg. "512KB", default |
116 | @@ -131,13 +127,13 @@ | |||
117 | 131 | autovacuum: | 127 | autovacuum: |
118 | 132 | default: True | 128 | default: True |
119 | 133 | type: boolean | 129 | type: boolean |
121 | 134 | description: | | 130 | description: > |
122 | 135 | Autovacuum should almost always be running. If you want to turn this | 131 | Autovacuum should almost always be running. If you want to turn this |
123 | 136 | off, you are probably following out of date documentation. | 132 | off, you are probably following out of date documentation. |
124 | 137 | log_autovacuum_min_duration: | 133 | log_autovacuum_min_duration: |
125 | 138 | default: -1 | 134 | default: -1 |
126 | 139 | type: int | 135 | type: int |
128 | 140 | description: | | 136 | description: > |
129 | 141 | -1 disables, 0 logs all actions and their durations, > 0 logs only | 137 | -1 disables, 0 logs all actions and their durations, > 0 logs only |
130 | 142 | actions running at least this number of milliseconds. | 138 | actions running at least this number of milliseconds. |
131 | 143 | autovacuum_analyze_threshold: | 139 | autovacuum_analyze_threshold: |
132 | @@ -155,13 +151,13 @@ | |||
133 | 155 | autovacuum_vacuum_cost_delay: | 151 | autovacuum_vacuum_cost_delay: |
134 | 156 | default: "20ms" | 152 | default: "20ms" |
135 | 157 | type: string | 153 | type: string |
137 | 158 | description: | | 154 | description: > |
138 | 159 | Default vacuum cost delay for autovacuum, in milliseconds; | 155 | Default vacuum cost delay for autovacuum, in milliseconds; |
139 | 160 | -1 means use vacuum_cost_delay | 156 | -1 means use vacuum_cost_delay |
140 | 161 | search_path: | 157 | search_path: |
141 | 162 | default: "\"$user\",public" | 158 | default: "\"$user\",public" |
142 | 163 | type: string | 159 | type: string |
144 | 164 | description: | | 160 | description: > |
145 | 165 | Comma separated list of schema names for | 161 | Comma separated list of schema names for |
146 | 166 | the default SQL search path. | 162 | the default SQL search path. |
147 | 167 | standard_conforming_strings: | 163 | standard_conforming_strings: |
148 | @@ -171,22 +167,21 @@ | |||
149 | 171 | hot_standby: | 167 | hot_standby: |
150 | 172 | default: False | 168 | default: False |
151 | 173 | type: boolean | 169 | type: boolean |
154 | 174 | description: | | 170 | description: > |
153 | 175 | DEPRECATED. | ||
155 | 176 | Hot standby or warm standby. When True, queries can be run against | 171 | Hot standby or warm standby. When True, queries can be run against |
156 | 177 | the database when in recovery or standby mode (ie. replicated). | 172 | the database when in recovery or standby mode (ie. replicated). |
157 | 178 | Overridden when service contains multiple units. | 173 | Overridden when service contains multiple units. |
158 | 179 | hot_standby_feedback: | 174 | hot_standby_feedback: |
159 | 180 | default: False | 175 | default: False |
160 | 181 | type: boolean | 176 | type: boolean |
162 | 182 | description: | | 177 | description: > |
163 | 183 | Hot standby feedback, informing a master about in progress | 178 | Hot standby feedback, informing a master about in progress |
164 | 184 | transactions on a streaming hot standby and allowing the master to | 179 | transactions on a streaming hot standby and allowing the master to |
165 | 185 | defer cleanup and avoid query cancelations on the hot standby. | 180 | defer cleanup and avoid query cancelations on the hot standby. |
166 | 186 | wal_level: | 181 | wal_level: |
167 | 187 | default: minimal | 182 | default: minimal |
168 | 188 | type: string | 183 | type: string |
170 | 189 | description: | | 184 | description: > |
171 | 190 | 'minimal', 'archive' or 'hot_standby'. Defines how much information | 185 | 'minimal', 'archive' or 'hot_standby'. Defines how much information |
172 | 191 | is written to the WAL. Set to 'minimal' for stand alone databases | 186 | is written to the WAL. Set to 'minimal' for stand alone databases |
173 | 192 | and 'hot_standby' for replicated setups. Overridden by juju when | 187 | and 'hot_standby' for replicated setups. Overridden by juju when |
174 | @@ -194,7 +189,7 @@ | |||
175 | 194 | max_wal_senders: | 189 | max_wal_senders: |
176 | 195 | default: 0 | 190 | default: 0 |
177 | 196 | type: int | 191 | type: int |
179 | 197 | description: | | 192 | description: > |
180 | 198 | Maximum number of hot standbys that can connect using | 193 | Maximum number of hot standbys that can connect using |
181 | 199 | streaming replication. Set this to the expected maximum number of | 194 | streaming replication. Set this to the expected maximum number of |
182 | 200 | hot standby units to avoid unnecessary blocking and database restarts. | 195 | hot standby units to avoid unnecessary blocking and database restarts. |
183 | @@ -202,7 +197,7 @@ | |||
184 | 202 | wal_keep_segments: | 197 | wal_keep_segments: |
185 | 203 | default: 0 | 198 | default: 0 |
186 | 204 | type: int | 199 | type: int |
188 | 205 | description: | | 200 | description: > |
189 | 206 | Number of old WAL files to keep, providing a larger buffer for | 201 | Number of old WAL files to keep, providing a larger buffer for |
190 | 207 | streaming hot standbys to catch up from when lagged. Each WAL file | 202 | streaming hot standbys to catch up from when lagged. Each WAL file |
191 | 208 | is 16MB in size. The WAL files are the buffer of how far a | 203 | is 16MB in size. The WAL files are the buffer of how far a |
192 | @@ -212,7 +207,7 @@ | |||
193 | 212 | replicated_wal_keep_segments: | 207 | replicated_wal_keep_segments: |
194 | 213 | default: 5000 | 208 | default: 5000 |
195 | 214 | type: int | 209 | type: int |
197 | 215 | description: | | 210 | description: > |
198 | 216 | Value of wal_keep_segments used when this service is replicated. | 211 | Value of wal_keep_segments used when this service is replicated. |
199 | 217 | This setting only exists to provide a sane default when replication | 212 | This setting only exists to provide a sane default when replication |
200 | 218 | is requested (so it doesn't fail) and nobody bothered to change the | 213 | is requested (so it doesn't fail) and nobody bothered to change the |
201 | @@ -220,7 +215,7 @@ | |||
202 | 220 | archive_mode: | 215 | archive_mode: |
203 | 221 | default: False | 216 | default: False |
204 | 222 | type: boolean | 217 | type: boolean |
206 | 223 | description: | | 218 | description: > |
207 | 224 | Enable archiving of WAL files using the command specified by | 219 | Enable archiving of WAL files using the command specified by |
208 | 225 | archive_command. If archive_mode is enabled and archive_command not | 220 | archive_command. If archive_mode is enabled and archive_command not |
209 | 226 | set, then archiving is deferred until archive_command is set and the | 221 | set, then archiving is deferred until archive_command is set and the |
210 | @@ -228,25 +223,25 @@ | |||
211 | 228 | archive_command: | 223 | archive_command: |
212 | 229 | default: "" | 224 | default: "" |
213 | 230 | type: string | 225 | type: string |
215 | 231 | description: | | 226 | description: > |
216 | 232 | Command used to archive WAL files when archive_mode is set and | 227 | Command used to archive WAL files when archive_mode is set and |
217 | 233 | wal_level > minimal. | 228 | wal_level > minimal. |
218 | 234 | work_mem: | 229 | work_mem: |
219 | 235 | default: "1MB" | 230 | default: "1MB" |
220 | 236 | type: string | 231 | type: string |
222 | 237 | description: | | 232 | description: > |
223 | 238 | Working Memory. | 233 | Working Memory. |
224 | 239 | Ignored unless 'performance_tuning' is set to 'manual'. | 234 | Ignored unless 'performance_tuning' is set to 'manual'. |
225 | 240 | maintenance_work_mem: | 235 | maintenance_work_mem: |
226 | 241 | default: "1MB" | 236 | default: "1MB" |
227 | 242 | type: string | 237 | type: string |
229 | 243 | description: | | 238 | description: > |
230 | 244 | Maintenance working memory. | 239 | Maintenance working memory. |
231 | 245 | Ignored unless 'performance_tuning' is set to 'manual'. | 240 | Ignored unless 'performance_tuning' is set to 'manual'. |
232 | 246 | performance_tuning: | 241 | performance_tuning: |
233 | 247 | default: "Mixed" | 242 | default: "Mixed" |
234 | 248 | type: string | 243 | type: string |
236 | 249 | description: | | 244 | description: > |
237 | 250 | Possible values here are "manual", "DW" (data warehouse), | 245 | Possible values here are "manual", "DW" (data warehouse), |
238 | 251 | "OLTP" (online transaction processing), "Web" (web application), | 246 | "OLTP" (online transaction processing), "Web" (web application), |
239 | 252 | "Desktop" or "Mixed". When this is set to a value other than | 247 | "Desktop" or "Mixed". When this is set to a value other than |
240 | @@ -267,14 +262,14 @@ | |||
241 | 267 | shared_buffers: | 262 | shared_buffers: |
242 | 268 | default: "" | 263 | default: "" |
243 | 269 | type: string | 264 | type: string |
245 | 270 | description: | | 265 | description: > |
246 | 271 | The amount of memory the database server uses for shared memory | 266 | The amount of memory the database server uses for shared memory |
247 | 272 | buffers. This string should be of the format '###MB'. | 267 | buffers. This string should be of the format '###MB'. |
248 | 273 | Ignored unless 'performance_tuning' is set to 'manual'. | 268 | Ignored unless 'performance_tuning' is set to 'manual'. |
249 | 274 | effective_cache_size: | 269 | effective_cache_size: |
250 | 275 | default: "" | 270 | default: "" |
251 | 276 | type: string | 271 | type: string |
253 | 277 | description: | | 272 | description: > |
254 | 278 | Effective cache size is an estimate of how much memory is available for | 273 | Effective cache size is an estimate of how much memory is available for |
255 | 279 | disk caching within the database. (50% to 75% of system memory). This | 274 | disk caching within the database. (50% to 75% of system memory). This |
256 | 280 | string should be of the format '###MB'. Ignored unless | 275 | string should be of the format '###MB'. Ignored unless |
257 | @@ -282,52 +277,65 @@ | |||
258 | 282 | default_statistics_target: | 277 | default_statistics_target: |
259 | 283 | default: -1 | 278 | default: -1 |
260 | 284 | type: int | 279 | type: int |
262 | 285 | description: | | 280 | description: > |
263 | 286 | Sets the default statistics target for table columns without a | 281 | Sets the default statistics target for table columns without a |
264 | 287 | column-specific target set via ALTER TABLE SET STATISTICS. | 282 | column-specific target set via ALTER TABLE SET STATISTICS. |
265 | 288 | Leave unchanged to use the server default, which in recent | 283 | Leave unchanged to use the server default, which in recent |
266 | 289 | releases is 100. Ignored unless 'performance_tuning' is 'manual'. | 284 | releases is 100. Ignored unless 'performance_tuning' is 'manual'. |
267 | 290 | Larger values increase the time needed to do ANALYZE, but | 285 | Larger values increase the time needed to do ANALYZE, but |
268 | 291 | might improve the quality of the planner's estimates. | 286 | might improve the quality of the planner's estimates. |
269 | 287 | collapse_limit: | ||
270 | 288 | default: -1 | ||
271 | 289 | type: int | ||
272 | 290 | description: > | ||
273 | 291 | Sets the from_collapse_limit and join_collapse_limit query planner | ||
274 | 292 | options, controlling the maximum number of tables that can be joined | ||
275 | 293 | before the turns off the table collapse query optimization. | ||
276 | 292 | temp_buffers: | 294 | temp_buffers: |
277 | 293 | default: "1MB" | 295 | default: "1MB" |
278 | 294 | type: string | 296 | type: string |
280 | 295 | description: | | 297 | description: > |
281 | 296 | The maximum number of temporary buffers used by each database session. | 298 | The maximum number of temporary buffers used by each database session. |
282 | 297 | wal_buffers: | 299 | wal_buffers: |
283 | 298 | default: "-1" | 300 | default: "-1" |
284 | 299 | type: string | 301 | type: string |
286 | 300 | description: | | 302 | description: > |
287 | 301 | min 32kB, -1 sets based on shared_buffers (change requires restart). | 303 | min 32kB, -1 sets based on shared_buffers (change requires restart). |
288 | 302 | Ignored unless 'performance_tuning' is set to 'manual'. | 304 | Ignored unless 'performance_tuning' is set to 'manual'. |
289 | 303 | checkpoint_segments: | 305 | checkpoint_segments: |
291 | 304 | default: 3 | 306 | default: 10 |
292 | 305 | type: int | 307 | type: int |
294 | 306 | description: | | 308 | description: > |
295 | 307 | in logfile segments, min 1, 16MB each. | 309 | in logfile segments, min 1, 16MB each. |
296 | 308 | Ignored unless 'performance_tuning' is set to 'manual'. | 310 | Ignored unless 'performance_tuning' is set to 'manual'. |
297 | 311 | checkpoint_completion_target: | ||
298 | 312 | default: 0.9 | ||
299 | 313 | type: float | ||
300 | 314 | description: > | ||
301 | 315 | checkpoint target duration time, as a fraction of checkpoint_timeout. | ||
302 | 316 | Range [0.0, 1.0]. | ||
303 | 309 | checkpoint_timeout: | 317 | checkpoint_timeout: |
304 | 310 | default: "" | 318 | default: "" |
305 | 311 | type: string | 319 | type: string |
307 | 312 | description: | | 320 | description: > |
308 | 313 | Maximum time between automatic WAL checkpoints. range '30s-1h'. | 321 | Maximum time between automatic WAL checkpoints. range '30s-1h'. |
309 | 314 | If left empty, the default postgresql value will be used. | 322 | If left empty, the default postgresql value will be used. |
310 | 315 | fsync: | 323 | fsync: |
311 | 316 | type: boolean | 324 | type: boolean |
312 | 317 | default: True | 325 | default: True |
314 | 318 | description: | | 326 | description: > |
315 | 319 | Turns forced synchronization on/off. If fsync is turned off, database | 327 | Turns forced synchronization on/off. If fsync is turned off, database |
316 | 320 | failures are likely to involve database corruption and require | 328 | failures are likely to involve database corruption and require |
317 | 321 | recreating the unit | 329 | recreating the unit |
318 | 322 | synchronous_commit: | 330 | synchronous_commit: |
319 | 323 | type: boolean | 331 | type: boolean |
320 | 324 | default: True | 332 | default: True |
322 | 325 | description: | | 333 | description: > |
323 | 326 | Immediate fsync after commit. | 334 | Immediate fsync after commit. |
324 | 327 | full_page_writes: | 335 | full_page_writes: |
325 | 328 | type: boolean | 336 | type: boolean |
326 | 329 | default: True | 337 | default: True |
328 | 330 | description: | | 338 | description: > |
329 | 331 | Recover from partial page writes. | 339 | Recover from partial page writes. |
330 | 332 | random_page_cost: | 340 | random_page_cost: |
331 | 333 | default: 4.0 | 341 | default: 4.0 |
332 | @@ -336,7 +344,7 @@ | |||
333 | 336 | extra_pg_auth: | 344 | extra_pg_auth: |
334 | 337 | type: string | 345 | type: string |
335 | 338 | default: "" | 346 | default: "" |
337 | 339 | description: | | 347 | description: > |
338 | 340 | A comma separated extra pg_hba.conf auth rules. | 348 | A comma separated extra pg_hba.conf auth rules. |
339 | 341 | This will be written to the pg_hba.conf file, one line per rule. | 349 | This will be written to the pg_hba.conf file, one line per rule. |
340 | 342 | Note that this should not be needed as db relations already create | 350 | Note that this should not be needed as db relations already create |
341 | @@ -348,7 +356,7 @@ | |||
342 | 348 | manual_replication: | 356 | manual_replication: |
343 | 349 | type: boolean | 357 | type: boolean |
344 | 350 | default: False | 358 | default: False |
346 | 351 | description: | | 359 | description: > |
347 | 352 | Enable or disable charm managed replication. When manual_replication | 360 | Enable or disable charm managed replication. When manual_replication |
348 | 353 | is True, the operator is responsible for maintaining recovery.conf | 361 | is True, the operator is responsible for maintaining recovery.conf |
349 | 354 | and performing any necessary database mirroring. The charm will | 362 | and performing any necessary database mirroring. The charm will |
350 | @@ -372,7 +380,7 @@ | |||
351 | 372 | nagios_context: | 380 | nagios_context: |
352 | 373 | default: "juju" | 381 | default: "juju" |
353 | 374 | type: string | 382 | type: string |
355 | 375 | description: | | 383 | description: > |
356 | 376 | Used by the nrpe-external-master subordinate charm. | 384 | Used by the nrpe-external-master subordinate charm. |
357 | 377 | A string that will be prepended to instance name to set the host name | 385 | A string that will be prepended to instance name to set the host name |
358 | 378 | in nagios. So for instance the hostname would be something like: | 386 | in nagios. So for instance the hostname would be something like: |
359 | @@ -382,14 +390,14 @@ | |||
360 | 382 | nagios_additional_servicegroups: | 390 | nagios_additional_servicegroups: |
361 | 383 | default: "" | 391 | default: "" |
362 | 384 | type: string | 392 | type: string |
364 | 385 | description: | | 393 | description: > |
365 | 386 | Used by the nrpe-external-master subordinate charm. | 394 | Used by the nrpe-external-master subordinate charm. |
366 | 387 | A comma-separated list of servicegroups to include along with | 395 | A comma-separated list of servicegroups to include along with |
367 | 388 | nagios_context when generating nagios service check configs. | 396 | nagios_context when generating nagios service check configs. |
368 | 389 | This is useful for nagios installations where servicegroups | 397 | This is useful for nagios installations where servicegroups |
369 | 390 | are used to apply special treatment to particular checks. | 398 | are used to apply special treatment to particular checks. |
370 | 391 | pgdg: | 399 | pgdg: |
372 | 392 | description: | | 400 | description: > |
373 | 393 | Enable the PostgreSQL Global Development Group APT repository | 401 | Enable the PostgreSQL Global Development Group APT repository |
374 | 394 | (https://wiki.postgresql.org/wiki/Apt). This package source provides | 402 | (https://wiki.postgresql.org/wiki/Apt). This package source provides |
375 | 395 | official PostgreSQL packages for Ubuntu LTS releases beyond those | 403 | official PostgreSQL packages for Ubuntu LTS releases beyond those |
376 | @@ -397,13 +405,13 @@ | |||
377 | 397 | type: boolean | 405 | type: boolean |
378 | 398 | default: false | 406 | default: false |
379 | 399 | install_sources: | 407 | install_sources: |
381 | 400 | description: | | 408 | description: > |
382 | 401 | List of extra package sources, per charm-helpers standard. | 409 | List of extra package sources, per charm-helpers standard. |
383 | 402 | YAML format. | 410 | YAML format. |
384 | 403 | type: string | 411 | type: string |
385 | 404 | default: null | 412 | default: null |
386 | 405 | install_keys: | 413 | install_keys: |
388 | 406 | description: | | 414 | description: > |
389 | 407 | List of signing keys for install_sources package sources, per | 415 | List of signing keys for install_sources package sources, per |
390 | 408 | charmhelpers standard. YAML format. | 416 | charmhelpers standard. YAML format. |
391 | 409 | type: string | 417 | type: string |
392 | @@ -411,12 +419,12 @@ | |||
393 | 411 | extra_archives: | 419 | extra_archives: |
394 | 412 | default: "" | 420 | default: "" |
395 | 413 | type: string | 421 | type: string |
397 | 414 | description: | | 422 | description: > |
398 | 415 | DEPRECATED & IGNORED. Use install_sources and install_keys. | 423 | DEPRECATED & IGNORED. Use install_sources and install_keys. |
399 | 416 | advisory_lock_restart_key: | 424 | advisory_lock_restart_key: |
400 | 417 | default: 765 | 425 | default: 765 |
401 | 418 | type: int | 426 | type: int |
403 | 419 | description: | | 427 | description: > |
404 | 420 | An advisory lock key used internally by the charm. You do not need | 428 | An advisory lock key used internally by the charm. You do not need |
405 | 421 | to change it unless it happens to conflict with an advisory lock key | 429 | to change it unless it happens to conflict with an advisory lock key |
406 | 422 | being used by your applications. | 430 | being used by your applications. |
407 | @@ -424,7 +432,7 @@ | |||
408 | 424 | swiftwal_container_prefix: | 432 | swiftwal_container_prefix: |
409 | 425 | type: string | 433 | type: string |
410 | 426 | default: null | 434 | default: null |
412 | 427 | description: | | 435 | description: > |
413 | 428 | EXPERIMENTAL. | 436 | EXPERIMENTAL. |
414 | 429 | Swift container prefix for SwiftWAL to use. Must be set if any | 437 | Swift container prefix for SwiftWAL to use. Must be set if any |
415 | 430 | SwiftWAL features are enabled. This will become a simple | 438 | SwiftWAL features are enabled. This will become a simple |
416 | @@ -433,13 +441,13 @@ | |||
417 | 433 | swiftwal_backup_schedule: | 441 | swiftwal_backup_schedule: |
418 | 434 | type: string | 442 | type: string |
419 | 435 | default: null | 443 | default: null |
421 | 436 | description: | | 444 | description: > |
422 | 437 | EXPERIMENTAL. | 445 | EXPERIMENTAL. |
423 | 438 | Cron-formatted schedule for SwiftWAL database backups. | 446 | Cron-formatted schedule for SwiftWAL database backups. |
424 | 439 | swiftwal_backup_retention: | 447 | swiftwal_backup_retention: |
425 | 440 | type: int | 448 | type: int |
426 | 441 | default: 2 | 449 | default: 2 |
428 | 442 | description: | | 450 | description: > |
429 | 443 | EXPERIMENTAL. | 451 | EXPERIMENTAL. |
430 | 444 | Number of recent base backups to retain. You need enough space in | 452 | Number of recent base backups to retain. You need enough space in |
431 | 445 | Swift for this many backups plus one more, as an old backup will only | 453 | Swift for this many backups plus one more, as an old backup will only |
432 | @@ -447,7 +455,7 @@ | |||
433 | 447 | swiftwal_log_shipping: | 455 | swiftwal_log_shipping: |
434 | 448 | type: boolean | 456 | type: boolean |
435 | 449 | default: false | 457 | default: false |
437 | 450 | description: | | 458 | description: > |
438 | 451 | EXPERIMENTAL. | 459 | EXPERIMENTAL. |
439 | 452 | Archive WAL files into Swift. If swiftwal_backup_schedule is set, | 460 | Archive WAL files into Swift. If swiftwal_backup_schedule is set, |
440 | 453 | allows point-in-time recovery and WAL files are removed | 461 | allows point-in-time recovery and WAL files are removed |
441 | @@ -474,7 +482,7 @@ | |||
442 | 474 | wal_e_backup_schedule: | 482 | wal_e_backup_schedule: |
443 | 475 | type: string | 483 | type: string |
444 | 476 | default: "13 0 * * *" | 484 | default: "13 0 * * *" |
446 | 477 | description: | | 485 | description: > |
447 | 478 | EXPERIMENTAL. | 486 | EXPERIMENTAL. |
448 | 479 | Cron-formatted schedule for WAL-E database backups. If | 487 | Cron-formatted schedule for WAL-E database backups. If |
449 | 480 | wal_e_backup_schedule is unset, WAL files will never be removed from | 488 | wal_e_backup_schedule is unset, WAL files will never be removed from |
450 | @@ -482,7 +490,7 @@ | |||
451 | 482 | wal_e_backup_retention: | 490 | wal_e_backup_retention: |
452 | 483 | type: int | 491 | type: int |
453 | 484 | default: 2 | 492 | default: 2 |
455 | 485 | description: | | 493 | description: > |
456 | 486 | EXPERIMENTAL. | 494 | EXPERIMENTAL. |
457 | 487 | Number of recent base backups and WAL files to retain. | 495 | Number of recent base backups and WAL files to retain. |
458 | 488 | You need enough space for this many backups plus one more, as | 496 | You need enough space for this many backups plus one more, as |
459 | @@ -491,7 +499,7 @@ | |||
460 | 491 | streaming_replication: | 499 | streaming_replication: |
461 | 492 | type: boolean | 500 | type: boolean |
462 | 493 | default: true | 501 | default: true |
464 | 494 | description: | | 502 | description: > |
465 | 495 | Enable streaming replication. Normally, streaming replication is | 503 | Enable streaming replication. Normally, streaming replication is |
466 | 496 | always used, and any log shipping configured is used as a fallback. | 504 | always used, and any log shipping configured is used as a fallback. |
467 | 497 | Turning this off without configuring log shipping is an error. | 505 | Turning this off without configuring log shipping is an error. |
468 | @@ -530,7 +538,7 @@ | |||
469 | 530 | package_status: | 538 | package_status: |
470 | 531 | default: "install" | 539 | default: "install" |
471 | 532 | type: string | 540 | type: string |
473 | 533 | description: | | 541 | description: > |
474 | 534 | The status of service-affecting packages will be set to this | 542 | The status of service-affecting packages will be set to this |
475 | 535 | value in the dpkg database. Useful valid values are "install" | 543 | value in the dpkg database. Useful valid values are "install" |
476 | 536 | and "hold". | 544 | and "hold". |
477 | @@ -538,13 +546,13 @@ | |||
478 | 538 | metrics_target: | 546 | metrics_target: |
479 | 539 | default: "" | 547 | default: "" |
480 | 540 | type: string | 548 | type: string |
482 | 541 | description: | | 549 | description: > |
483 | 542 | Destination for statsd-format metrics, format "host:port". If | 550 | Destination for statsd-format metrics, format "host:port". If |
484 | 543 | not present and valid, metrics disabled. | 551 | not present and valid, metrics disabled. |
485 | 544 | metrics_prefix: | 552 | metrics_prefix: |
486 | 545 | default: "dev.$UNIT.postgresql" | 553 | default: "dev.$UNIT.postgresql" |
487 | 546 | type: string | 554 | type: string |
489 | 547 | description: | | 555 | description: > |
490 | 548 | Prefix for metrics. Special value $UNIT can be used to include the | 556 | Prefix for metrics. Special value $UNIT can be used to include the |
491 | 549 | name of the unit in the prefix. | 557 | name of the unit in the prefix. |
492 | 550 | metrics_sample_interval: | 558 | metrics_sample_interval: |
493 | 551 | 559 | ||
494 | === modified file 'hooks/helpers.py' | |||
495 | --- hooks/helpers.py 2012-10-01 14:10:14 +0000 | |||
496 | +++ hooks/helpers.py 2015-03-12 10:18:52 +0000 | |||
497 | @@ -17,8 +17,7 @@ | |||
498 | 17 | 'wait_for_machine', | 17 | 'wait_for_machine', |
499 | 18 | 'wait_for_page_contents', | 18 | 'wait_for_page_contents', |
500 | 19 | 'wait_for_relation', | 19 | 'wait_for_relation', |
503 | 20 | 'wait_for_unit', | 20 | 'wait_for_unit'] |
502 | 21 | ] | ||
504 | 22 | 21 | ||
505 | 23 | from contextlib import contextmanager | 22 | from contextlib import contextmanager |
506 | 24 | import json | 23 | import json |
507 | @@ -26,8 +25,7 @@ | |||
508 | 26 | from shelltoolbox import ( | 25 | from shelltoolbox import ( |
509 | 27 | command, | 26 | command, |
510 | 28 | run, | 27 | run, |
513 | 29 | script_name, | 28 | script_name) |
512 | 30 | ) | ||
514 | 31 | import os | 29 | import os |
515 | 32 | import tempfile | 30 | import tempfile |
516 | 33 | import time | 31 | import time |
517 | 34 | 32 | ||
518 | === modified file 'hooks/hooks.py' | |||
519 | --- hooks/hooks.py 2015-03-08 23:51:59 +0000 | |||
520 | +++ hooks/hooks.py 2015-03-12 10:18:52 +0000 | |||
521 | @@ -22,8 +22,7 @@ | |||
522 | 22 | from charmhelpers import fetch | 22 | from charmhelpers import fetch |
523 | 23 | from charmhelpers.core import hookenv, host | 23 | from charmhelpers.core import hookenv, host |
524 | 24 | from charmhelpers.core.hookenv import ( | 24 | from charmhelpers.core.hookenv import ( |
527 | 25 | CRITICAL, ERROR, WARNING, INFO, DEBUG, | 25 | CRITICAL, ERROR, WARNING, INFO, DEBUG) |
526 | 26 | ) | ||
528 | 27 | 26 | ||
529 | 28 | try: | 27 | try: |
530 | 29 | import psycopg2 | 28 | import psycopg2 |
531 | @@ -212,8 +211,8 @@ | |||
532 | 212 | log("ERROR: {}".format(p.returncode), ERROR) | 211 | log("ERROR: {}".format(p.returncode), ERROR) |
533 | 213 | sys.exit(p.returncode) | 212 | sys.exit(p.returncode) |
534 | 214 | 213 | ||
537 | 215 | raise subprocess.CalledProcessError( | 214 | raise subprocess.CalledProcessError(p.returncode, command, |
538 | 216 | p.returncode, command, '\n'.join(lines)) | 215 | '\n'.join(lines)) |
539 | 217 | 216 | ||
540 | 218 | 217 | ||
541 | 219 | def postgresql_is_running(): | 218 | def postgresql_is_running(): |
542 | @@ -447,7 +446,7 @@ | |||
543 | 447 | open(template_file).read()).render(config_data) | 446 | open(template_file).read()).render(config_data) |
544 | 448 | host.write_file( | 447 | host.write_file( |
545 | 449 | config_file, pg_config, | 448 | config_file, pg_config, |
547 | 450 | owner="postgres", group="postgres", perms=0600) | 449 | owner="postgres", group="postgres", perms=0600) |
548 | 451 | 450 | ||
549 | 452 | # Create or update files included from postgresql.conf. | 451 | # Create or update files included from postgresql.conf. |
550 | 453 | configure_log_destination(os.path.dirname(config_file)) | 452 | configure_log_destination(os.path.dirname(config_file)) |
551 | @@ -963,7 +962,7 @@ | |||
552 | 963 | CRITICAL) | 962 | CRITICAL) |
553 | 964 | 963 | ||
554 | 965 | valid_workloads = [ | 964 | valid_workloads = [ |
556 | 966 | 'dw', 'oltp', 'web', 'mixed', 'desktop', 'manual', 'auto'] | 965 | 'dw', 'oltp', 'web', 'mixed', 'desktop', 'manual', 'auto'] |
557 | 967 | requested_workload = config_data['performance_tuning'].lower() | 966 | requested_workload = config_data['performance_tuning'].lower() |
558 | 968 | if requested_workload not in valid_workloads: | 967 | if requested_workload not in valid_workloads: |
559 | 969 | valid = False | 968 | valid = False |
560 | @@ -2148,9 +2147,10 @@ | |||
561 | 2148 | 2147 | ||
562 | 2149 | # Build the set of client relations that both the master and this | 2148 | # Build the set of client relations that both the master and this |
563 | 2150 | # unit have joined. | 2149 | # unit have joined. |
567 | 2151 | active_client_relations = set( | 2150 | possible_client_relations = set(hookenv.relation_ids('db') + |
568 | 2152 | hookenv.relation_ids('db') + hookenv.relation_ids('db-admin') | 2151 | hookenv.relation_ids('db-admin')) |
569 | 2153 | ).intersection(set(client_relations.split())) | 2152 | active_client_relations = possible_client_relations.intersection( |
570 | 2153 | set(client_relations.split())) | ||
571 | 2154 | 2154 | ||
572 | 2155 | for client_relation in active_client_relations: | 2155 | for client_relation in active_client_relations: |
573 | 2156 | # We need to pull the credentials from the master unit's | 2156 | # We need to pull the credentials from the master unit's |
574 | @@ -2513,16 +2513,15 @@ | |||
575 | 2513 | if len(relations) == 1 and 'nagios_hostname' in relations[0]: | 2513 | if len(relations) == 1 and 'nagios_hostname' in relations[0]: |
576 | 2514 | nagios_hostname = relations[0]['nagios_hostname'] | 2514 | nagios_hostname = relations[0]['nagios_hostname'] |
577 | 2515 | log("update_nrpe_checks: Obtained nagios_hostname ({}) " | 2515 | log("update_nrpe_checks: Obtained nagios_hostname ({}) " |
580 | 2516 | "from nrpe-external-master relation.".format( | 2516 | "from nrpe-external-master relation.".format(nagios_hostname)) |
579 | 2517 | nagios_hostname)) | ||
581 | 2518 | else: | 2517 | else: |
582 | 2519 | unit = hookenv.local_unit() | 2518 | unit = hookenv.local_unit() |
583 | 2520 | unit_name = unit.replace('/', '-') | 2519 | unit_name = unit.replace('/', '-') |
584 | 2521 | nagios_hostname = "%s-%s" % (config_data['nagios_context'], unit_name) | 2520 | nagios_hostname = "%s-%s" % (config_data['nagios_context'], unit_name) |
589 | 2522 | log("update_nrpe_checks: Deduced nagios_hostname ({}) from charm config " | 2521 | log("update_nrpe_checks: Deduced nagios_hostname ({}) from charm " |
590 | 2523 | "(nagios_hostname not found in nrpe-external-master relation, or " | 2522 | "config (nagios_hostname not found in nrpe-external-master " |
591 | 2524 | "wrong number of relations found)".format( | 2523 | "relation, or wrong number of relations " |
592 | 2525 | nagios_hostname)) | 2524 | "found)".format(nagios_hostname)) |
593 | 2526 | 2525 | ||
594 | 2527 | nrpe_service_file = \ | 2526 | nrpe_service_file = \ |
595 | 2528 | '/var/lib/nagios/export/service__{}_check_pgsql.cfg'.format( | 2527 | '/var/lib/nagios/export/service__{}_check_pgsql.cfg'.format( |
596 | 2529 | 2528 | ||
597 | === modified file 'hooks/test_hooks.py' | |||
598 | --- hooks/test_hooks.py 2015-03-09 10:30:33 +0000 | |||
599 | +++ hooks/test_hooks.py 2015-03-12 10:18:52 +0000 | |||
600 | @@ -68,7 +68,6 @@ | |||
601 | 68 | "encoding": "UTF-8", | 68 | "encoding": "UTF-8", |
602 | 69 | "extra_packages": "", | 69 | "extra_packages": "", |
603 | 70 | "dumpfile_location": "None", | 70 | "dumpfile_location": "None", |
604 | 71 | "config_change_command": "reload", | ||
605 | 72 | "version": "9.1", | 71 | "version": "9.1", |
606 | 73 | "cluster_name": "main", | 72 | "cluster_name": "main", |
607 | 74 | "listen_ip": "*", | 73 | "listen_ip": "*", |
608 | 75 | 74 | ||
609 | === modified file 'templates/postgresql.conf.tmpl' | |||
610 | --- templates/postgresql.conf.tmpl 2015-02-11 21:05:42 +0000 | |||
611 | +++ templates/postgresql.conf.tmpl 2015-03-12 10:18:52 +0000 | |||
612 | @@ -41,6 +41,9 @@ | |||
613 | 41 | max_connections = {{max_connections}} | 41 | max_connections = {{max_connections}} |
614 | 42 | {% endif -%} | 42 | {% endif -%} |
615 | 43 | 43 | ||
616 | 44 | # Broken under all versions of Ubuntu, per Bug #1018307 | ||
617 | 45 | ssl_renegotiation_limit=0 | ||
618 | 46 | |||
619 | 44 | 47 | ||
620 | 45 | #------------------------------------------------------------------------------ | 48 | #------------------------------------------------------------------------------ |
621 | 46 | # RESOURCE USAGE (except WAL) | 49 | # RESOURCE USAGE (except WAL) |
622 | @@ -58,6 +61,9 @@ | |||
623 | 58 | {% if maintenance_work_mem != "" -%} | 61 | {% if maintenance_work_mem != "" -%} |
624 | 59 | maintenance_work_mem = {{maintenance_work_mem}} | 62 | maintenance_work_mem = {{maintenance_work_mem}} |
625 | 60 | {% endif -%} | 63 | {% endif -%} |
626 | 64 | {% if max_prepared_transactions != "" -%} | ||
627 | 65 | max_prepared_transactions = {{max_prepared_transactions}} | ||
628 | 66 | {% endif -%} | ||
629 | 61 | 67 | ||
630 | 62 | 68 | ||
631 | 63 | #------------------------------------------------------------------------------ | 69 | #------------------------------------------------------------------------------ |
632 | @@ -70,6 +76,9 @@ | |||
633 | 70 | {% if checkpoint_segments != "" -%} | 76 | {% if checkpoint_segments != "" -%} |
634 | 71 | checkpoint_segments = {{checkpoint_segments}} | 77 | checkpoint_segments = {{checkpoint_segments}} |
635 | 72 | {% endif -%} | 78 | {% endif -%} |
636 | 79 | {% if checkpoint_completion_target != "" -%} | ||
637 | 80 | checkpoint_completion_target = {{checkpoint_completion_target}} | ||
638 | 81 | {% endif -%} | ||
639 | 73 | {% if checkpoint_timeout != "" -%} | 82 | {% if checkpoint_timeout != "" -%} |
640 | 74 | checkpoint_timeout = {{checkpoint_timeout}} | 83 | checkpoint_timeout = {{checkpoint_timeout}} |
641 | 75 | {% endif -%} | 84 | {% endif -%} |
642 | @@ -97,6 +106,10 @@ | |||
643 | 97 | {% if default_statistics_target != -1 -%} | 106 | {% if default_statistics_target != -1 -%} |
644 | 98 | default_statistics_target = {{default_statistics_target}} | 107 | default_statistics_target = {{default_statistics_target}} |
645 | 99 | {% endif -%} | 108 | {% endif -%} |
646 | 109 | {% if collapse_limit != -1 -%} | ||
647 | 110 | from_collapse_limit = {{collapse_limit}} | ||
648 | 111 | join_collapse_limit = {{collapse_limit}} | ||
649 | 112 | {% endif -%} | ||
650 | 100 | 113 | ||
651 | 101 | 114 | ||
652 | 102 | #------------------------------------------------------------------------------ | 115 | #------------------------------------------------------------------------------ |
653 | 103 | 116 | ||
654 | === modified file 'test.py' | |||
655 | --- test.py 2014-12-04 17:49:22 +0000 | |||
656 | +++ test.py 2015-03-12 10:18:52 +0000 | |||
657 | @@ -948,8 +948,7 @@ | |||
658 | 948 | class PG94Tests( | 948 | class PG94Tests( |
659 | 949 | PostgreSQLCharmBaseTestCase, | 949 | PostgreSQLCharmBaseTestCase, |
660 | 950 | testtools.TestCase, fixtures.TestWithFixtures): | 950 | testtools.TestCase, fixtures.TestWithFixtures): |
663 | 951 | # 9.4 is still in beta, with packages only available in the PGDG | 951 | # 9.4 is released, but packages are only available in the PGDG archive. |
662 | 952 | # archive. | ||
664 | 953 | VERSION = '9.4' | 952 | VERSION = '9.4' |
665 | 954 | PGDG = True | 953 | PGDG = True |
666 | 955 | 954 |
This items has failed automated testing! Results available here http:// reports. vapour. ws/charm- tests/charm- bundle- test-11056- results