diff --git a/db/db_impl/db_impl_secondary.cc b/db/db_impl/db_impl_secondary.cc index 2737df0ae..5cd0beb1f 100644 --- a/db/db_impl/db_impl_secondary.cc +++ b/db/db_impl/db_impl_secondary.cc @@ -60,6 +60,12 @@ Status DBImplSecondary::Recover( s = FindAndRecoverLogFiles(&cfds_changed, &job_context); } + if (s.IsPathNotFound()) { + ROCKS_LOG_INFO(immutable_db_options_.info_log, + "Secondary tries to read WAL, but WAL file(s) have already " + "been purged by primary."); + s = Status::OK(); + } // TODO: update options_file_number_ needed? job_context.Clean(); @@ -475,6 +481,12 @@ Status DBImplSecondary::TryCatchUpWithPrimary() { if (s.ok()) { s = FindAndRecoverLogFiles(&cfds_changed, &job_context); } + if (s.IsPathNotFound()) { + ROCKS_LOG_INFO(immutable_db_options_.info_log, + "Secondary tries to read WAL, but WAL file(s) have already " + "been purged by primary."); + s = Status::OK(); + } if (s.ok()) { for (auto cfd : cfds_changed) { cfd->imm()->RemoveOldMemTables(cfd->GetLogNumber(),