Thread

Commits

  1. Fix error reporting after ioctl() call with pg_upgrade --clone

  1. pg_upgrade errno

    Justin Pryzby <pryzby@telsasoft.com> — 2022-07-31T13:41:35Z

    Since 3a769d823 (pg_upgrade: Allow use of file cloning)
    file.c has had:
    
    -       if (ioctl(dest_fd, FICLONE, src_fd) < 0)
    -       {
    -               unlink(dst);
    -               pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
    -                                schemaName, relName, src, dst, strerror(errno));
    -       }
    
    But errno should be saved before strerror/%m.
    
    -- 
    Justin
    
    
    
    
  2. Re: pg_upgrade errno

    Michael Paquier <michael@paquier.xyz> — 2022-07-31T23:39:10Z

    On Sun, Jul 31, 2022 at 08:41:35AM -0500, Justin Pryzby wrote:
    > Since 3a769d823 (pg_upgrade: Allow use of file cloning)
    > file.c has had:
    > 
    > -       if (ioctl(dest_fd, FICLONE, src_fd) < 0)
    > -       {
    > -               unlink(dst);
    > -               pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
    > -                                schemaName, relName, src, dst, strerror(errno));
    > -       }
    > 
    > But errno should be saved before strerror/%m.
    
    Good catch, Justin.  Will fix on HEAD.
    --
    Michael
    
  3. Re: pg_upgrade errno

    Tom Lane <tgl@sss.pgh.pa.us> — 2022-07-31T23:43:25Z

    Michael Paquier <michael@paquier.xyz> writes:
    > On Sun, Jul 31, 2022 at 08:41:35AM -0500, Justin Pryzby wrote:
    >> But errno should be saved before strerror/%m.
    
    > Good catch, Justin.  Will fix on HEAD.
    
    It's been wrong a lot longer than that, no?
    
    			regards, tom lane
    
    
    
    
  4. Re: pg_upgrade errno

    Michael Paquier <michael@paquier.xyz> — 2022-08-01T00:19:10Z

    On Sun, Jul 31, 2022 at 07:43:25PM -0400, Tom Lane wrote:
    > It's been wrong a lot longer than that, no?
    
    Since the beginning of times.  But we've never really cared about
    fixing such errno behaviors based on their unlikeliness, have we?  I
    don't mind doing a backpatch here, though, that's isolated enough.
    --
    Michael