Re: should frontend tools use syncfs() ?

2023-09-01 Thread Justin Pryzby
On Fri, Sep 01, 2023 at 11:08:51AM -0700, Nathan Bossart wrote: > > This should probably give a distinct error when syncfs is not supported > > than when it's truely recognized. > > Later versions of the patch should have this. Oops, right. > > The patch should handle pg_dumpall, too. > > It lo

pg16: XX000: could not find pathkey item to sort

2023-09-18 Thread Justin Pryzby
This fails since 1349d2790b commit 1349d2790bf48a4de072931c722f39337e72055e Author: David Rowley Date: Tue Aug 2 23:11:45 2022 +1200 Improve performance of ORDER BY / DISTINCT aggregates ts=# CREATE TABLE t (a int, b text) PARTITION BY RANGE (a); ts=# CREATE TABLE td PARTITION OF t DEFAUL

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2023-09-28 Thread Justin Pryzby
On Thu, Dec 14, 2017 at 07:18:59PM +0700, Ali Akbar wrote: > By the way, should i add this patch to the current commitfest? The patch for pg_upgrade --check got forgotten 6 years ago, but it's a continuing problem (we hit it again which cost an hour during pg_upgrade) and ought to be (have been) b

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2023-09-29 Thread Justin Pryzby
On Fri, Sep 29, 2023 at 09:16:35AM +0900, Michael Paquier wrote: > You mean when upgrading from an instance of 9.6 or older as c30f177 is > not there, right? No - while upgrading from v15 to v16. I'm not clear on how we upgraded *to* v15 without hitting the issue, nor how the "not null" got dropp

pg16: invalid page/page verification failed

2023-10-05 Thread Justin Pryzby
On an instance running pg16.0: log_time | 2023-10-05 10:03:00.014-05 backend_type | autovacuum worker left | page verification failed, calculated checksum 5074 but expected 5050 context | while scanning block 119 of relation "public.postgres_log_2023_10_05_0900"

Re: pg16: invalid page/page verification failed

2023-10-05 Thread Justin Pryzby
On Thu, Oct 05, 2023 at 07:16:31PM +0200, Matthias van de Meent wrote: > On Thu, 5 Oct 2023 at 18:48, Justin Pryzby wrote: > > > > On an instance running pg16.0: > > > > log_time | 2023-10-05 10:03:00.014-05 > > backend_type | autovacuum worker > &g

Re: pg16: invalid page/page verification failed

2023-10-06 Thread Justin Pryzby
On Fri, Oct 06, 2023 at 09:20:05AM +0900, Michael Paquier wrote: > On Thu, Oct 05, 2023 at 11:45:18AM -0500, Justin Pryzby wrote: > > This table is what it sounds like: a partition into which CSV logs are > > COPY'ed. It would've been created around 8am. There's no

Re: pg16: invalid page/page verification failed

2023-10-06 Thread Justin Pryzby
On Fri, Oct 06, 2023 at 08:47:39AM -0700, Andres Freund wrote: > Hi, > > On 2023-10-06 09:20:05 +0900, Michael Paquier wrote: > > On Thu, Oct 05, 2023 at 11:45:18AM -0500, Justin Pryzby wrote: > > > This table is what it sounds like: a partition into which CSV logs are >

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-09 Thread Justin Pryzby
> +++ b/src/backend/utils/misc/postgresql.conf.sample > +#autovacuum_vacuum_insert_threshold = 1000 # min number of row > inserts > + # before vacuum Similar to a previous comment [0] about reloptions or GUC: Can we say "threshold number of insertion

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-10 Thread Justin Pryzby
/20200308173103.GC1357%40telsasoft.com [2] https://www.postgresql.org/message-id/20191214224735.GA28433%40telsasoft.com >From 2c4b2c408490ecde3cfb4e336a78942f7a6f8197 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 27 Dec 2019 23:34:14 -0600 Subject: [PATCH v9 01/11] BUG: in errmsg Note ther

Re: backend type in log_line_prefix?

2020-03-10 Thread Justin Pryzby
On Thu, Feb 13, 2020 at 06:43:32PM +0900, Fujii Masao wrote: > If we do this, backend type should be also included in csvlog? +1, I've been missing that Note, this patch seems to correspond to: b025f32e0b Add leader_pid to pg_stat_activity I had mentioned privately to Julien missing this info in

Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction

2020-03-11 Thread Justin Pryzby
On Sun, Mar 08, 2020 at 03:40:09PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > On Sun, Mar 08, 2020 at 02:37:49PM -0400, Tom Lane wrote: > >> I guess we ought to change that function to use returns-a-tuplestore > >> protocol instead of thinking it can hold a

Re: backend type in log_line_prefix?

