@@ -832,11 +832,11 @@ arangodb::Result restoreData(arangodb::httpclient::SimpleHttpClient& httpClient,
832832 // note that we have to store the uncompressed offset here, because we
833833 // potentially have consumed more data than we have sent.
834834 datafileReadOffset += length;
835- jobData.progressTracker .updateStatus (
835+ [[maybe_unused]] bool wasSynced = jobData.progressTracker .updateStatus (
836836 cname, arangodb::RestoreFeature::CollectionStatus{arangodb::RestoreFeature::RESTORING,
837837 datafileReadOffset});
838838#ifdef ARANGODB_ENABLE_FAILURE_TESTS
839- if (jobData.options .failOnUpdateContinueFile && length != 0 ) {
839+ if (wasSynced && jobData.options .failOnUpdateContinueFile && length != 0 ) {
840840 LOG_TOPIC (" a87bf" , WARN, Logger::RESTORE) << " triggered failure point at offset " << datafileReadOffset << " !" ;
841841 FATAL_ERROR_EXIT_CODE (38 ); // exit with exit code 38 to report to the test frame work that this was an intentional crash
842842 }
@@ -1765,6 +1765,8 @@ void RestoreFeature::start() {
17651765 << basics::StringUtils::join (dbs, " ', '" ) << " ' from dump directory '" << _options.inputPath << " '..." ;
17661766 }
17671767
1768+ std::vector<std::string> filesToClean;
1769+
17681770 for (auto & db : databases) {
17691771 result.reset ();
17701772
@@ -1837,6 +1839,8 @@ void RestoreFeature::start() {
18371839 LOG_TOPIC_IF (" 52b23" , INFO, arangodb::Logger::RESTORE, _options.continueRestore ) << " try to continue previous restore" ;
18381840 _progressTracker = std::make_unique<RestoreProgressTracker>(*_directory, !_options.continueRestore );
18391841
1842+ filesToClean.push_back (_progressTracker->filename ());
1843+
18401844 // run the actual restore
18411845 try {
18421846 result = ::processInputDirectory (*httpClient, _clientTaskQueue, *this ,
@@ -1857,13 +1861,15 @@ void RestoreFeature::start() {
18571861 if (result.fail ()) {
18581862 break ;
18591863 }
1860-
1861- _progressTracker->cleanup ();
18621864 }
18631865
18641866 if (result.fail ()) {
18651867 LOG_TOPIC (" cb69f" , ERR, arangodb::Logger::RESTORE) << result.errorMessage ();
18661868 _exitCode = EXIT_FAILURE;
1869+ } else {
1870+ for (auto const & fn : filesToClean) {
1871+ [[maybe_unused]] auto result = basics::FileUtils::remove (fn);
1872+ }
18671873 }
18681874
18691875 if (_options.progress ) {
0 commit comments