Fix RecursiveCopy.pm to cope with disappearing files.
authorTom Lane <[email protected]>
Tue, 12 Sep 2017 02:02:58 +0000 (22:02 -0400)
committerTom Lane <[email protected]>
Tue, 12 Sep 2017 02:02:58 +0000 (22:02 -0400)
commitbd18960cb93f3b6e9f43f3cabec34f1929f05ec3
tree8c52435d8c4730f2b8abe5433cb6a58fe0a3563d
parentd4c9eb005a16ff5cdc9d5d9514a3195c60ad21ab
Fix RecursiveCopy.pm to cope with disappearing files.

When copying from an active database tree, it's possible for files to be
deleted after we see them in a readdir() scan but before we can open them.
(Once we've got a file open, we don't expect any further errors from it
getting unlinked, though.)  Tweak RecursiveCopy so it can cope with this
case, so as to avoid irreproducible test failures.

Back-patch to 9.6 where this code was added.  In v10 and HEAD, also
remove unused "use RecursiveCopy" in one recovery test script.

Michael Paquier and Tom Lane

Discussion: https://postgr.es/m/24621.1504924323@sss.pgh.pa.us
src/test/perl/RecursiveCopy.pm
src/test/recovery/t/010_logical_decoding_timelines.pl