View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000532 | Pgpool-II | Bug | public | 2019-08-02 13:58 | 2020-02-25 11:21 |
| Reporter | van | Assigned To | hoshiai | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 4.0.2 | ||||
| Summary | 0000532: pgpool log not showing proper info | ||||
| Description | pgpool log application name is not showing properly. In my client side i was doing conn = PQconnectdb("port=5432 host=10.106.66.54 user=mpsroot dbname=mpsdb password="); res = PQexec(conn, "set application_name = myapplication"); log configuration are : log_line_prefix = '%a: %t: pid %p: ' But in log it is coming as unknown [unknown]: 2019-08-02 04:52:54: pid 54: DEBUG: [unknown]: 2019-08-02 04:52:54: pid 54: DETAIL: received kind 'Q'(51) from frontend [unknown]: 2019-08-02 04:52:54: pid 54: DEBUG: session context: clearing doing extended query messaging. DONE [unknown]: 2019-08-02 04:52:54: pid 54: LOG: Query message from frontend. | ||||
| Tags | No tags attached. | ||||
|
|
The application name is shown by pgpool is name specified at the time of connection. Pgpool don't detect parameter which is changed by SET command. If you set parameter of application_name in PQconnectdb(), you can show application_name on pgpool.log. |
|
|
Hi hoshiai, Thanks for clarification, you can closed the issue now. |
|
|
Hi hoshiai, It not working , const string CONNECTION_STRING("DRIVER=PostgreSQL_unixODBC;DATABASE=mpsdb;SERVER=pgpool;PORT=5432;UID=mpsroot;PWD=somevalue;application_name=abcd;"); [No Connection] : 2019-08-11 17:50:21: pid 18: DEBUG: reaper handler [No Connection] : 2019-08-11 17:50:21: pid 18: WARNING: child process with pid: 64 was terminated by segmentation fault [No Connection] : 2019-08-11 17:50:21: pid 18: LOG: fork a new child process with pid: 65 [No Connection] : 2019-08-11 17:50:21: pid 18: DEBUG: reaper handler: exiting normally [No Connection] : 2019-08-11 17:50:21: pid 65: DEBUG: I am Pgpool Child process with pid: 65 [No Connection] : 2019-08-11 17:50:21: pid 65: DEBUG: initializing backend status [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: I am 63 accept fd 6 [No Connection] : 2019-08-11 17:50:22: pid 63: LOG: new connection received [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: connecting host=192-168-1-98.mgmt-monit.default.svc.cluster.local port=47434 [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: reading startup packet [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: Protocol Major: 3 Minor: 0 database: mpsdb user: mpsroot [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: creating new connection to backend [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: connecting 0 backend [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: authentication backend [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: auth kind:5 [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: authentication backend: 0 [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: trying md5 authentication [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: performing md5 authentication [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: DB node id: 0 salt: e0fa198f [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"application_name" value:"" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"client_encoding" value:"SQL_ASCII" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"DateStyle" value:"ISO, MDY" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"integer_datetimes" value:"on" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"IntervalStyle" value:"postgres" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"is_superuser" value:"on" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"server_encoding" value:"SQL_ASCII" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"server_version" value:"10.6" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"session_authorization" value:"mpsroot" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"standard_conforming_strings" value:"on" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: process parameter status [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: backend:0 name:"TimeZone" value:"UTC" [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: authentication backend [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: cp->info[i]:0x7f0daf2cc000 pid:6525 [No Connection] : 2019-08-11 17:50:22: pid 63: DEBUG: sending backend key data [No Connection] : 2019-08-11 17:50:22: pid 63: DETAIL: send pid 6525 to frontend [unknown] : 2019-08-11 17:50:22: pid 63: DEBUG: selecting load balance node [unknown] : 2019-08-11 17:50:22: pid 63: DETAIL: selected backend id is 0 [unknown] : 2019-08-11 17:50:22: pid 63: LOG: Query message from frontend. [unknown] : 2019-08-11 17:50:22: pid 63: DETAIL: query: "select oid, typbasetype from pg_type where typname = 'lo'" [unknown] : 2019-08-11 17:50:22: pid 63: LOG: statement: select oid, typbasetype from pg_type where typname = 'lo' [unknown] : 2019-08-11 17:50:22: pid 63: DEBUG: checking if query has INSERT INTO, FOR SHARE or FOR UPDATE [unknown] : 2019-08-11 17:50:22: pid 63: DETAIL: result = 0 [unknown] : 2019-08-11 17:50:22: pid 63: DEBUG: decide where to send the query [unknown] : 2019-08-11 17:50:22: pid 63: DETAIL: destination = 2 for query= "select oid, typbasetype from pg_type where typname = 'lo'" [unknown] : 2019-08-11 17:50:22: pid 63: DEBUG: do_query: extended:0 query:"SELECT current_setting('transaction_isolation')" [unknown] : 2019-08-11 17:50:22: pid 63: CONTEXT: while getting transaction isolation [unknown] : 2019-08-11 17:50:22: pid 63: DEBUG: checking load balance precondtions. TSTATE:I wrting_trancation:0 failed_transaction:0 isolation:2 it still coming as unknown |
|
|
if use ODBC driver, you can use "pqopt" connection parameter. I tested that it works with the following settings: ==== setting =========================== $ cat odbc.ini Description = sample odbc driver Driver = PostgreSQL Database = test Servername = localhost UserName = postgres Password = Port = 11000 pqopt = application_name = test_app ===================================== application_name was appeared in log. === pgpool.log ========================= [No Connection]:2019-08-19 17:20:14: pid 9697 DEBUG: pool_write: to frontend: length:4 po:1 [No Connection]:2019-08-19 17:20:14: pid 9697 DEBUG: pool_write: to frontend: kind:I po:5 [No Connection]:2019-08-19 17:20:14: pid 9697 DEBUG: pool_flush_it: flush size: 6 test_app:2019-08-19 17:20:14: pid 9697 DEBUG: selecting load balance node test_app:2019-08-19 17:20:14: pid 9697 DETAIL: selected backend id is 1 2019-08-19 17:20:14: pid 9697[app: test_app]: DEBUG: initializing session context 2019-08-19 17:20:14: pid 9697[app: test_app]: DETAIL: selected load balancing node: 1 ===================================== I have never used this option in CONNECTION_STRING. you maybe able to use this option like as "pqopt={application_name=myapplication};" in CONNECTION_STRING. |
|
|
Do you have any questions? If you don't have any problems, I would like to close this issue. |
|
|
I closed this ticket. If you have a new question, Please email pgpool-general or pgpool-hackers. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2019-08-02 13:58 | van | New Issue | |
| 2019-08-06 10:30 | hoshiai | Assigned To | => hoshiai |
| 2019-08-06 10:30 | hoshiai | Status | new => assigned |
| 2019-08-06 16:53 | hoshiai | Status | assigned => acknowledged |
| 2019-08-06 16:53 | hoshiai | Note Added: 0002747 | |
| 2019-08-06 16:55 | hoshiai | Status | acknowledged => feedback |
| 2019-08-09 12:49 | van | Note Added: 0002761 | |
| 2019-08-09 12:49 | van | Status | feedback => assigned |
| 2019-08-12 02:58 | van | Note Added: 0002771 | |
| 2019-08-19 17:33 | hoshiai | Note Added: 0002794 | |
| 2019-08-19 17:34 | hoshiai | Status | assigned => feedback |
| 2020-02-05 09:43 | hoshiai | Note Added: 0003134 | |
| 2020-02-25 11:21 | hoshiai | Status | feedback => closed |
| 2020-02-25 11:21 | hoshiai | Resolution | open => fixed |
| 2020-02-25 11:21 | hoshiai | Note Added: 0003223 |