server terminated by a query in 7.3

Started by Jie Liangover 23 years ago3 messagesbugs
Jump to latest
#1Jie Liang
jie@stbernard.com

Tom,
I've a perl script, which has been used for a long time, it works well,
however, after
I upgrade my postgresql from 7.2 to 7.3, one query always makes server
terminated, could
you give me a solution for it?
Thanks.

Jie Liang

SELECT urlinfo.id,url,iprism_map,iprism_map_sg,level,domid,
CASE WHEN ratedon > '2002-11-24' AND ratedby
NOT LIKE '%jurl' THEN 1 ELSE 0 END as trunc
INTO TEMP filter96512
FROM urlinfo,ratings_by_serial,cid_code96512
WHERE pidwsr<=0 AND urlinfo.id=ratings_by_serial.id
AND ratings_by_serial.cid=cid_code96512.cid;

CREATE index filter_temp_id ON filter96512(id);

VACUUM ANALYZE filter96512;

SELECT id,url,9 as iprism_map,max(level) as level,domid,trunc
INTO TEMP filter0 FROM filter96512
WHERE iprism_map!~'^[14]' GROUP BY id,url,domid,trunc;

SELECT distinct on(id) id,url,1 as iprism_map,99 as level,domid,trunc
INTO TEMP filter_0 FROM filter96512
WHERE iprism_map='1';

server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

FROM LOG:
Dec 13 09:21:38 beijing postgres[699]: [30-1] LOG: query: SELECT distinct
on(id) id,url,1 as iprism_map,99 as level,domid,trunc INTO TEMP filter_0
FROM filter96512
Dec 13 09:21:38 beijing postgres[699]: [30-2] WHERE
iprism_map='1'
Dec 13 09:22:34 beijing postgres[141]: [9] LOG: server process (pid 699)
was terminated by signal 11
Dec 13 09:22:34 beijing postgres[141]: [10] LOG: terminating any other
active server processes
Dec 13 09:22:34 beijing postgres[141]: [11] LOG: all server processes
terminated; reinitializing shared memory and semaphores
Dec 13 09:22:34 beijing postgres[1844]: [12] LOG: connection received:
host=[local]
Dec 13 09:22:34 beijing postgres[1844]: [13] FATAL: The database system is
starting up
Dec 13 09:22:35 beijing postgres[1843]: [12] LOG: database system was
interrupted at 2002-12-13 09:08:04 PST
Dec 13 09:22:35 beijing postgres[1843]: [13] LOG: checkpoint record is at
1/D654B54
Dec 13 09:22:35 beijing postgres[1843]: [14] LOG: redo record is at
1/D654B54; undo record is at 0/0; shutdown FALSE
Dec 13 09:22:35 beijing postgres[1843]: [15] LOG: next transaction id:
5377; next oid: 35529333
Dec 13 09:22:35 beijing postgres[1843]: [16] LOG: database system was not
properly shut down; automatic recovery in progress
Dec 13 09:22:35 beijing postgres[1843]: [17] LOG: redo starts at 1/D654B94
Dec 13 09:22:35 beijing postgres[1843]: [18] LOG: ReadRecord: record with
zero length at 1/D6819E8
Dec 13 09:22:35 beijing postgres[1843]: [19] LOG: redo done at 1/D6819A4
Dec 13 09:22:38 beijing postgres[1843]: [20] LOG: database system is ready

#2Frank van Vugt
ftm.van.vugt@foxi.nl
In reply to: Jie Liang (#1)
Re: server terminated by a query in 7.3

after I upgrade my postgresql from 7.2 to 7.3, one query always makes server
terminated

This is caused by the vacuum of a temp table.

Tom fixed it already about a week ago and provided the patch here:

*** src/backend/storage/buffer/localbuf.c.orig  Wed Sep  4 16:31:25 2002
--- src/backend/storage/buffer/localbuf.c       Thu Dec  5 17:48:10 2002
***************
*** 90,108 ****
        {
                Relation        bufrel = 
RelationNodeCacheGetRelation(bufHdr->tag.rnode);

- /*
- * The relcache is not supposed to throw away temp rels, so
this
- * should always succeed.
- */
- Assert(bufrel != NULL);
-
/* flush this page */
! smgrwrite(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum,
! (char *) MAKE_PTR(bufHdr->data));
! LocalBufferFlushCount++;

! /* drop refcount incremented by RelationNodeCacheGetRelation
*/
! RelationDecrementReferenceCount(bufrel);
}

        /*
--- 90,113 ----
        {
                Relation        bufrel = 
RelationNodeCacheGetRelation(bufHdr->tag.rnode);

/* flush this page */
! if (bufrel == (Relation) NULL)
! {
! smgrblindwrt(DEFAULT_SMGR,
! bufHdr->tag.rnode,
! bufHdr->tag.blockNum,
! (char *)
MAKE_PTR(bufHdr->data));
! }
! else
! {
! smgrwrite(DEFAULT_SMGR, bufrel,
! bufHdr->tag.blockNum,
! (char *) MAKE_PTR(bufHdr->data));
! /* drop refcount incremented by
RelationNodeCacheGetRelation */
! RelationDecrementReferenceCount(bufrel);
! }

! LocalBufferFlushCount++;
}

/*

Regards,

Frank.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jie Liang (#1)
Re: server terminated by a query in 7.3

Jie Liang <jie@stbernard.com> writes:

however, after
I upgrade my postgresql from 7.2 to 7.3, one query always makes server
terminated, could
you give me a solution for it?

I cannot reproduce this with the information you gave.

regards, tom lane