Re: error context for vacuum to include block number - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: error context for vacuum to include block number
Date
Msg-id 20200219203821.GA10914@telsasoft.com
Whole thread Raw
In response to Re: error context for vacuum to include block number  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: error context for vacuum to include block number
List pgsql-hackers
Rebased on top of 007491979461ff10d487e1da9bcc87f2fd834f26

Also, I was thinking that lazy_scan_heap doesn't needs to do this:

+           /* Pop the error context stack while calling vacuum */
+           error_context_stack = errcallback.previous;
...
+           /* Set the error context while continuing heap scan */
+           error_context_stack = &errcallback;

It seems to me that's not actually necessary, since lazy_vacuum_heap will just
*push* a context handler onto the stack, and then pop it back off.  We don't
need to pop our context beforehand.  We also vacuum the FSM, and one might say
that we shouldn't report "...while scanning block number..." if it was
"vacuuming FSM" instead of "scanning heap", to which I would reply that either:
vacuuming FSM could be considered a part of scanning heap??  Or, maybe we
should add an additional callback for that, which is only not very nice since
we'd need to add a PROGRESS enum for which we don't actually report PROGRESS
(or stop using that enum).

I tested using variations on this that works as expected, that context is
correct during vacuum while scanning and after vacuum while scanning:

template1=# SET statement_timeout=0; SET maintenance_work_mem='1MB'; DROP TABLE tt; CREATE UNLOGGED TABLE tt(i int);
INSERTINTO tt SELECT generate_series(1,399999); CREATE INDEX ON tt(i); UPDATE tt SET i=i-1; SET statement_timeout=1222;
VACUUMVERBOSE tt;
 


Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Unicode normalization SQL functions
Next
From: Tom Lane
Date:
Subject: Re: Increase psql's password buffer size