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

From MauMau
Subject Re: [RFC] Should smgrtruncate() avoid sending sinval message for temp relations
Date
Msg-id F1D425E156D3408F98F505EBBBA2FAF8@maumau
Whole thread Raw
In response to Re: [RFC] Should smgrtruncate() avoid sending sinval message for temp relations  ("MauMau" <maumau307@gmail.com>)
Responses Re: [RFC] Should smgrtruncate() avoid sending sinval message for temp relations  ("MauMau" <maumau307@gmail.com>)
List pgsql-hackers
From: "MauMau" <maumau307@gmail.com>
>> I'll try the fix tomorrow if possible.  What kind of problems do you hink
>> of for back-patching?
>
> I could reproduce the problem with 9.2.8, but have not yet with 9.5dev.
> I'll try with 9.2.9, and create the fix.

I could also reproduce the problem with 9.2.9, but I couldn't with 9.5devel.

However, I could confirm that the attached patch solves the problem.  The
patch is based on 9.2.9.  To adjust this patch for 9.3 and later, set the
background worker's SIGUSR2 handler to procsignal_sigusr2_handler like
normal backends.  Could you review and commit this?  We wish the fix for 9.1
and above.

To reproduce the problem, you can do as follows with the attached files.
Originally, test.sql had many columns the customer is actually using, but we
cannot show the real DDL as it's the customer's asset.

$ createdb test
$ pgbench -c 20 -j 20 -T 600 -s -n -f test.pgbench

Synchronous streaming replication and hot standby need to be used.

When I ran this on a 4-core RHEL5 box, the problem arose within a few
minutes.  pgbench continues to run emitting a lot of messages like below.
Over time, the number of normal backends will increases, and dozens of which
remain stuck with the stack trace I showed before.

CREATE TABLE
psql:test.sql:1: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit
index "test_table_pkey" for table "test_table"

I have no idea why 9.5devel didn't show the problem.  One difference I
noticed is that pgbench didn't output the message of implicit index creation
for the primary key.

Regards
MauMau

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: postgresql.auto.conf and reload
Next
From: Amit Kapila
Date:
Subject: Re: Use unique index for longer pathkeys.