Обсуждение: WAL_DEBUG

Поиск
Список
Период
Сортировка

WAL_DEBUG

От
ning chan
Дата:
Hi,
Does anyone know how to enable WAL_DEBUG?
I download postgresql 9.2.3 src code and compile it as follow:


modify ./src/include/pg_config_manual.h
/*
 * Enable debugging print statements for WAL-related operations; see
 * also the wal_debug GUC var.
 */
#define WAL_DEBUG 4


 ./configure --without-readline --without-zlib CPPFLAGS='-DWAL_DEBUG'

I don't see anything special log to the log file.

I even try to add a line wal_debug=number to the postgresql.conf, doesn't help either.

Thanks~
Ning

Re: WAL_DEBUG

От
Jeff Janes
Дата:
On Wed, Mar 6, 2013 at 1:31 PM, ning chan <ninchan8328@gmail.com> wrote:
Hi,
Does anyone know how to enable WAL_DEBUG?
I download postgresql 9.2.3 src code and compile it as follow:


modify ./src/include/pg_config_manual.h
/*
 * Enable debugging print statements for WAL-related operations; see
 * also the wal_debug GUC var.
 */
#define WAL_DEBUG 4


 ./configure --without-readline --without-zlib CPPFLAGS='-DWAL_DEBUG'

Either one of those works for me.
 

I don't see anything special log to the log file.

open running pgbench -i, I see a lot of things like this in the log, once I set wal_debug:

STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEDC0: prev 0/18BED78; xid 1838; len 34: Btree - insert: rel 1663/16384/12678; tid 1/8
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEE08: prev 0/18BEDC0; xid 1838; len 52: Heap - insert: rel 1663/16384/12765; tid 46/29
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEE60: prev 0/18BEE08; xid 1838; len 42: Btree - insert: rel 1663/16384/12767; tid 27/140
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEEB0: prev 0/18BEE60; xid 1838; len 42: Btree - insert: rel 1663/16384/12768; tid 26/14



I even try to add a line wal_debug=number to the postgresql.conf, doesn't help either.


If I include literally "wal_debug=number", upon start up I get the self-explanatory error:

LOG:  parameter "wal_debug" requires a Boolean value
FATAL:  configuration file "/tmp/data/postgresql.conf" contains errors

If I replace "number" with a valid true value ("true", "on", "1"), then I get the above-reported WAL debugging log messages.

Cheers,

Jeff

Re: WAL_DEBUG

От
ning chan
Дата:
Hi Jeff,
Thanks for your reply.

this is the error message i got:
-bash-4.1$ pg_ctl start
server starting
-bash-4.1$ LOG:  unrecognized configuration parameter "wal_debug" in file "/usr/local/pgsql/data/postgresql.conf" line 162
FATAL:  configuration file "/usr/local/pgsql/data/postgresql.conf" contains errors


where wal_debug = 1 in the conf file.

One question: Do i need to uninstall first before I gmake install again? If so, any idean how to uninstall it?

Thanks~
Ning


On Wed, Mar 6, 2013 at 4:03 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
On Wed, Mar 6, 2013 at 1:31 PM, ning chan <ninchan8328@gmail.com> wrote:
Hi,
Does anyone know how to enable WAL_DEBUG?
I download postgresql 9.2.3 src code and compile it as follow:


modify ./src/include/pg_config_manual.h
/*
 * Enable debugging print statements for WAL-related operations; see
 * also the wal_debug GUC var.
 */
#define WAL_DEBUG 4


 ./configure --without-readline --without-zlib CPPFLAGS='-DWAL_DEBUG'

Either one of those works for me.
 

I don't see anything special log to the log file.

open running pgbench -i, I see a lot of things like this in the log, once I set wal_debug:

STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEDC0: prev 0/18BED78; xid 1838; len 34: Btree - insert: rel 1663/16384/12678; tid 1/8
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEE08: prev 0/18BEDC0; xid 1838; len 52: Heap - insert: rel 1663/16384/12765; tid 46/29
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEE60: prev 0/18BEE08; xid 1838; len 42: Btree - insert: rel 1663/16384/12767; tid 27/140
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEEB0: prev 0/18BEE60; xid 1838; len 42: Btree - insert: rel 1663/16384/12768; tid 26/14



