Re: Assertion failure when autovacuum drops orphan temp indexes. - Mailing list pgsql-hackers

From Stepan Neretin
Subject Re: Assertion failure when autovacuum drops orphan temp indexes.
Date
Msg-id CAMaYL5Zxs8-Q7MEq3dcv3Px2z4s=SKGT=DM-LWZ3JpNtfzGaug@mail.gmail.com
Whole thread Raw
In response to Assertion failure when autovacuum drops orphan temp indexes.  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: Assertion failure when autovacuum drops orphan temp indexes.
List pgsql-hackers
> IMHO the best way to handle this is to just unconditionally push a snapshot
> in this code path instead of making assumptions about what callers will do.

Yes, I agree! I have found the same solution. I attempted to write Perl tests to verify the patch fix, but the autovacuum process is not triggered in my tests. Could you please assist me?

```
use strict;
use warnings;
use threads;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::RecursiveCopy;
use PostgreSQL::Test::Utils;
use Test::More;
use Data::Dumper;

my $node = PostgreSQL::Test::Cluster->new('main');

# Create a data directory with initdb
$node->init;

$node->append_conf(
'postgresql.conf', qq[
autovacuum = on
track_counts=on
autovacuum_naptime = 1s
autovacuum_max_workers = 1
autovacuum_vacuum_threshold = 1
]);

# Start the PostgreSQL server
$node->start;

my $psql1 = $node->interactive_psql('postgres');
$psql1->query("create temp table test (a int primary key);");

$node->stop('immediate');
$node->start();
sleep(5);

$node->restart();

ok(1);
done_testing();
```

Best Regards, Stepan Neretin!

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: heap_inplace_lock vs. autovacuum w/ LOCKTAG_TUPLE
Next
From: Alvaro Herrera
Date:
Subject: Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails