Обсуждение: pgsql: Fix thinko when bumping on temporary directories inpg_verify_ch

Поиск
Список
Период
Сортировка

pgsql: Fix thinko when bumping on temporary directories inpg_verify_ch

От
Michael Paquier
Дата:
Fix thinko when bumping on temporary directories in pg_verify_checksums

This fixes an oversight from 5c99513.  This has no actual consequence as
PG_TEMP_FILE_PREFIX and PG_TEMP_FILES_DIR have the same value so when
bumping on a temporary path the directory scan was still moving on to
the next entry instead of skipping the rest of the scan, but let's keep
the logic correct.

Author: Michael Banck
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/20190314.115417.58230569.horiguchi.kyotaro@lab.ntt.co.jp
Backpatch-through: 11

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/da453004869d3e818d8529087b680ebbf8842f51

Modified Files
--------------
src/bin/pg_verify_checksums/pg_verify_checksums.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


Re: pgsql: Fix thinko when bumping on temporary directories in pg_verify_ch

От
Robert Haas
Дата:
On Thu, Mar 14, 2019 at 1:16 AM Michael Paquier <michael@paquier.xyz> wrote:
> Fix thinko when bumping on temporary directories in pg_verify_checksums

What the heck does it mean to bump on a directory?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Fix thinko when bumping on temporary directories inpg_verify_ch

От
Michael Paquier
Дата:
On Thu, Mar 14, 2019 at 08:39:10AM -0400, Robert Haas wrote:
> On Thu, Mar 14, 2019 at 1:16 AM Michael Paquier <michael@paquier.xyz> wrote:
> > Fix thinko when bumping on temporary directories in pg_verify_checksums
>
> What the heck does it mean to bump on a directory?

My apologies for the confusion.  It looks like there is a lot of
Frenglish power in that.  What I meant is "faire face", so it would
have been better to use "facing", "scanning" or "finding".
--
Michael

Вложения

Re: pgsql: Fix thinko when bumping on temporary directories in pg_verify_ch

От
Robert Haas
Дата:
On Thu, Mar 14, 2019 at 8:54 PM Michael Paquier <michael@paquier.xyz> wrote:
> My apologies for the confusion.  It looks like there is a lot of
> Frenglish power in that.  What I meant is "faire face", so it would
> have been better to use "facing", "scanning" or "finding".

OK.  My other gripe with this commit message is that it doesn't
actually explain what problem was being fixed.  You explain that it's
wrong, and you explain why fixing it is not a big deal, but you never
quite say what you're actually fixing.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Fix thinko when bumping on temporary directories inpg_verify_ch

От
Michael Paquier
Дата:
On Fri, Mar 15, 2019 at 10:09:57AM -0400, Robert Haas wrote:
> OK.  My other gripe with this commit message is that it doesn't
> actually explain what problem was being fixed.  You explain that it's
> wrong, and you explain why fixing it is not a big deal, but you never
> quite say what you're actually fixing.

I have re-read the commit log a couple of times, and I see your
point, sorry for the confusion.  I should have added an extra
paragraph to mention that when pg_verify_checksums sees a directory
folder name which matches PG_TEMP_FILES_DIR when scanning all the
entries of a path for checksum verification, then it would return
immediately, skipping all the follow-up entries in this path,
potentially missing checks in a portion of files.  The reason why it
is not a problem is actually that PG_TEMP_FILE_PREFIX and
PG_TEMP_FILES_DIR have the same value "pgsql_tmp", and that when
seeing an entry which matches PG_TEMP_FILE_PREFIX, then the scan of
the current folder would correctly move on to the next entry in the
current folder instead of simply returning and missing the next
entries.
--
Michael

Вложения