[Pgpool-general] Encoding errors on second node

Alex Kirhenshtein alk at alk.lv
Fri Jan 8 00:43:37 UTC 2010


Hello.

 

I'm currently trying to migrate customer application to pgpool (in
replication mode), but run into a weird problem - after a couple of
select/insert queries, postgress on one of the nodes reports "invalid byte
sequence for encoding" and reject query. Query is pure ASCII and tcpdump
capture looks clean too.

 

Nodes was synced before each test (using rsync), dumps are identical.

 

Same application works perfectly well if I degrade one node (doesn't matter
which one, just need to leave only one active)

 

My setup:

two nodes, running:

 Debian Lenny, 2.6.26-2-amd64

 PostgreSQL 8.3.8

 pgpool-II 2.3

 

Table scheme:

 

                                     Table "public.sys_user_activity"

    Column    |            Type             |
Modifiers

--------------+-----------------------------+-------------------------------
------------------------------

 id           | integer                     | not null default
nextval('seq_sys_user_activity'::regclass)

 userid       | integer                     |

 httpheader   | text                        |

 request      | text                        |

 ipaddress    | text                        |

 activitytype | character varying(255)      |

 loglevel     | character varying(255)      |

 datetime     | timestamp without time zone | default now()

Indexes:

    "pk_sys_user_activity" PRIMARY KEY, btree (id)

 

Log from node 1:

 

2010-01-08 00:14:52 CET LOG:  statement: SELECT now()

2010-01-08 00:14:52 CET LOG:  statement: BEGIN

2010-01-08 00:14:52 CET LOG:  statement: LOCK TABLE "sys_user_activity" IN
SHARE ROW EXCLUSIVE MODE

2010-01-08 00:14:52 CET LOG:  execute <unnamed>: INSERT INTO
"sys_user_activity"("ipaddress", "request", "userid", "activitytype",
"httpheader", "datetime") VALUES ('***.***.***.***','Qry=SELECT
o.ID,a0.Name,a0.Klientnr,a0.col01,a0.Typ,a0.Strasse,a0.PLZ,a0.Ort,a0.col2,a0
.UserArea,a0.Tel1,a0.Tel2,a0.Aenderungsdatum,a0.col3,a0.col4,a0.col5,a0.col6
,a0.col8,a0.col9,a0.col10,a0.col11,a0.Region,a0.Fachrichtung,a0.Fachrichtung
_Group,a0.Inhaber,a0.Lon,a0.Lat,a0.GeoConfidence,a0.GeoErr1,a0.GeoMsg,a0.Con
nScoring,a0.OrgName,a0.Klientart,a0.col7,a0.Segment FROM INT_Account a0,
CIS_OBJECTS o WHERE  a0.ID=o.ID AND  (o.ID
IN(27235865,27235690,27236010));',1,'ExpandNodeOneLevel','content-type=appli
cation/x-www-form-urlencoded;Cache-Control=no-cache;pragma=no-cache;user-age
nt=Mozilla/4.0 (Windows 7 6.1) Java/1.6.0_17;host=***;accept=text/html,
image/gif, image/jpeg, *; q=.2, */*;
q=.2;Proxy-Connection=keep-alive;content-length=530;cookie=JSESSIONID=b0d3f4
cfcf35d086c4ad28e436c1.instance-09;','2010-01-08 00:14:52.188497+01')

2010-01-08 00:14:52 CET LOG:  statement: COMMIT

2010-01-08 00:14:52 CET LOG:  execute <unnamed>: SELECT
o.ID,a0.Name,a0.Klientnr,a0.col01,a0.Typ,a0.Strasse,a0.PLZ,a0.Ort,a0.col2,a0
.UserArea,a0.Tel1,a0.Tel2,a0.Aenderungsdatum,a0.col3,a0.col4,a0.col5,a0.col6
,a0.col8,a0.col9,a0.col10,a0.col11,a0.Region,a0.Fachrichtung,a0.Fachrichtung
_Group,a0.Inhaber,a0.Lon,a0.Lat,a0.GeoConfidence,a0.GeoErr1,a0.GeoMsg,a0.Con
nScoring,a0.OrgName,a0.Klientart,a0.col7,a0.Segment FROM INT_Account a0,
CIS_OBJECTS o WHERE  a0.ID=o.ID AND  (o.ID IN(27235865,27235690,27236010))

 

Log from node 2:

 

2010-01-08 00:14:52 CET LOG:  statement: BEGIN

2010-01-08 00:14:52 CET LOG:  statement: LOCK TABLE "sys_user_activity" IN
SHARE ROW EXCLUSIVE MODE

2010-01-08 00:14:52 CET LOG:  execute <unnamed>: INSERT INTO
"sys_user_activity"("ipaddress", "request", "userid", "activitytype",
"httpheader", "datetime") VAL

UES ('***.***.***.***','Qry=SELECT
o.ID,a0.Name,a0.Klientnr,a0.col01,a0.Typ,a0.Strasse,a0.PLZ,a0.Ort,a0.col2,a0
.UserArea,a0.Tel1,a0.Tel2,a0.Aenderungsdatum,a0.col3

,a0.col4,a0.col5,a0.col6,a0.col8,a0.col9,a0.col10,a0.col11,a0.Region,a0.Fach
richtung,a0.Fachrichtung_Group,a0.Inhaber,a0.Lon,a0.Lat,a0.GeoConfidence,a0.
GeoErr1,

a0.GeoMsg,a0.ConnScoring,a0.OrgName,a0.Klientart,a0.col7,a0.Segment FROM
INT_Account a0, CIS_OBJECTS o WHERE  a0.ID=o.ID AND  (o.ID
IN(27235865,27235690,2723601

0));',1,'ExpandNodeOneLevel','content-type=application/x-www-form-urlencoded
;Cache-Control=no-cache;pragma=no-cache;user-agent=Mozilla/4.0 (Windows 7
6.1) Java/

1.6.0_17;host=***;accept=text/html, image/gif, image/jpeg, *; q=.2, */*;
q=.2;Proxy-Connection=keep-alive;content-length=530;cookie=JSESSIONID=b0d3f4
cfc

f35d086c4ad28e436c1.instance-09;','2010-01-08 00:14:52.188497+01')

2010-01-08 00:14:52 CET LOG:  statement: COMMIT

2010-01-08 00:14:52 CET LOG:  statement: BEGIN

2010-01-08 00:14:52 CET LOG:  statement: LOCK TABLE "sys_user_activity" IN
SHARE ROW EXCLUSIVE MODE

2010-01-08 00:14:52 CET ERROR:  invalid byte sequence for encoding "UTF8":
0xa0

2010-01-08 00:14:52 CET HINT:  This error can also happen if the byte
sequence does not match the encoding expected by the server, which is
controlled by "clien

t_encoding".

 

 

Any ideas on fixing this?

 

Thanks.

 

wbr, alex.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pgfoundry.org/pipermail/pgpool-general/attachments/20100108/cacddd13/attachment-0001.html>


More information about the Pgpool-general mailing list