-
Bug
-
Resolution: Fixed
-
Minor
-
3.2
-
MOODLE_32_STABLE
-
MOODLE_32_STABLE
-
Jordan's comments about testing MDL-54947 with pgbouncer:
I just tested this on a staging server for MoodleCloud, where we use pgbouncer to pool connections.
on prod, pgbouncer connects to an AWS RDS server
on staging, pgbouncer connects to a locally running pgsql server configured to listen on 127.0.0.1:5432 and pgbouncer listens on 127.0.0.1:5431
its worth mentioning this is postgresql 9.4.8 out of the box with no special configuration as its merely a testing env that has almost no load these values will likely differ if used on production.
pre-patch with pgbouncer:
1.0141880512238 2k setup_DB
1.6915528774261 2k work_with_binary_data
pre-patch without pgbouncer:
11.553825855255 2k setup_DB
1.4306471347809 2k work_with_binary_data
after the patch, pgbouncer started refusing connections with the following in the log:
unsupported startup parameter: options=--client_encoding=utf8 --standard_conforming_strings=on
Pooler Error: Unsupported startup parameter: options
So we set 'ignore_startup_parameters = options' in the pgbouncer ini, which I assume undoes what this patch is trying to accomplish?
post-patch with pgbouncer (ignored_startup_parameters=options)
0.3159339427948 2k setup_DB
1.2424399852753 2k work_with_binary_data
post-patch without pgbouncer
10.278841018677 2k setup_DB
1.0223269462585 2k work_with_binary_data
options as a parameter is accepted by PostgreSQL, however it is not accepted by pgbouncer.
Options: (See MDL-54947 for further background)
- Inform pgbouncer users they need to apply the following configurations
- standard_conforming_strings = on
- client_encoding = utf8
- ALTER USER/DATABASE SET search_path=schema
- Implement options in Moodle to handle not sending options
- 'dbconnectoptions' => 'connect|afterconnect|notneeded', 3 options default 'connect'
- 'dbhandlesoptions' => true, which is notneeded and throws exceptions if you try to use schemas.
The best approach needs to be determined and implemented.
- Discovered while testing
-
MDL-54947 Update PostgreSQL binary (bytea) handling and improve connection performance
- Closed
- has been marked as being related by
-
MDL-44862 Postgres dbport is discarded when dbsocket is used, it should not
- Closed
- is duplicated by
-
MDL-55144 Provide different connection alternatives with the postgres driver
- Closed
- Testing discovered
-
MDL-58651 logstore_database: Add ability to not send database options
- Closed