pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless lstat() call in pg_rewind.
Date: Sun, 06 Sep 2020 15:51:00 +0000
Message-ID: <E1kEwwW-0001mA-DX@gemulon.postgresql.org> (raw)

Remove useless lstat() call in pg_rewind.

This is duplicative of an lstat that was just done by the calling
function (traverse_datadir), besides which we weren't really doing
anything with the results.  There's not much point in checking to
see if someone removed the file since the previous lstat, since the
FILE_ACTION_REMOVE code would have to deal with missing-file cases
anyway.  Moreover, the "exists = false" assignment was a dead store;
nothing was done with that value later.

A syscall saved is a syscall earned, so back-patch to 9.5
where this code was introduced.

Discussion: https://postgr.es/m/1221796.1599329320@sss.pgh.pa.us

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/bin/pg_rewind/filemap.c | 12 ------------
1 file changed, 12 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1kEwwW-0001mA-DX@gemulon.postgresql.org>
Permalink:  ../E1kEwwW-0001mA-DX@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kEwwW-0001mA-DX@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Remove useless lstat() call in pg_rewind.
  In-Reply-To: <E1kEwwW-0001mA-DX@gemulon.postgresql.org>
  References: <E1kEwwW-0001mA-DX@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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