Page MenuHomePhabricator

Eliminating noise from postgres logs
Closed, ResolvedPublic

Description

Author: tommy

Description:
10 lines changed/added in includes/db/DatabasePostgres.php

We are running a number of instances of mediawiki on PostgreSQL and are getting a large amount of warning messages in the postgres log, which could easily be fixed with a few simple changes to DatabasePostgres.php. The messages in question are the following:

Message about escape string syntax:

[2010-07-01 00:02:30.022 CEST] [dbpg-bloggwiki] [mediawiki:mediawiki] WARNING: nonstandard use of \\ in a string literal at character 25

[2010-07-01 00:02:30.022 CEST] [dbpg-bloggwiki] [mediawiki:mediawiki] HINT: Use the escape string syntax for backslashes, e.g., E'\\'.

And warning message when calling "COMMIT" when no transaction is in progress

[2010-07-01 00:10:08.521 CEST] [dbpg-bloggwiki] [mediawiki:mediawiki] WARNING: there is no transaction in progress

It's not that it's a critical problem, but it would be nice to avoid filling up our logs with 1-2GB of these kind of messages per month, in addition to it being more correct.


Version: 1.17.x
Severity: enhancement

Attached:

Details

Reference
bz24629

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:12 PM
bzimport set Reference to bz24629.
bzimport added a subscriber: Unknown Object (MLST).

The checks for $mTrxLvl before COMMIT/ROLLBACK is done as of r70558.

Left off the escape thingie for \\ because I have no clue what's going on there. Somebody else can review that bit :)

tommy wrote:

This section of the postgres documentation gives a little more detail on the escape string syntax:
http://www.postgresql.org/docs/8.4/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE

You can add this to your postgresql.conf to turn off those escape warnings:

escape_string_warning = off

Closing: please reopen if you see other verbosity in the logs.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.