Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2678395

Browse files
committed
In working through a pg_autovacuum problem with Joe Conway (which turned
out to be the same problem reported by Cott Lang which the previouspatch resolved) a new bug was uncovered when running with a debug levelof greater than 1.This patch resolves this new found bug and fixes some of the otherdebugging output to be more consistent.Please apply to both HEAD and the 7.4 branch.Matthew T. O'Connor
1 parent3ceda5e commit2678395

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

‎contrib/pg_autovacuum/TODO

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Todo Items for pg_autovacuum client
22
--------------------------------------------------------------------------
33

4+
_Add Startup Message (with datetime stamp) to Logfile when starting and logging
5+
46
_create a FSM export function and see if I can use it for pg_autovacuum
57

68
_look into possible benifits of pgstattuple contrib work

‎contrib/pg_autovacuum/pg_autovacuum.c

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -359,19 +359,19 @@ print_table_list(Dllist *table_list)
359359
void
360360
print_table_info(tbl_info*tbl)
361361
{
362-
sprintf(logbuffer," table name:%s.%s",tbl->dbi->dbname,tbl->table_name);
362+
sprintf(logbuffer," table name: %s.%s",tbl->dbi->dbname,tbl->table_name);
363363
log_entry(logbuffer);
364364
sprintf(logbuffer," relid: %u; relisshared: %i",tbl->relid,tbl->relisshared);
365365
log_entry(logbuffer);
366366
sprintf(logbuffer," reltuples: %f; relpages: %u",tbl->reltuples,tbl->relpages);
367367
log_entry(logbuffer);
368-
sprintf(logbuffer," curr_analyze_count:%li;cur_delete_count: %li",
368+
sprintf(logbuffer," curr_analyze_count: %li;curr_vacuum_count: %li",
369369
tbl->curr_analyze_count,tbl->curr_vacuum_count);
370370
log_entry(logbuffer);
371-
sprintf(logbuffer,"ins_at_last_analyze: %li;del_at_last_vacuum: %li",
371+
sprintf(logbuffer,"last_analyze_count: %li;last_vacuum_count: %li",
372372
tbl->CountAtLastAnalyze,tbl->CountAtLastVacuum);
373373
log_entry(logbuffer);
374-
sprintf(logbuffer,"insert_threshold:%li;delete_threshold %li",
374+
sprintf(logbuffer,"analyze_threshold:%li;vacuum_threshold: %li",
375375
tbl->analyze_threshold,tbl->vacuum_threshold);
376376
log_entry(logbuffer);
377377
fflush(LOGOUTPUT);
@@ -678,17 +678,29 @@ print_db_list(Dllist *db_list, int print_table_lists)
678678
void
679679
print_db_info(db_info*dbi,intprint_tbl_list)
680680
{
681-
sprintf(logbuffer,"dbname: %s Username %s Passwd %s",dbi->dbname,
682-
dbi->username,dbi->password);
681+
sprintf(logbuffer,"dbname: %s", (dbi->dbname) ?dbi->dbname :"(null)");
683682
log_entry(logbuffer);
684-
sprintf(logbuffer," oid %u InsertThresh: %li DeleteThresh: %li",dbi->oid,
685-
dbi->analyze_threshold,dbi->vacuum_threshold);
683+
684+
sprintf(logbuffer," oid: %u",dbi->oid);
686685
log_entry(logbuffer);
686+
687+
sprintf(logbuffer," username: %s", (dbi->username) ?dbi->username :"(null)");
688+
log_entry(logbuffer);
689+
690+
sprintf(logbuffer," password: %s", (dbi->password) ?dbi->password :"(null)");
691+
log_entry(logbuffer);
692+
687693
if (dbi->conn!=NULL)
688-
log_entry(" conn is valid,we areconnected");
694+
log_entry("conn is valid,(connected)");
689695
else
690-
log_entry(" conn is null,we arenot connected.");
696+
log_entry("conn is null,(not connected)");
691697

698+
sprintf(logbuffer," default_analyze_threshold: %li",dbi->analyze_threshold);
699+
log_entry(logbuffer);
700+
701+
sprintf(logbuffer," default_vacuum_threshold: %li",dbi->vacuum_threshold);
702+
log_entry(logbuffer);
703+
692704
fflush(LOGOUTPUT);
693705
if (print_tbl_list>0)
694706
print_table_list(dbi->table_list);
@@ -935,7 +947,7 @@ print_cmd_args()
935947
log_entry(logbuffer);
936948
sprintf(logbuffer," args->port=%s", (args->port) ?args->port :"(null)");
937949
log_entry(logbuffer);
938-
sprintf(logbuffer," args->user=%s", (args->user) ?args->user :"(null)");
950+
sprintf(logbuffer," args->username=%s", (args->user) ?args->user :"(null)");
939951
log_entry(logbuffer);
940952
sprintf(logbuffer," args->password=%s", (args->password) ?args->password :"(null)");
941953
log_entry(logbuffer);
@@ -1007,7 +1019,7 @@ main(int argc, char *argv[])
10071019
db_list=init_db_list();
10081020
if (db_list==NULL)
10091021
return1;
1010-
1022+
10111023
if (check_stats_enabled(((db_info*)DLE_VAL(DLGetHead(db_list))))!=0)
10121024
{
10131025
log_entry("Error: GUC variable stats_row_level must be enabled.");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp