Re: pg_verify_checksums -d option (was: Re: pg_verify_checksums -roption)

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема Re: pg_verify_checksums -d option (was: Re: pg_verify_checksums -roption)
Дата
Msg-id 20180829203343.26f78b943df7e7132431df5a@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: pg_verify_checksums -d option (was: Re: pg_verify_checksums -roption)  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: pg_verify_checksums -d option (was: Re: pg_verify_checksums -roption)
Список pgsql-hackers
On Wed, 29 Aug 2018 10:28:33 +0200
Daniel Gustafsson <daniel@yesql.se> wrote:

> > On 27 Aug 2018, at 14:05, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > 
> > On Mon, 27 Aug 2018 13:34:12 +0200
> > Michael Banck <michael.banck@credativ.de> wrote:
> > 
> >> Hi,
> >> 
> >> On Mon, Aug 27, 2018 at 07:53:36PM +0900, Yugo Nagata wrote:
> >>> On Fri, 24 Aug 2018 18:01:09 +0200
> >>> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
> >>>> I'm curious about this option:
> >>>> 
> >>>>  -r RELFILENODE         check only relation with specified relfilenode
> >>>> 
> >>>> but there is no facility to specify a database.
> >>>> 
> >>>> Also, referring to the relfilenode of a mapped relation seems a bit
> >>>> inaccurate.
> >>>> 
> >>>> Maybe reframing this in terms of the file name of the file you want
> >>>> checked would be better?
> >>> 
> >>> If we specified 1234 to -r option, pg_verify_shceksums checks not only 1234
> >>> but also 1234_vm, 1234_fsm, and 1234.1, 1234.2, ... and so on, so I think
> >>> it makes senses to allow to specify a relfilenode instead of a file name.
> >>> 
> >>> I think it is reasonable to add a option to specify a database, although
> >>> I don't know which character is good because both -d and -D are already used....
> >> 
> >> Maybe the -d (debug) option should be revisited as well. Mentioning
> >> every scanned block generates a huge amount of output which might be
> >> useful during development but does not seem very useful for a stable
> >> release. AFAICT there is no other debug output for now.
> >> 
> >> So it could be renamed to -v (verbose) and only mention each scanned
> >> file, e.g. (errors/checksum mismatches are still reported of course).
> >> 
> >> Then -d could (in the future, I guess that is too late for v11) be used
> >> for -d/--dbname (or make that only a long option, if the above does not
> >> work).
> > 
> > I realized after sending the previous post that we can not specify a database
> > by name because pg_verify_checksum is run in offline and this can not get the
> > OID from the database name.  Also, there are global and pg_tblspc directories
> > not only base/<database OID>. So, it seems to me good to specify a directories
> > to scan which is under PGDATA. We would be able to use -d ( or --directory ?)
> > for this purpose.
> 
> Changing functionality to the above discussed is obviously 12 material, but
> since we are discussing changing the command line API of the tool by
> repurposing -d; do we want to rename the current use of -d to -v (with the
> accompanying ―-verbose) before 11 ships?  It’s clearly way way too late in the
> cycle but it seems worth to at least bring up since 11 will be the first
> version pg_verify_checksums ship in. I’m happy to do the work asap if so.

I agree with this.  Almost other commands doesn't use -d as debug mode
although there a few exception, and instead -v is used for verbose mode.
If we can change the command line of pg_veriry_checksums, before release of
PG 11 is best.  Attached is the patch to do this.

Regards,
-- 
Yugo Nagata <nagata@sraoss.co.jp>

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pg_verify_checksums vs windows
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_verify_checksums vs windows