I even try to add a line wal_debug=number to the postgresql.conf, doesn't help either.


If I include literally "wal_debug=number", upon start up I get the self-explanatory error:

LOG:  parameter "wal_debug" requires a Boolean value
FATAL:  configuration file "/tmp/data/postgresql.conf" contains errors

If I replace "number" with a valid true value ("true", "on", "1"), then I get the above-reported WAL debugging log messages.

Cheers,

Jeff

Re: WAL_DEBUG

От
Jeff Janes
Дата:
On Wed, Mar 6, 2013 at 2:38 PM, ning chan <ninchan8328@gmail.com> wrote:
Hi Jeff,
Thanks for your reply.

this is the error message i got:
-bash-4.1$ pg_ctl start
server starting
-bash-4.1$ LOG:  unrecognized configuration parameter "wal_debug" in file "/usr/local/pgsql/data/postgresql.conf" line 162
FATAL:  configuration file "/usr/local/pgsql/data/postgresql.conf" contains errors

This means the server wasn't compiled with WAL_DEBUG defined.  You have to do both things, first compile with WAL_DEBUG, and then set the wal_debug guc to on.


One question: Do i need to uninstall first before I gmake install again?


I've never bothered to do that and it never gave me any problems (but I wouldn't so on a running production system).  You do need to run make maintainer-clean before you redo the ./config and build and install, though.
 
If so, any idean how to uninstall it?

If you originally installed from source yourself using the normal build tools, uninstalling should need nothing more than removing the directory that --prefix was originally set to.  If you had built other things that linked against the installation (DBD::Pg, for example) they will be broken by this, but they should work again once you redo the install.

If you installed some other way, I don't know.

Cheers,

Jeff

Re: WAL_DEBUG

От
ning chan
Дата:
Hi Jeff,

I do the exact same steps on a brand new box and it works.
Thanks for your help!

Ning


On Wed, Mar 6, 2013 at 4:38 PM, ning chan <ninchan8328@gmail.com> wrote:
Hi Jeff,
Thanks for your reply.

this is the error message i got:
-bash-4.1$ pg_ctl start
server starting
-bash-4.1$ LOG:  unrecognized configuration parameter "wal_debug" in file "/usr/local/pgsql/data/postgresql.conf" line 162
FATAL:  configuration file "/usr/local/pgsql/data/postgresql.conf" contains errors


where wal_debug = 1 in the conf file.

One question: Do i need to uninstall first before I gmake install again? If so, any idean how to uninstall it?

Thanks~
Ning


On Wed, Mar 6, 2013 at 4:03 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
On Wed, Mar 6, 2013 at 1:31 PM, ning chan <ninchan8328@gmail.com> wrote:
Hi,
Does anyone know how to enable WAL_DEBUG?
I download postgresql 9.2.3 src code and compile it as follow:


modify ./src/include/pg_config_manual.h
/*
 * Enable debugging print statements for WAL-related operations; see
 * also the wal_debug GUC var.
 */
#define WAL_DEBUG 4


 ./configure --without-readline --without-zlib CPPFLAGS='-DWAL_DEBUG'

Either one of those works for me.
 

I don't see anything special log to the log file.

open running pgbench -i, I see a lot of things like this in the log, once I set wal_debug:

STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEDC0: prev 0/18BED78; xid 1838; len 34: Btree - insert: rel 1663/16384/12678; tid 1/8
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEE08: prev 0/18BEDC0; xid 1838; len 52: Heap - insert: rel 1663/16384/12765; tid 46/29
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEE60: prev 0/18BEE08; xid 1838; len 42: Btree - insert: rel 1663/16384/12767; tid 27/140
STATEMENT:  alter table pgbench_accounts add primary key (aid)
LOG:  INSERT @ 0/18BEEB0: prev 0/18BEE60; xid 1838; len 42: Btree - insert: rel 1663/16384/12768; tid 26/14



I even try to add a line wal_debug=number to the postgresql.conf, doesn't help either.


If I include literally "wal_debug=number", upon start up I get the self-explanatory error:

LOG:  parameter "wal_debug" requires a Boolean value
FATAL:  configuration file "/tmp/data/postgresql.conf" contains errors

If I replace "number" with a valid true value ("true", "on", "1"), then I get the above-reported WAL debugging log messages.

Cheers,

Jeff