pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17149: About --skip option of pg_amcheck command
4+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2021-08-18 500256d953 5310c61ecc  Fix pg_amcheck --skip option parameter handling
* BUG #17149: About --skip option of pg_amcheck command
@ 2021-08-17 04:36 PG Bug reporting form <noreply@postgresql.org>
  2021-08-17 07:54 ` Re: BUG #17149: About --skip option of pg_amcheck command Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2021-08-17 04:36 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: chenjq.jy@fujitsu.com

The following bug has been logged on the website:

Bug reference:      17149
Logged by:          Chen Jiaoqian
Email address:      chenjq.jy@fujitsu.com
PostgreSQL version: 14beta3
Operating system:   Red Hat Enterprise Linux Server release 7.8
Description:        

Hi, Author

    In PG14 beta3, when I use pg_amcheck command and specify the value of
the option --skip as "none", "all-visible" or "all-frozen", an error
occurs.
    The official website is described as follows:
    > --skip=option
    >   If all-frozen is given, table corruption checks will skip over pages
in all tables that are marked as all frozen.
    >   If all-visible is given, table corruption checks will skip over
pages in all tables that are marked as all visible.
    >   By default, no pages are skipped. This can be specified as none, but
since this is the default, it need not be mentioned.
    
    When I specify the "none" value for --skip option, the following error
occurs:
        [postgres14@localhost ~]$ pg_amcheck -p 51403 -d postgres -t tb01
--skip=none
        pg_amcheck: error: invalid argument for option --skip
        [postgres14@localhost ~]$

    When I specify the "all-visible" or "all-frozen" value for --skip
option, take "all-visible" as an example, the following error occurs:
        [postgres14@localhost ~]$ pg_amcheck -p 51403 -d postgres -t tb01
--skip=all-visible
        2021-08-16 04:59:04.571 EDT [4689] ERROR:  invalid skip option
        2021-08-16 04:59:04.571 EDT [4689] HINT:  Valid skip options are
"all-visible", "all-frozen", and "none".
        2021-08-16 04:59:04.571 EDT [4689] STATEMENT:  SELECT blkno, offnum,
attnum, msg FROM "public".verify_heapam(
                relation := 16396, on_error_stop := false, check_toast :=
true, skip := 'all visible')
        heap table "postgres"."public"."tb01":
            ERROR:  invalid skip option
            HINT:  Valid skip options are "all-visible", "all-frozen", and
"none".
        [postgres14@localhost ~]$

Regards.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17149: About --skip option of pg_amcheck command
  2021-08-17 04:36 BUG #17149: About --skip option of pg_amcheck command PG Bug reporting form <noreply@postgresql.org>
@ 2021-08-17 07:54 ` Daniel Gustafsson <daniel@yesql.se>
  2021-08-18 05:30   ` Re: BUG #17149: About --skip option of pg_amcheck command Masahiko Sawada <sawada.mshk@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Daniel Gustafsson @ 2021-08-17 07:54 UTC (permalink / raw)
  To: chenjq.jy@fujitsu.com; pgsql-bugs@lists.postgresql.org

> On 17 Aug 2021, at 06:36, PG Bug reporting form <noreply@postgresql.org> wrote:

>    When I specify the "none" value for --skip option, the following error
> occurs:
>        [postgres14@localhost ~]$ pg_amcheck -p 51403 -d postgres -t tb01
> --skip=none
>        pg_amcheck: error: invalid argument for option --skip
>        [postgres14@localhost ~]$

Nice catch, this should indeed be handled. Fixed in the attached.

>    When I specify the "all-visible" or "all-frozen" value for --skip
> option, take "all-visible" as an example, the following error occurs:
>        [postgres14@localhost ~]$ pg_amcheck -p 51403 -d postgres -t tb01
> --skip=all-visible
>        2021-08-16 04:59:04.571 EDT [4689] ERROR:  invalid skip option
>        2021-08-16 04:59:04.571 EDT [4689] HINT:  Valid skip options are
> "all-visible", "all-frozen", and "none".

Indeed, the attached fixes this as well.

Barring objections I will apply the attached backpatched to 14.

--
Daniel Gustafsson		https://vmware.com/

Attachments:

pg_amcheck_skip.diff (application/octet-stream, 659B) download diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c index bcb02db495..a86a1c0987 100644 --- a/src/bin/pg_amcheck/pg_amcheck.c +++ b/src/bin/pg_amcheck/pg_amcheck.c @@ -395,9 +395,11 @@ main(int argc, char *argv[]) break; case 6: if (pg_strcasecmp(optarg, "all-visible") == 0) - opts.skip = "all visible"; + opts.skip = "all-visible"; else if (pg_strcasecmp(optarg, "all-frozen") == 0) - opts.skip = "all frozen"; + opts.skip = "all-frozen"; + else if (pg_strcasecmp(optarg, "none") == 0) + opts.skip = "none"; else { pg_log_error("invalid argument for option %s", "--skip");
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: BUG #17149: About --skip option of pg_amcheck command
  2021-08-17 04:36 BUG #17149: About --skip option of pg_amcheck command PG Bug reporting form <noreply@postgresql.org>
  2021-08-17 07:54 ` Re: BUG #17149: About --skip option of pg_amcheck command Daniel Gustafsson <daniel@yesql.se>
