[Pgcluster-general] server closed the connection unexpectedly

fesz at centrum.cz fesz at centrum.cz
Wed Jun 27 18:42:04 UTC 2007


-- definition of function foo() - it`s empty function that doesn`t make anything just return true
CREATE OR REPLACE FUNCTION foo() RETURNS bool AS $$DECLARE BEGIN RETURN true; END; $$ LANGUAGE 'plpgsql';


When I call it repeatly after a few succesfully pass server closed my connection.
If replication server is down before I connect to server it crashed after
my first (in session) try to call any of MY function (when I call some 
system function everything is ok). 


template1=# SELECT foo();
 foo 
-----
 t
(1 row)

template1=# SELECT foo();
 foo 
-----
 t
(1 row)

template1=# SELECT foo();
 foo 
-----
 t
(1 row)

template1=# SELECT foo();
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.



postgresql.log:

2007-06-27 19:56:43 CEST LOG:  server process (PID 17925) was terminated by signal 11
2007-06-27 19:56:43 CEST LOG:  terminating any other active server processes
2007-06-27 19:56:43 CEST LOG:  all server processes terminated; reinitializing
2007-06-27 19:56:43 CEST LOG:  database system was interrupted at 2007-06-27 19:56:21 CEST
2007-06-27 19:56:43 CEST LOG:  checkpoint record is at 0/9E12AEC
2007-06-27 19:56:43 CEST LOG:  redo record is at 0/9E12AEC; undo record is at 0/0; shutdown TRUE
2007-06-27 19:56:43 CEST LOG:  next transaction ID: 0/3348; next OID: 1015812
2007-06-27 19:56:43 CEST LOG:  next MultiXactId: 1; next MultiXactOffset: 0
2007-06-27 19:56:43 CEST LOG:  database system was not properly shut down; automatic recovery in progress
2007-06-27 19:56:43 CEST FATAL:  the database system is starting up
2007-06-27 19:56:43 CEST LOG:  record with zero length at 0/9E12B34
2007-06-27 19:56:43 CEST LOG:  redo is not required
2007-06-27 19:56:43 CEST LOG:  database system is ready


debug of pgreplicate command: ./pgreplicate -D /etc/postgresql/8.2/main -nv

2007-06-27 19:56:41 [17926] DEBUG:PGRdo_replicate():query :: SELECT foo();
2007-06-27 19:56:41 [17926] DEBUG:cmdSts=Q
2007-06-27 19:56:41 [17926] DEBUG:cmdType=S
2007-06-27 19:56:41 [17926] DEBUG:rlog=0
2007-06-27 19:56:41 [17926] DEBUG:port=5432
2007-06-27 19:56:41 [17926] DEBUG:pid=17925
2007-06-27 19:56:41 [17926] DEBUG:from_host=127.0.0.1
2007-06-27 19:56:41 [17926] DEBUG:dbName=template1
2007-06-27 19:56:41 [17926] DEBUG:userName=postgres
2007-06-27 19:56:41 [17926] DEBUG:recieve sec=1182967001
2007-06-27 19:56:41 [17926] DEBUG:recieve usec=973701
2007-06-27 19:56:41 [17926] DEBUG:query_size=13
2007-06-27 19:56:41 [17926] DEBUG:request_id=3
2007-06-27 19:56:41 [17926] DEBUG:replicate_id=0
2007-06-27 19:56:41 [17926] DEBUG:recovery_status=0
2007-06-27 19:56:41 [17926] DEBUG:query=SELECT foo();
2007-06-27 19:56:41 [17926] DEBUG:sem_lock [1] req
2007-06-27 19:56:41 [17926] DEBUG:sem_lock [1] got it
2007-06-27 19:56:41 [17926] DEBUG:source host
2007-06-27 19:56:41 [17926] DEBUG:read_answer():answer[PGR_QUERY_DONE_NOTICE_CMD]
2007-06-27 19:56:41 [17926] DEBUG:read_answer():QUERY DONE
2007-06-27 19:56:41 [17926] DEBUG:end thread_send_source()
2007-06-27 19:56:41 [17926] DEBUG:sem_unlock[1]
--- here I make query "SELECT foo();" again, it look like connection was closed after previous query, because
--- it`s trying to replicate query PGR_CLOSE_CONNECTION
2007-06-27 19:56:43 [17926] DEBUG:PGRdo_replicate():query :: PGR_CLOSE_CONNECTION
2007-06-27 19:56:43 [17926] DEBUG:cmdSts=O
2007-06-27 19:56:43 [17926] DEBUG:cmdType=x
2007-06-27 19:56:43 [17926] DEBUG:rlog=0
2007-06-27 19:56:43 [17926] DEBUG:port=5432
2007-06-27 19:56:43 [17926] DEBUG:pid=17925
2007-06-27 19:56:43 [17926] DEBUG:from_host=127.0.0.1
2007-06-27 19:56:43 [17926] DEBUG:dbName=template1
2007-06-27 19:56:43 [17926] DEBUG:userName=postgres
2007-06-27 19:56:43 [17926] DEBUG:recieve sec=1182967003
2007-06-27 19:56:43 [17926] DEBUG:recieve usec=922387
2007-06-27 19:56:43 [17926] DEBUG:query_size=21
2007-06-27 19:56:43 [17926] DEBUG:request_id=1
2007-06-27 19:56:43 [17926] DEBUG:replicate_id=0
2007-06-27 19:56:43 [17926] DEBUG:recovery_status=0
2007-06-27 19:56:43 [17926] DEBUG:query=PGR_CLOSE_CONNECTION
2007-06-27 19:56:43 [17926] DEBUG:sem_lock [1] req
2007-06-27 19:56:43 [17926] DEBUG:sem_lock [1] got it
2007-06-27 19:56:43 [17926] DEBUG:source host
2007-06-27 19:56:43 [17926] DEBUG:sem_unlock[1]


I download source of pgcluster1.7.0rc7 (include postgre). 
My configuration: 1dbcluster and 1replicator which runs both on localhost (Can be just 1db reason of problem?)

Thx for reply



More information about the Pgcluster-general mailing list