BUG #15174: Postgresql 10.3 no response

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: gtm7(at)yandex(dot)ru
Subject: BUG #15174: Postgresql 10.3 no response
Date: 2018-04-25 17:30:40
Message-ID: 152467744024.19803.14441705421176060647@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15174
Logged by: Sergey Levin
Email address: gtm7(at)yandex(dot)ru
PostgreSQL version: 10.3
Operating system: Linux 3.0.101-77-ppc64
Description:

Hello!
In versions 10.3, an error was detected.
When performing parallel loading of data into a partitioned table (300
partitions), the PostgreSQL DBMS enters the "no response" state. No new
connections are possible.
All processes are waiting for the release of the semaphore.
pg_ready returning answer "no response"

OS version
Linux 3.0.101-77-ppc64 #1 SMP Tue Jun 14 20:33:58 UTC 2016 (a082ea6) ppc64
ppc64 ppc64 GNU/Linux
Postgresql version
PostgreSQL 10.3 on powerpc64-unknown-linux-gnu, compiled by gcc-5 (SUSE
Linux) 5.3.1 20160301 [gcc-5-branch revision 233849], 64-bit
Test case:
-- Create partition table
CREATE TABLE t(inv int NOT NULL,dt timestamp not null,data int) PARTITION BY
RANGE (inv);

-- Creation of the function of writing in a partitioned table
CREATE FUNCTION set_vl(c_inv integer, c_dt timestamp,c_data integer) RETURNS
integer
LANGUAGE plpgsql
AS $$
DECLARE
BEGIN
begin
insert into t(inv,dt,data) values(c_inv,c_dt,c_data);
exception
when unique_violation then
update t set data=data+1 where inv=c_inv and dt=c_data;
return 1;
end;
return 0;
END
$$;

PERL SCRIPT FOR TEST

#!/usr/bin/perl
use strict;
use DBI;
use Time::HiRes qw(gettimeofday tv_interval);
my $usr=$ENV{USER};
my $DSN = "DBI:Pg:dbname=$usr";
my $dbh1 = DBI->connect($DSN, '', '',
{AutoCommit=>1,RaiseError=>0,PrintError=>0})
or die "Connection failed par= $DSN !\n";

my $MAX_THREAD;
$MAX_THREAD=10;
my $thread_num;
my $ppid=$$;
my $MAX_SECTION=300;
my $k;
# create sections
for(my $i=1;$i<$MAX_SECTION;$i++)
{
$k=$i+1;
$dbh1->do("CREATE TABLE IF NOT EXISTS t_$i PARTITION OF t(CONSTRAINT pk_t_$i
PRIMARY KEY (inv, dt) ) FOR VALUES FROM ($i) TO ($k);") or die
$DBI::errstr;
}
$dbh1->disconnect();
for(my $i=1;$i<$MAX_THREAD;$i++)
{
$thread_num=$i;
my $child=fork();
if ($child==0)
{
print " Start child pid=$$ number thread=$i\n";
sleep(1);
last;
} elsif (undef $child) {
die print " fork not run\n";
} else {
print ;
}
}
if ($ppid==$$) {
while(1)
{
my $r=`pg_isready`;
print $r;
sleep 5;
}
exit;
}
#------------------------------ child thread
my $dbh = DBI->connect($DSN, '', '',
{AutoCommit=>0,RaiseError=>0,PrintError=>0})
or die "Connection failed parameters= $DSN !\n";
print "Thread $thread_num connect.\n";
$dbh->do("set application_name='Thread load $thread_num'") or die
$DBI::errstr;
while (1) {
my $start_time = [ gettimeofday ];
my $cnt=0;
for (my $k=0;$k<7000;$k++)
{
$dbh->do("select
set_vl($thread_num,clock_timestamp()::timestamp,0::integer);") or die
$DBI::errstr;
$cnt++;
}
$dbh->do("COMMIT WORK") or die $DBI::errstr;
my $end_time = [ gettimeofday ];
my $elapsed = tv_interval($start_time,$end_time);
print " Thread $thread_num load ".(1000*($elapsed/$cnt))." ms/rec
\n";
}

END PERL SCRIPT

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-04-25 19:01:27 BUG #15175: Stack Builder no descarga postgis 2.4
Previous Message PG Bug reporting form 2018-04-25 14:53:23 BUG #15173: why small gin_fuzzy_search_limit search more blocks than big gin_fuzzy_search_limit ?