@ 2021-08-18 05:30   ` Masahiko Sawada <sawada.mshk@gmail.com>
  2021-08-18 09:31     ` Re: BUG #17149: About --skip option of pg_amcheck command Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 4+ messages in thread

From: Masahiko Sawada @ 2021-08-18 05:30 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: chenjq.jy@fujitsu.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>

On Tue, Aug 17, 2021 at 4:54 PM Daniel Gustafsson <daniel@yesql.se> wrote:
>
> > On 17 Aug 2021, at 06:36, PG Bug reporting form <noreply@postgresql.org> wrote:
>
> >    When I specify the "none" value for --skip option, the following error
> > occurs:
> >        [postgres14@localhost ~]$ pg_amcheck -p 51403 -d postgres -t tb01
> > --skip=none
> >        pg_amcheck: error: invalid argument for option --skip
> >        [postgres14@localhost ~]$
>
> Nice catch, this should indeed be handled. Fixed in the attached.
>
> >    When I specify the "all-visible" or "all-frozen" value for --skip
> > option, take "all-visible" as an example, the following error occurs:
> >        [postgres14@localhost ~]$ pg_amcheck -p 51403 -d postgres -t tb01
> > --skip=all-visible
> >        2021-08-16 04:59:04.571 EDT [4689] ERROR:  invalid skip option
> >        2021-08-16 04:59:04.571 EDT [4689] HINT:  Valid skip options are
> > "all-visible", "all-frozen", and "none".
>
> Indeed, the attached fixes this as well.
>
> Barring objections I will apply the attached backpatched to 14.

The patch looks good to me.

Regards,

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17149: About --skip option of pg_amcheck command
  2021-08-17 04:36 BUG #17149: About --skip option of pg_amcheck command PG Bug reporting form <noreply@postgresql.org>
  2021-08-17 07:54 ` Re: BUG #17149: About --skip option of pg_amcheck command Daniel Gustafsson <daniel@yesql.se>
  2021-08-18 05:30   ` Re: BUG #17149: About --skip option of pg_amcheck command Masahiko Sawada <sawada.mshk@gmail.com>
@ 2021-08-18 09:31     ` Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 0 replies; 4+ messages in thread

From: Daniel Gustafsson @ 2021-08-18 09:31 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; +Cc: chenjq.jy@fujitsu.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>

> On 18 Aug 2021, at 07:30, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> On Tue, Aug 17, 2021 at 4:54 PM Daniel Gustafsson <daniel@yesql.se> wrote:

>> Barring objections I will apply the attached backpatched to 14.
> 
> The patch looks good to me.

Pushed to master and v14, thanks for review!

--
Daniel Gustafsson		https://vmware.com/






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2021-08-18 09:31 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 04:36 BUG #17149: About --skip option of pg_amcheck command PG Bug reporting form <noreply@postgresql.org>
2021-08-17 07:54 ` Daniel Gustafsson <daniel@yesql.se>
2021-08-18 05:30   ` Masahiko Sawada <sawada.mshk@gmail.com>
2021-08-18 09:31     ` Daniel Gustafsson <daniel@yesql.se>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox