diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-07-29 11:33:12 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2018-02-20 15:19:43 -0500 |
commit | 6dcfbb12c21b395136468666bc69a60705c24c91 (patch) | |
tree | c18f6aa4554923fe924e7e0a606d1cfdeef7694c | |
parent | bcf597ce00b63a04703e6a96414b5fab85e86d34 (diff) | |
download | mongo-6dcfbb12c21b395136468666bc69a60705c24c91.tar.gz |
SERVER-24785 backup_restore.js fails when observing FTDC interim files
(cherry picked from commit c4fc9c165026a710809df7751f00c342b5eb27f6)
-rw-r--r-- | src/mongo/shell/shell_utils_launcher.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp index d01b2d9ec98..4595f70276d 100644 --- a/src/mongo/shell/shell_utils_launcher.cpp +++ b/src/mongo/shell/shell_utils_launcher.cpp @@ -643,7 +643,15 @@ void copyDir(const boost::filesystem::path& from, const boost::filesystem::path& boost::filesystem::directory_iterator i(from); while (i != end) { boost::filesystem::path p = *i; - if (p.leaf() != "mongod.lock" && p.leaf() != "WiredTiger.lock") { + if (p.leaf() == "metrics.interim" || p.leaf() == "metrics.interim.temp") { + // Ignore any errors for metrics.interim* files as these may disappear during copy + boost::system::error_code ec; + boost::filesystem::copy_file(p, to / p.leaf(), ec); + if (ec) { + log() << "Skipping copying of file from '" << p.generic_string() << "' to '" + << (to / p.leaf()).generic_string() << "' due to: " << ec.message(); + } + } else if (p.leaf() != "mongod.lock" && p.leaf() != "WiredTiger.lock") { if (boost::filesystem::is_directory(p)) { boost::filesystem::path newDir = to / p.leaf(); boost::filesystem::create_directory(newDir); |