2020-03-11 Thread Justin Pryzby
On Tue, Mar 10, 2020 at 02:01:42PM -0500, Justin Pryzby wrote: > On Thu, Feb 13, 2020 at 06:43:32PM +0900, Fujii Masao wrote: > > If we do this, backend type should be also included in csvlog? > > +1, I've been missing that > > Note, this patch seems to correspond to: &

Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction

2020-03-12 Thread Justin Pryzby
On Sun, Mar 08, 2020 at 04:30:44PM -0400, Tom Lane wrote: > BTW, another thing I noticed while looking around is that some of > the functions using SRF_RETURN_DONE() think they should clean up > memory beforehand. This is a waste of code/cycles, as long as the > memory was properly allocated in fu

Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction

2020-03-12 Thread Justin Pryzby
s_dir.patch >From 43e7e5a9b679a4172808b248df2bc3365b6336e4 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Wed, 11 Mar 2020 10:09:18 -0500 Subject: [PATCH] SRF: avoid leaking resources if not run to completion Change to return a tuplestore populated immediately and returned in full. D

Re: Memory-Bounded Hash Aggregation

2020-03-12 Thread Justin Pryzby
On Wed, Mar 11, 2020 at 11:55:35PM -0700, Jeff Davis wrote: > * tweaked EXPLAIN output some more > Unless I (or someone else) finds something significant, this is close > to commit. Thanks for working on this ; I finally made a pass over the patch. +++ b/doc/src/sgml/config.sgml + enable_gr

Re: Additional size of hash table is alway zero for hash aggregates

2020-03-12 Thread Justin Pryzby
On Thu, Mar 12, 2020 at 12:16:26PM -0700, Andres Freund wrote: > On 2020-03-12 16:35:15 +0800, Pengzhou Tang wrote: > > When reading the grouping sets codes, I find that the additional size of > > the hash table for hash aggregates is always zero, this seems to be > > incorrect to me, attached a pa

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-03-12 Thread Justin Pryzby
Thanks for working on this. I have some minor comments. In 0005: + /* Restore the input path (we might have addes Sort on top). */ => added? There's at least two more of the same typo. + /* also ignore already sorted paths */ => Yo

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-13 Thread Justin Pryzby
On Wed, Mar 11, 2020 at 10:32:47AM +1300, David Rowley wrote: > 2. The new feature can be completely disabled. This might be very > useful for people who suffer from auto-vacuum starvation. On Thu, Mar 12, 2020 at 08:28:05PM +1300, David Rowley wrote: > Yes, but in particular so it can be complete

Re: make check crashes on POWER8 machine

