From: | Stepan Neretin <sndcppg(at)gmail(dot)com> |
---|---|
To: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
Cc: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Assertion failure when autovacuum drops orphan temp indexes. |
Date: | 2024-10-26 19:12:48 |
Message-ID: | CAMaYL5Zxs8-Q7MEq3dcv3Px2z4s=SKGT=DM-LWZ3JpNtfzGaug@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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!
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2024-10-26 19:28:54 | Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails |
Previous Message | Noah Misch | 2024-10-26 18:49:36 | heap_inplace_lock vs. autovacuum w/ LOCKTAG_TUPLE |