[RFC] Should smgrtruncate() avoid sending sinval message for temp relations - Mailing list pgsql-hackers

From MauMau
Subject [RFC] Should smgrtruncate() avoid sending sinval message for temp relations
Date
Msg-id 5CF4ABBA67674088B3941894E22A0D25@maumau
Whole thread Raw
Responses Re: [RFC] Should smgrtruncate() avoid sending sinval message for temp relations  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello,

I'm investigating a mysterious hang problem on PostgreSQL 9.2.8.  If many 
sessions use temporary tables whose rows are deleted on commit, the hang 
occurs.  I'd like to show you the stack trace, but I'm trying to figure out 
how to reproduce the problem.  IIRC, the stack trace was as follows.  The 
standby server was running normally.

...
SyncRepWaitForLSN
CommitTransaction
CommitTransactionCommand
ProcessCatchupEvent
HandleCatchupInterrupt
procsignal_sigusr1_handler
<SIGUSR1 received>
recv
...
ReadCommand
PostgresMain
...


Looking at smgrtruncate(), the sinval message is sent even when the 
truncated relation is a temporary relation.  However, I think the sinval 
message is not necessary for temp relations, because each session doesn't 
see the temp relations of other sessions.  So, the following code seems 
better.  This avoids sinval queue overflow which leads to SIGUSR1.  Is this 
correct?

if (SmgrIsTemp(reln))   /* Do his on behalf of sinval message handler */   smgrclosenode(reln->smgr_rnode);
else   CacheInvalidateSmgr(reln->smgr_rnode);


Regards
MauMau




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Inconsistencies of service failure handling on Windows
Next
From: Tom Lane
Date:
Subject: Re: PDF builds broken again