2020-03-13 Thread Justin Pryzby
On Fri, Mar 13, 2020 at 10:29:13AM +0300, Victor Wagner wrote: > Hi, > > I've encountered a problem with Postgres on PowerPC machine. Sometimes Is it related to https://www.postgresql.org/message-id/20032.1570808731%40sss.pgh.pa.us https://bugzilla.kernel.org/show_bug.cgi?id=205183 (My initial r

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-13 Thread Justin Pryzby
Rs for this. On Tue, Mar 10, 2020 at 01:30:37PM -0500, Justin Pryzby wrote: > I took a step back, and I wondered whether we should add a generic function > for > listing a dir with metadata, possibly instead of changing the existing > functions. Then one could do pg_ls_dir_metadata(&#

Re: bitmaps and correlation

2020-03-13 Thread Justin Pryzby
There were no comments last month, so rebased, fixed tests, and kicked to next CF. -- Justin >From e754a93aff10cb435f5ecef923a810b9edc02d68 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Wed, 8 Jan 2020 19:23:51 -0600 Subject: [PATCH v5 1/2] Make more clear the computation of min/max

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-13 Thread Justin Pryzby
On Tue, Mar 10, 2020 at 01:53:42PM +1300, David Rowley wrote: > 2. Perhaps the documentation in maintenance.sgml should mention that > the table will be vacuumed with the equivalent of having > vacuum_freeze_min_age = 0, instead of: > > "Such a vacuum will aggressively freeze tuples." > > aggress

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-13 Thread Justin Pryzby
On Fri, Mar 13, 2020 at 02:38:51PM -0700, Andres Freund wrote: > > |One disadvantage of decreasing vacuum_freeze_min_age is that it might cause > > |VACUUM to do useless work: freezing a row version is a waste of time if > > the row > > |is modified soon thereafter (causing it to acquire a new XID

Re: backend type in log_line_prefix?

2020-03-14 Thread Justin Pryzby
On Fri, Feb 21, 2020 at 10:09:38AM +0100, Peter Eisentraut wrote: > From 75ac8ed0c47801712eb2aa300d9cb29767d2e121 Mon Sep 17 00:00:00 2001 > From: Peter Eisentraut > Date: Thu, 20 Feb 2020 18:16:39 +0100 > Subject: [PATCH v2 3/4] Add backend type to csvlog and optionally > log_line_prefix > diff

Re: backend type in log_line_prefix?

2020-03-15 Thread Justin Pryzby
r",17030 As for my question "what's using/trying/failing to use parallel workers", I was able to look into that by parsing "Workers Planned/Launched" from autoexplain. It's not a *good* way to do it, but I don't see how to do better and I don't see

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-15 Thread Justin Pryzby
On Fri, Mar 13, 2020 at 02:38:51PM -0700, Andres Freund wrote: > > Having now played with the patch, I'll suggest that 1000 is too high a > > threshold. If autovacuum runs without FREEZE, I don't see why it couldn't > > be > > much lower (10?) or use (0.2 * n_ins + 50) like the other auto

expose parallel leader in CSV and log_line_prefix

2020-03-15 Thread Justin Pryzby
rom: Justin Pryzby Date: Fri, 13 Mar 2020 22:03:06 -0500 Subject: [PATCH v2] Include the leader PID in logfile See also: b025f32e0b, which adds the leader PID to pg_stat_activity --- doc/src/sgml/config.sgml | 11 +- src/backend/utils/error/elog.c|

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-15 Thread Justin Pryzby
ir(). > > I'm unsure why it is done at this stage. I think it makes sense to allow ls_logdir to succeed even if ./log doesn't exist, since it isn't created by initdb or during postmaster start, and since we already using MISSING_OK for tmpdir. But a separate patch since

Re: Expose lock group leader pid in pg_stat_activity

2020-03-15 Thread Justin Pryzby
On Tue, Jan 28, 2020 at 12:36:41PM +0100, Julien Rouhaud wrote: > So, AFAICT the LockHashPartitionLockByProc is required when > iterating/modifying lockGroupMembers or lockGroupLink, but just > getting the leader pid should be safe. This still seems unsafe: git show -U11 -w --patience b025f32e0b

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-15 Thread Justin Pryzby
On Fri, Mar 13, 2020 at 10:48:27PM +0100, Laurenz Albe wrote: > On Fri, 2020-03-13 at 13:44 -0500, Justin Pryzby wrote: > > Possible it would be better to run VACUUM *without* freeze_min_age=0 ? (I > > get > > confused and have to spend 20min re-reading the vacuum GUC docs

Re: Expose lock group leader pid in pg_stat_activity

2020-03-15 Thread Justin Pryzby
On Sun, Mar 15, 2020 at 11:27:52PM -0500, Justin Pryzby wrote: > On Tue, Jan 28, 2020 at 12:36:41PM +0100, Julien Rouhaud wrote: > > So, AFAICT the LockHashPartitionLockByProc is required when > > iterating/modifying lockGroupMembers or lockGroupLink, but just > > getting the

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-16 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 12:53:43PM +0900, Masahiko Sawada wrote: > There is already a consensus on introducing new 2 parameters, but as > the second idea I'd like to add one (or two) GUC(s) to my suggestion, > say autovacuum_vacuum_freeze_insert_ratio; this parameter is the ratio > of the number o

Re: ALTER tbl rewrite loses CLUSTER ON index

2020-03-16 Thread Justin Pryzby
might be just as useful for some of these callers. -- Justin >From add5e8481c70b6b66342b264a243f26f4c634e53 Mon Sep 17 00:00:00 2001 From: Amit Langote Date: Mon, 16 Mar 2020 16:01:42 +0900 Subject: [PATCH v7 1/2] ALTER tbl rewrite loses CLUSTER ON index On Fri, Mar 13, 2020 at 2:19 AM Tom Lane wrote: > Justin Pryzby w

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-16 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 04:20:21PM +0100, Fabien COELHO wrote: > > About v11, ISTM that the recursive function should check for symbolic links > and possibly avoid them: > > sh> cd data/base > sh> ln -s .. foo > > psql> SELECT * FROM pg_ls_dir_recurse('.'); > ERROR: could not stat file > "

Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction

2020-03-16 Thread Justin Pryzby
On Thu, Mar 12, 2020 at 07:11:56AM -0500, Justin Pryzby wrote: > > Do you want to have a go at that? > > First draft attached. Note that I handled pg_ls_dir, even though I'm > proposing > on the other thread to collapse/merge/meld it with pg_ls_dir_files [0]. > Possi

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-16 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 08:49:43PM +0100, Laurenz Albe wrote: > On Mon, 2020-03-16 at 07:47 -0500, Justin Pryzby wrote: > > It seems to me that the easy thing to do is to implement this initially > > without > > FREEZE (which is controlled by vacuum_freeze_table_age), and def

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-16 Thread Justin Pryzby
d ones. -- Justin >From 1bb8e0efb4f14fa344cd5ee66c3138184a9fa9e2 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 6 Mar 2020 16:50:07 -0600 Subject: [PATCH v12 01/11] Document historic behavior about hiding directories and special files Should backpatch to v10: tmpdir, waldir and ar

Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction

2020-03-16 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 09:38:50PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > v2 attached - I will add to next CF in case you want to defer it until > > later. > > Thanks, reviewed and pushed. Since this is a bug fix (at least in part) > I didn't want t

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-16 Thread Justin Pryzby
dir. So changed to use lstat ... and squished. -- Justin >From d8294c4747c5ba1f3bec858c137cc2d31e5a0425 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Mon, 16 Mar 2020 14:12:55 -0500 Subject: [PATCH v13 1/8] Document historic behavior of links to directories.. Backpatch to 9.5: pg_stat_file

Re: error context for vacuum to include block number

2020-03-16 Thread Justin Pryzby
On Tue, Mar 03, 2020 at 10:05:42PM +0900, Masahiko Sawada wrote: > I was concerned about fsm vacuum; vacuum error context might show heap > scan while actually doing fsm vacuum. But perhaps we can update > callback args for that. That would be helpful for user to distinguish > that the problem seem

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 01:14:02AM +0100, Laurenz Albe wrote: > lazy_check_needs_freeze() is only called for an aggressive vacuum, which > this isn't. > --- a/src/backend/access/heap/vacuumlazy.c > +++ b/src/backend/access/heap/vacuumlazy.c > @@ -1388,17 +1388,26 @@ lazy_scan_heap(Relation onerel,

Re: ALTER tbl rewrite loses CLUSTER ON index

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 02:33:32PM +0900, Michael Paquier wrote: > > Yeah, in cluster(), mark_index_clustered(). > > Patch 0002 from Justin does that, I would keep this refactoring as > HEAD-only material though, and I don't spot any other code paths in > need of patching. > > The commit message

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-17 Thread Justin Pryzby
file? Can it be easily extended to work on a simple file? If so, > it could be just "pg_ls". I think that's a good idea, except it doesn't fit with what the code does: AllocDir() and ReadDir(). Instead, use pg_stat_file() for that. Hm, I realized that the existing pg_ls_di

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 08:42:07PM +0100, Laurenz Albe wrote: > Also, since aggressive^H^H^H^H^H^H^H^H^H^Hproactive freezing seems to be a > performance problem in some cases (pages with UPDATEs and DELETEs in otherwise > INSERT-mostly tables), I have done away with the whole freezing thing, > whic

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 10:01:15PM +0100, Laurenz Albe wrote: > On Tue, 2020-03-17 at 14:56 -0500, Justin Pryzby wrote: > > I still suggest scale_factor maximum of 1e10, like > > 4d54543efa5eb074ead4d0fadb2af4161c943044 > > > > Which alows more effectively disabling it

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 10:22:44PM +0100, Laurenz Albe wrote: > On Tue, 2020-03-17 at 16:07 -0500, Justin Pryzby wrote: > > > Assume a scale factor >= 1, for example 2, and n live tuples. > > > The table has just been vacuumed. > > > > > > Now we insert

Re: Auxiliary Processes and MyAuxProc

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 02:50:19PM -0400, Mike Palmiotto wrote: > The patchset is now split out. I've just noticed that Peter Eisentraut > included some changes for a generic MyBackendType, which I should have > been aware of. I was unable to rebase due to these changes, but can > fold these patche

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 07:47:13AM -0500, Justin Pryzby wrote: > Normally, when someone complains about bad plan related to no index-onlyscan, > we tell them to run vacuum, and if that helps, then ALTER TABLE .. SET > (autovacuum_vacuum_scale_factor=0.005). > > If there's tw

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 09:58:53PM -0400, James Coleman wrote: > On Tue, Mar 17, 2020 at 9:03 PM Andres Freund wrote: > > > > On 2020-03-17 20:42:07 +0100, Laurenz Albe wrote: > > > > I think Andres was thinking this would maybe be an optimization > > > > independent of > > > > is_insert_only (?)

Re: control max length of parameter values logged

2020-03-17 Thread Justin Pryzby
On Sun, Mar 15, 2020 at 08:48:33PM -0300, Alvaro Herrera wrote: > On 2020-Mar-14, Tom Lane wrote: > > > Bruce Momjian writes: > > > I am sorry --- I am confused. Why are we truncating or allowing control > > > of truncation of BIND parameter values, but have no such facility for > > > queries.

Re: Auxiliary Processes and MyAuxProc

2020-03-18 Thread Justin Pryzby
On Wed, Mar 18, 2020 at 09:22:58AM -0400, Mike Palmiotto wrote: > On Tue, Mar 17, 2020 at 9:04 PM Alvaro Herrera > wrote: > > > > On 2020-Mar-17, Justin Pryzby wrote: > > > > > +static PgSubprocess process_types[] = { > > > +

Re: Autovacuum on partitioned table (autoanalyze)

2020-03-18 Thread Justin Pryzby
Regarding this patch: +* the ANALYZE message as it resets the partition's changes_since_analze => analyze +* If the relation is a partitioned table, we must add up children's childrens' The approach in general: I see an issue for timeseries data, where only the most recent parti

Re: expose parallel leader in CSV and log_line_prefix

2020-03-18 Thread Justin Pryzby
On Sun, Mar 15, 2020 at 12:49:33PM +0100, Julien Rouhaud wrote: > On Sun, Mar 15, 2020 at 06:18:31AM -0500, Justin Pryzby wrote: > > See also: > > https://commitfest.postgresql.org/27/2390/ > > https://www.postgresql.org/message-id/flat/caobau_yy5bt0vtpz2_lum6cucg

Re: error context for vacuum to include block number

2020-03-18 Thread Justin Pryzby
in setting/resetting the > > phase information correctly so that it doesn't display the wrong info > > in the context in an error message. > > Justin, are you planning to work on the pending comments? If you > want, I can try to fix some of these. We have less time

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-18 Thread Justin Pryzby
On Fri, Mar 13, 2020 at 02:38:51PM -0700, Andres Freund wrote: > On 2020-03-13 13:44:42 -0500, Justin Pryzby wrote: > > Having now played with the patch, I'll suggest that 1000 is too high a > > threshold. If autovacuum runs without FREEZE, I don't see why it couldn

Re: Memory-Bounded Hash Aggregation

2020-03-18 Thread Justin Pryzby
On Sun, Mar 15, 2020 at 04:05:37PM -0700, Jeff Davis wrote: > > + if (from_tape) > > + partition_mem += HASHAGG_READ_BUFFER_SIZE; > > + partition_mem = npartitions * HASHAGG_WRITE_BUFFER_SIZE; > > > > => That looks wrong ; should say += ? > > Good catch! Fixed. > +++ b/src/backend/

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-19 Thread Justin Pryzby
On Thu, Mar 19, 2020 at 09:52:11PM +1300, David Rowley wrote: > On Thu, 19 Mar 2020 at 19:07, Justin Pryzby wrote: > > > > On Fri, Mar 13, 2020 at 02:38:51PM -0700, Andres Freund wrote: > > > On 2020-03-13 13:44:42 -0500, Justin Pryzby wrote: > > > > Having now

Re: error context for vacuum to include block number

2020-03-19 Thread Justin Pryzby
if we do actually "reset" the cbarg, which is in the two routines handling indexes. It's probably a good idea to pass the indname rather than the relation in any case. I rebased the rest of my patches on top of yours. -- Justin >From a1ef4498cf93a9971be5c1683ceb62879ab9b

Re: error context for vacuum to include block number

2020-03-19 Thread Justin Pryzby
On Thu, Mar 19, 2020 at 03:29:31PM -0500, Justin Pryzby wrote: > I was going to suggest that we could do that by passing in a pointer to a > local > variable "LVRelStats olderrcbarg", like: > |update_vacuum_error_cbarg(vacrelstats, VACUUM

Re: improve transparency of bitmap-only heap scans

2020-03-19 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 09:08:36AM -0400, James Coleman wrote: > Does the original optimization cover parallel bitmap heap scans like this? It works for parallel bitmap only scans. template1=# explain analyze select count(*) from exp where a between 25 and 35 and d between 5 and 10; Finalize Ag

Re: error context for vacuum to include block number

2020-03-19 Thread Justin Pryzby
On Fri, Mar 20, 2020 at 11:24:25AM +0530, Amit Kapila wrote: > On Fri, Mar 20, 2020 at 5:59 AM Justin Pryzby wrote: > That makes sense. I have a few more comments: > > 1. > + VACUUM_ERRCB_PHASE_INDEX_CLEANUP, > +} errcb_phase; > > Why do you need a comma after the l

Re: explain HashAggregate to report bucket and memory stats

2020-03-20 Thread Justin Pryzby
99 loops=1) | Buckets: 262144 Batches: 1 Memory Usage: 9080kB | -> Seq Scan on t b (cost=0.00..3769.99 rows=19 width=4) (actual time=3.273..40.163 rows=19 loops=1) -- Justin >From e593c119c97ea31edac4c9f08a39eee451964a16 Mon Sep 17 00:00:00 2001 From:

Re: error context for vacuum to include block number

2020-03-20 Thread Justin Pryzby
On Fri, Mar 20, 2020 at 04:58:08PM +0530, Amit Kapila wrote: > See, how the attached looks? I have written a commit message as well, > see if I have missed anyone is from the credit list? Thanks for looking again. Couple tweaks: +/* Phases of vacuum during which an error can occur. */ Can you

Re: Add A Glossary

2020-03-20 Thread Justin Pryzby
On Thu, Mar 19, 2020 at 09:11:22PM -0300, Alvaro Herrera wrote: > +Aggregate > + > + > + To combine a collection of data values into a single value, whose > + value may not be of the same type as the original values. > + Aggregate Functions > + combine multiple Rows

Re: Add A Glossary

2020-03-20 Thread Justin Pryzby
On Fri, Mar 20, 2020 at 11:32:25PM +0100, Jürgen Purtz wrote: > > > + > > > +File Segment > > > + > > > + > > > + If a heap or index file grows in size over 1 GB, it will be split > > 1GB is the default "segment size", which you should define. > > ??? "A <> or other >>Relati

Re: Why does [auto-]vacuum delay not report a wait event?

2020-03-20 Thread Justin Pryzby
8/2515/ -- Justin >From 68c5ad8c7a9feb0c68afad310e3f52c21c3cdbaf Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 20 Mar 2020 20:47:30 -0500 Subject: [PATCH v1 1/2] Report wait event for cost-based vacuum delay --- doc/src/sgml/monitoring.sgml| 2 ++ src/backend/commands/vacuum.c

Re: error context for vacuum to include block number

2020-03-21 Thread Justin Pryzby
On Sat, Mar 21, 2020 at 01:00:03PM +0530, Amit Kapila wrote: > I have addressed your comments in the attached patch. Today, while > testing error messages from various phases, I noticed that the patch > fails to display error context if the error occurs during the truncate > phase. The reason was

Re: Add A Glossary

2020-03-21 Thread Justin Pryzby
On Sat, Mar 21, 2020 at 03:08:30PM +0100, Jürgen Purtz wrote: > On 21.03.20 00:03, Justin Pryzby wrote: > > > > > + > > > > > +Host > > > > > + > > > > > + > > > > > + See Server. > > >

doc review for parallel vacuum

2020-03-21 Thread Justin Pryzby
llel vacuum is +* based on the number of indexes. -1 indicates parallel vacuum is * disabled. */ int nworkers; -- 2.17.0 >From aec387f1c5e405d504ade077a20db7b6ff6c3835 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 19 Jan 2020 22:3

Re: kill_prior_tuple and index scan costing

2020-03-21 Thread Justin Pryzby
On Sat, Mar 21, 2020 at 07:33:02PM -0700, Andres Freund wrote: > While your recent btree work ensures that we get the heap tids for an > equality lookup in heap order (right?), I think when I tested the TID tiebreaker patch, it didn't help for our case, which is for inequality: (timestamptz >= sta

Re: Why does [auto-]vacuum delay not report a wait event?

2020-03-22 Thread Justin Pryzby
On Sat, Mar 21, 2020 at 05:24:57PM -0700, Andres Freund wrote: > > Also, I noticed that SLEEP_ON_ASSERT comment (31338352b) wants to use > > pg_usleep > > "which seems too short.". Surely it should use pg_sleep, added at > > 782eefc58 a > > few years later ? > > I don't see problem with using s

Re: Database recovery from tablespace only

2020-03-22 Thread Justin Pryzby
On Sat, Mar 21, 2020 at 05:48:03PM -0600, Phillip Black wrote: > Hey Hackers, Hi, This list is for development and bug reports. I think you'll want a professional support contract, for postgres or for generic data recovery. https://www.postgresql.org/support/professional_support/ -- Justin

Re: error context for vacuum to include block number

2020-03-23 Thread Justin Pryzby
On Mon, Mar 23, 2020 at 04:39:54PM +0900, Masahiko Sawada wrote: > I've already commented on earlier patch but I personally think we'd be > better to report freespace map vacuum as a separate phase. The > progress report of vacuum command is used to know the progress but > this error context would

Re: RFC: Add 'taint' field to pg_control.

2020-03-23 Thread Justin Pryzby
On Wed, Feb 28, 2018 at 04:16:53PM -0600, Justin Pryzby wrote: > On Wed, Feb 28, 2018 at 01:43:11PM -0800, Andres Freund wrote: > > a significant number of times during investigations of bugs I wondered > > whether running the cluster with various settings, or various tools > >

Re: ALTER INDEX fails on partitioned index

2020-03-23 Thread Justin Pryzby
On Thu, Feb 27, 2020 at 09:11:14PM -0300, Alvaro Herrera wrote: > On 2020-Feb-27, Justin Pryzby wrote: > > The attached allows CREATE/ALTER to specify reloptions on a partitioned > > table > > which are used as defaults for future children. > > > > I think tha

Re: error context for vacuum to include block number

2020-03-23 Thread Justin Pryzby
On Mon, Mar 23, 2020 at 02:25:14PM +0530, Amit Kapila wrote: > > Yea, and it would be misleading if we reported "while scanning block..of > > relation" if we actually failed while writing its FSM. > > > > My previous patches did this: > > > > + case VACUUM_ERRCB_PHASE_VACUUM_FSM: > >

Re: improve transparency of bitmap-only heap scans

2020-03-23 Thread Justin Pryzby
On Tue, Mar 24, 2020 at 10:54:05AM +0530, Amit Kapila wrote: > On Fri, Mar 20, 2020 at 7:09 AM James Coleman wrote: > > > > Awesome, thanks for confirming with an actual plan. > > > > > I don't think it matters in nontext mode, but at least in text mode, I > > > think > > > maybe the Unfetched bl

Re: weird hash plan cost, starting with pg10

2020-03-23 Thread Justin Pryzby
On Mon, Mar 23, 2020 at 01:50:59PM -0300, Alvaro Herrera wrote: > While messing with EXPLAIN on a query emitted by pg_dump, I noticed that > current Postgres 10 emits weird bucket/batch/memory values for certain > hash nodes: > > -> Hash (cost=0.11..0.11 rows=10 width=12

Re: error context for vacuum to include block number

2020-03-24 Thread Justin Pryzby
On Tue, Mar 24, 2020 at 07:07:03PM +0530, Amit Kapila wrote: > On Tue, Mar 24, 2020 at 6:18 PM Masahiko Sawada > wrote: > > 1. > > +/* Update error traceback information */ > > +olderrcbarg = *vacrelstats; > > +update_vacuum_error_cbarg(vacrelstats, > > +

Re: error context for vacuum to include block number

2020-03-24 Thread Justin Pryzby
- Justin >From 26c57039135896ebf29b96c172d35d869ed1ce69 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Thu, 12 Dec 2019 20:54:37 -0600 Subject: [PATCH v32 1/3] Introduce vacuum errcontext to display additional information. The additional information displayed will be block number for error occ

Re: error context for vacuum to include block number

2020-03-24 Thread Justin Pryzby
On Wed, Mar 25, 2020 at 01:34:43PM +0900, Masahiko Sawada wrote: > I meant that with the patch, suppose that the table has 100 blocks and > we're truncating it to 50 blocks in RelationTruncate(), the error > context message will be "while truncating relation "aaa.bbb" to 100 > blocks", which is not

Re: error context for vacuum to include block number

2020-03-24 Thread Justin Pryzby
On Wed, Mar 25, 2020 at 10:22:21AM +0530, Amit Kapila wrote: > On Wed, Mar 25, 2020 at 10:05 AM Masahiko Sawada > wrote: > > > > On Wed, 25 Mar 2020 at 12:44, Amit Kapila wrote: > > > > > > On Tue, Mar 24, 2020 at 7:51 PM Masahiko Sawada > > > wrote: > > > > > > > > > > > > I got the point. But

Re: error context for vacuum to include block number

2020-03-25 Thread Justin Pryzby
ats->nonempty_pages instead of > > > new_rel_pages to indicate the remaining pages after truncation? > > > > Yea, I think that addresses the issue. Attached patch addressing these. -- Justin >From b3e112c3d02982b4c050a43c53e47a868879c561 Mon Sep 17 00:00:00 2001 From: J

Re: error context for vacuum to include block number

2020-03-25 Thread Justin Pryzby
On Wed, Mar 25, 2020 at 04:54:41PM +0530, Amit Kapila wrote: > On Wed, Mar 25, 2020 at 3:42 PM Justin Pryzby wrote: > > > > Attached patch addressing these. > > > > Thanks, you forgot to remove the below declaration which I have > removed in attached. Yes I saw..

Re: error context for vacuum to include block number

2020-03-25 Thread Justin Pryzby
On Wed, Mar 25, 2020 at 09:27:44PM +0900, Masahiko Sawada wrote: > On Wed, 25 Mar 2020 at 20:24, Amit Kapila wrote: > > > > On Wed, Mar 25, 2020 at 3:42 PM Justin Pryzby wrote: > > > > > > Attached patch addressing these. > > > > > > > Than

Re: pg_upgrade fails with non-standard ACL

2020-03-25 Thread Justin Pryzby
On Wed, Mar 25, 2020 at 11:12:05AM +0900, Artur Zakirov wrote: > Hello David, > > On 3/25/2020 2:08 AM, David Steele wrote: > > On 12/17/19 3:10 AM, Arthur Zakirov wrote: > > > > > > I attached new version of the patch. It still uses > > > pg_identify_object(), I'm not sure about other ways to bu

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-25 Thread Justin Pryzby
On Mon, Mar 23, 2020 at 02:27:29PM +0100, Laurenz Albe wrote: > Here is version 10 of the patch, which uses a scale factor of 0.2. Thanks > Any table that has received more inserts since it was > last vacuumed (and that is not vacuumed for another > reason) will be autovacuumed. Since this vacuu

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-25 Thread Justin Pryzby
On Wed, Mar 25, 2020 at 12:46:52PM -0300, Alvaro Herrera wrote: > On 2020-Mar-25, Justin Pryzby wrote: > > > Maybe in the docs you can write this with thousands separators: 10,000,000 > > > > It looks like the GUC uses scale factor max=1e10, but the relopt is still >

Re: Allow continuations in "pg_hba.conf" files

2020-03-25 Thread Justin Pryzby
Hi, On Wed, Mar 25, 2020 at 07:09:38PM +0100, Fabien COELHO wrote: > > Hello, > > After writing an unreadable and stupidly long line for ldap authentification > in a "pg_hba.conf" file, I figured out that allowing continuations looked > simple enough and should just be done. I tried this briefl

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-03-25 Thread Justin Pryzby
On Thu, Mar 12, 2020 at 08:08:46PM +0300, Alexey Kondratov wrote: > On 09.03.2020 23:04, Justin Pryzby wrote: >> On Sat, Feb 29, 2020 at 08:53:04AM -0600, Justin Pryzby wrote: >>> On Sat, Feb 29, 2020 at 03:35:27PM +0300, Alexey Kondratov wrote: >>> tests for th

Re: error context for vacuum to include block number

2020-03-25 Thread Justin Pryzby
On Thu, Mar 26, 2020 at 09:50:53AM +0530, Amit Kapila wrote: > > > after count_nondeletable_pages, and then revert it back to > > > VACUUM_ERRCB_PHASE_SCAN_HEAP phase and the number of blocks of > > > relation before truncation, after RelationTruncate(). It can be > > > repeated until no more trunc

Re: error context for vacuum to include block number

2020-03-26 Thread Justin Pryzby
On Thu, Mar 26, 2020 at 08:56:54PM +0900, Masahiko Sawada wrote: > 1. > @@ -1844,9 +1914,15 @@ lazy_vacuum_page(Relation onerel, BlockNumber > blkno, Buffer buffer, > int uncnt = 0; > TransactionId visibility_cutoff_xid; > boolall_frozen; > + LVRelStats olderrcbarg; >

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-03-26 Thread Justin Pryzby
> I included your new solution regarding this part from 0004 into 0001. It > seems that at least a tip of the problem was in that we tried to change > tablespace to pg_default being already there. Right, causing it to try to drop that filenode twice. > +++ b/doc/src/sgml/ref/cluster.sgml > +

Re: error context for vacuum to include block number

2020-03-26 Thread Justin Pryzby
On Thu, Mar 26, 2020 at 10:04:57AM -0500, Justin Pryzby wrote: > Does that address your comment ? I hope so. > > I'm not sure why "free_oldindname" is necessary. Since we initialize > > vacrelstats->indname with NULL and revert the callback arguments at > >

Re: error context for vacuum to include block number

2020-03-26 Thread Justin Pryzby
;t we use "info" > or "state" or something similar, less infectious, instead? I renamed it since it was kind of opaque looking. It's in all the same places, so equally infectious; but I hope you like it better. Cheers, -- Justin >From 4d33dc1c125690b48dc0028c63a

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-03-26 Thread Justin Pryzby
> Another issue is this: > > +VACUUM ( FULL [, ...] ) [ TABLESPACE > class="parameter">new_tablespace ] [ > class="parameter">table_and_columns [, ...] ] > As you mentioned in your v1 patch, in the other cases, "tablespace > [tablespace]" is added at the end of the command rather than in the midd

Re: error context for vacuum to include block number

2020-03-26 Thread Justin Pryzby
On Fri, Mar 27, 2020 at 09:49:29AM +0530, Amit Kapila wrote: > On Fri, Mar 27, 2020 at 3:47 AM Justin Pryzby wrote: > > > > > Hm, I was just wondering what happens if an error happens *during* > > > update_vacuum_error_cbarg(). It seems like if we set > > >

Re: error context for vacuum to include block number

2020-03-26 Thread Justin Pryzby
On Thu, Mar 26, 2020 at 11:44:24PM -0500, Justin Pryzby wrote: > On Fri, Mar 27, 2020 at 09:49:29AM +0530, Amit Kapila wrote: > > On Fri, Mar 27, 2020 at 3:47 AM Justin Pryzby wrote: > > > > > > > Hm, I was just wondering what happens if an error happens *during* >

Re: error context for vacuum to include block number

2020-03-27 Thread Justin Pryzby
On Fri, Mar 27, 2020 at 11:50:30AM +0530, Amit Kapila wrote: > > > The crash scenario I'm trying to avoid would be like statement_timeout or > > > other > > > asynchronous event occurring between two non-atomic operations. > > > > > +if (errinfo->phase==VACUUM_ERRCB_PHASE_VACUUM_INDEX && > > erri

<    8   9   10   11   12   13   14   15   16   17   >