We are using eRserver for database replication. The
erserver first needs to be setup.
The setup script creates the following
table.
create table _RSERV_TABLES_ (tname name,
cname name, reloid oid, key int4)
The table creation is exiting. Enabling syslog of
Postgresql we found that
postgres backend process is exiting with error
"Socket command type N unknown".
We know what the error means. But we are
unable to trace the problem cause.
NOTE that, this invalid command type problem comes
only some times. Most
of the time the create table succeeds.
The following is the trace of DBD::Pg sender
followed by the syslog messages (We have
put this messages in postgres and
compiled the code) of postgres process.
We can clearly see that postgres is receiving the
NOTICE message back
which it sent to DBD::Pg.
We have browsed both the sender and receiver code.
Both have been written to follow
the protocol of query sending i.e. Send "Q"
followed by the query string.
However, its surprise here as to how postgres
socket recieved the NOTICE it sent
to DBD::Pg.
If we look at the log of DBD::Pg sender. It does
not show that it sent something
wrong to Postgres.
This leaves the question as to how Postgres
received it.
We have visted the mail thread on such problem and
DBD::Pg site suggests
that it may be Pearl problem. However we could not
guess how Pearl could
impact it.
PLEASE LET US KNOW HOW THIS SOCKET PROBLEM CAN BE
RESOLVED. WE WOULD
BE THANKFUL FOR ALL THE REPLIES.
DBD::Pg
SENDER:
--------------
dbd_st_preparse: statement = >create table
_RSERV_TABLES_ (tname name, cname name, reloid
oid, key int4)<
1 <- prepare=
DBI::st=HASH(0x82355c8) at /usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm
line 1212 via /usr/local/erserver/bin/ers_setup
line 153
>> execute DISPATCH
(DBI::st=HASH(0x82355c8) rc1/1 @1 g0 ima41 pid#20233) at
/usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm
line 1213 via
/usr/local/erserver/bin/ers_setup line
153
-> execute for DBD::Pg::st
(DBI::st=HASH(0x82355c8)~0x827deec)
dbd_st_execute
dbd_st_execute:
statement = >create table _RSERV_TABLES_ (tname name, cname name,
reloid
oid, key int4)<
FATAL 1: Socket command
type N unknown error 7 recorded: FATAL 1: Socket command type N
unknown
!! ERROR: 7 'FATAL
1: Socket command type N unknown'
<- execute=
undef at /usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm line 1213 via
/usr/local/erserver/bin/ers_setup line
153
!! ERROR: 7 'FATAL 1: Socket command type N
unknown'
<- do= undef at
/usr/local/erserver/bin/ers_setup line 153
>>
errstr DISPATCH (DBI::db=HASH(0x82173f8) rc1/1 @1
g1 ima4 pid#20233) at
/usr/local/erserver/bin/ers_setup line
153
>> errstr DISPATCH
(DBI::db=HASH(0x82173f8) rc1/1 @1 g1 ima4 pid#20233) at
/usr/local/erserver/bin/ers_setup line
153
-> errstr in DBD::_::common for DBD::Pg::db
(DBI::db=HASH(0x82173f8)~0x82174ac)
<- errstr= ( 'FATAL
1: Socket command type N unknown' ) [1 items] at
/usr/local/erserver/bin/ers_setup line
153
>> DESTROY DISPATCH
(DBI::db=HASH(0x82173f8) rc1/1 @1 g0 ima0 pid#20233)
<> DESTROY ignored for outer handle DBI::db=HASH(0x82173f8) (inner
DBI::db=HASH(0x82174ac))
>> DESTROY DISPATCH (DBI::db=HASH(0x82683e8) rc1/1
@1 g0 ima0 pid#20233)
<> DESTROY ignored for outer
handle DBI::db=HASH(0x82683e8) (inner
DBI::db=HASH(0x8208a4c))
Postgres RECEIVER
-----------------
Apr 29
19:19:08 cp_node2 cpdb cpdb 10.1.1.2 idle in transaction: Postgres Recv
<Q
create table _RSERV_SERVERS_ (server serial, host text,
post int4, dbase text)>
Apr 29 19:19:08
cp_node2 cpdb cpdb 10.1.1.2 idle in transaction: Postgres
Recv 124
Apr 29 19:19:08 cp_node2 cpdb cpdb 10.1.1.2 idle in
transaction: Postgres Recv <NOTICE:
CREATE TABLE will create implicit sequence
'_rserv_servers__server_seq' for SERIAL column
'_rserv_servers_.server' NOTICE: CREATE TABLE
/ UNIQUE will create implicit index
'_rserv_servers__server_key' for table
'_rserv_servers_' >
Apr 29 19:19:08 cp_node2 cpdb cpdb 10.1.1.2 idle
in transaction: Postgres Recv 239
Apr 29 19:19:08 cp_node2 cpdb cpdb
10.1.1.2 idle in transaction: Postgres Recv <Qrollback>
Apr
29 19:19:08 cp_node2 cpdb cpdb 10.1.1.2 idle in transaction: Postgres
Recv 9
Thanks
Prasad