diff --git a/fdbserver/RestoreApplier.actor.cpp b/fdbserver/RestoreApplier.actor.cpp index 05099b52b2..215a694a85 100644 --- a/fdbserver/RestoreApplier.actor.cpp +++ b/fdbserver/RestoreApplier.actor.cpp @@ -18,13 +18,12 @@ * limitations under the License. */ +// This file defines the functions used by the RestoreApplier role. +// RestoreApplier role starts at restoreApplierCore actor #include "fdbclient/NativeAPI.actor.h" #include "fdbclient/SystemData.h" - -// Backup agent header #include "fdbclient/BackupAgent.actor.h" -//#include "FileBackupAgent.h" #include "fdbclient/ManagementAPI.actor.h" #include "fdbclient/MutationList.h" #include "fdbclient/BackupContainer.h" @@ -34,7 +33,6 @@ #include "fdbserver/RestoreRoleCommon.actor.h" #include "fdbserver/RestoreApplier.actor.h" - #include "flow/actorcompiler.h" // This must be the last #include. ACTOR Future handleGetApplierKeyRangeRequest(RestoreGetApplierKeyRangeRequest req, Reference self); diff --git a/fdbserver/RestoreApplier.actor.h b/fdbserver/RestoreApplier.actor.h index a8b19caa45..ff206ba1d6 100644 --- a/fdbserver/RestoreApplier.actor.h +++ b/fdbserver/RestoreApplier.actor.h @@ -1,5 +1,5 @@ /* - * RestoreApplierInterface.h + * RestoreApplier.actor.h * * This source file is part of the FoundationDB open source project * @@ -18,23 +18,22 @@ * limitations under the License. */ -// Declear RestoreApplier interface and actors +// This file declears RestoreApplier interface and actors #pragma once -#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RestoreApplierInterface_G_H) - #define FDBSERVER_RestoreApplierInterface_G_H +#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RESTORE_APPLIER_G_H) + #define FDBSERVER_RESTORE_APPLIER_G_H #include "fdbserver/RestoreApplier.actor.g.h" -#elif !defined(FDBSERVER_RestoreApplierInterface_H) - #define FDBSERVER_RestoreApplierInterface_H +#elif !defined(FDBSERVER_RESTORE_APPLIER_H) + #define FDBSERVER_RESTORE_APPLIER_H #include #include "flow/Stats.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/CommitTransaction.h" #include "fdbrpc/fdbrpc.h" -#include "fdbserver/CoordinationInterface.h" #include "fdbrpc/Locality.h" - +#include "fdbserver/CoordinationInterface.h" #include "fdbserver/RestoreUtil.h" #include "fdbserver/RestoreRoleCommon.actor.h" #include "fdbserver/RestoreWorkerInterface.h" diff --git a/fdbserver/RestoreCommon.actor.cpp b/fdbserver/RestoreCommon.actor.cpp index a472f375ea..fd32810e76 100644 --- a/fdbserver/RestoreCommon.actor.cpp +++ b/fdbserver/RestoreCommon.actor.cpp @@ -18,6 +18,9 @@ * limitations under the License. */ +// This file implements the functions defined in RestoreCommon.actor.h +// The functions in this file are copied from BackupAgent + #include "fdbserver/RestoreCommon.actor.h" #include "fdbclient/NativeAPI.actor.h" diff --git a/fdbserver/RestoreCommon.actor.h b/fdbserver/RestoreCommon.actor.h index b2370e1093..a4b8dd95e3 100644 --- a/fdbserver/RestoreCommon.actor.h +++ b/fdbserver/RestoreCommon.actor.h @@ -18,6 +18,10 @@ * limitations under the License. */ +// This file includes the code copied from the old restore in FDB 5.2 +// The functions and structure declared in this file can be shared by +// the old restore and the new performant restore systems + #pragma once #if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RESTORECOMMON_ACTOR_G_H) #define FDBSERVER_RESTORECOMMON_ACTOR_G_H @@ -25,13 +29,12 @@ #elif !defined(FDBSERVER_RESTORECOMMON_ACTOR_H) #define FDBSERVER_RESTORECOMMON_ACTOR_H -#include "fdbclient/Tuple.h" - #include "flow/flow.h" +#include "flow/genericactors.actor.h" +#include "fdbclient/Tuple.h" #include "fdbclient/NativeAPI.actor.h" #include "fdbrpc/IAsyncFile.h" #include "fdbclient/BackupAgent.actor.h" -#include "flow/genericactors.actor.h" #include "flow/actorcompiler.h" // has to be last include diff --git a/fdbserver/RestoreLoader.actor.cpp b/fdbserver/RestoreLoader.actor.cpp index b9b9ab3ebd..0725db0c39 100644 --- a/fdbserver/RestoreLoader.actor.cpp +++ b/fdbserver/RestoreLoader.actor.cpp @@ -18,6 +18,9 @@ * limitations under the License. */ +// This file implements the functions and actors used by the RestoreLoader role. +// The RestoreLoader role starts with the restoreLoaderCore actor + #include "fdbclient/BackupContainer.h" #include "fdbserver/RestoreLoader.actor.h" @@ -30,7 +33,7 @@ ACTOR Future handleLoadRangeFileRequest(RestoreLoadFileRequest req, Refere ACTOR Future handleLoadLogFileRequest(RestoreLoadFileRequest req, Reference self); ACTOR Future registerMutationsToMasterApplier(Reference self); - ACTOR static Future _parseLogFileToMutationsOnLoader(Reference self, +ACTOR static Future _parseLogFileToMutationsOnLoader(Reference self, Reference bc, Version version, std::string fileName, int64_t readOffset, int64_t readLen, KeyRange restoreRange, Key addPrefix, Key removePrefix, diff --git a/fdbserver/RestoreLoader.actor.h b/fdbserver/RestoreLoader.actor.h index 79331faec2..8cdbece925 100644 --- a/fdbserver/RestoreLoader.actor.h +++ b/fdbserver/RestoreLoader.actor.h @@ -1,5 +1,5 @@ /* - * RestoreLoaderInterface.h + * RestoreLoader.h * * This source file is part of the FoundationDB open source project * @@ -18,14 +18,14 @@ * limitations under the License. */ -// Declear RestoreLoader interface and actors +// This file declares the actors used by the RestoreLoader role #pragma once -#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RestoreLoaderInterface_G_H) - #define FDBSERVER_RestoreLoaderInterface_G_H +#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RESTORE_LOADER_G_H) + #define FDBSERVER_RESTORE_LOADER_G_H #include "fdbserver/RestoreLoader.actor.g.h" -#elif !defined(FDBSERVER_RestoreLoaderInterface_H) - #define FDBSERVER_RestoreLoaderInterface_H +#elif !defined(FDBSERVER_RESTORE_LOADER_H) + #define FDBSERVER_RESTORE_LOADER_H #include #include "flow/Stats.h" diff --git a/fdbserver/RestoreMaster.actor.cpp b/fdbserver/RestoreMaster.actor.cpp index cbeee453d0..fe80f5366c 100644 --- a/fdbserver/RestoreMaster.actor.cpp +++ b/fdbserver/RestoreMaster.actor.cpp @@ -18,17 +18,14 @@ * limitations under the License. */ +// This file implements the functions for RestoreMaster role #include "fdbclient/NativeAPI.actor.h" #include "fdbclient/SystemData.h" - -// Backup agent header #include "fdbclient/BackupAgent.actor.h" -//#include "FileBackupAgent.h" #include "fdbclient/ManagementAPI.actor.h" #include "fdbclient/MutationList.h" #include "fdbclient/BackupContainer.h" - #include "fdbserver/RestoreCommon.actor.h" #include "fdbserver/RestoreRoleCommon.actor.h" #include "fdbserver/RestoreMaster.actor.h" diff --git a/fdbserver/RestoreMaster.actor.h b/fdbserver/RestoreMaster.actor.h index 84a7067941..0b72d83781 100644 --- a/fdbserver/RestoreMaster.actor.h +++ b/fdbserver/RestoreMaster.actor.h @@ -1,5 +1,5 @@ /* - * RestoreMasterInterface.h + * RestoreMaster.h * * This source file is part of the FoundationDB open source project * @@ -18,23 +18,22 @@ * limitations under the License. */ -// Declear RestoreMaster interface and actors +// This file declear RestoreMaster interface and actors #pragma once -#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RestoreMasterInterface_G_H) - #define FDBSERVER_RestoreMasterInterface_G_H +#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RESTORE_MASTER_G_H) + #define FDBSERVER_RESTORE_MASTER_G_H #include "fdbserver/RestoreMaster.actor.g.h" -#elif !defined(FDBSERVER_RestoreMasterInterface_H) - #define FDBSERVER_RestoreMasterInterface_H +#elif !defined(FDBSERVER_RESTORE_MASTER_H) + #define FDBSERVER_RESTORE_MASTER_H #include #include "flow/Stats.h" #include "fdbclient/FDBTypes.h" #include "fdbclient/CommitTransaction.h" #include "fdbrpc/fdbrpc.h" -#include "fdbserver/CoordinationInterface.h" #include "fdbrpc/Locality.h" - +#include "fdbserver/CoordinationInterface.h" #include "fdbserver/RestoreUtil.h" #include "fdbserver/RestoreRoleCommon.actor.h" diff --git a/fdbserver/RestoreRoleCommon.actor.h b/fdbserver/RestoreRoleCommon.actor.h index f47652d9c6..eea91f4eb2 100644 --- a/fdbserver/RestoreRoleCommon.actor.h +++ b/fdbserver/RestoreRoleCommon.actor.h @@ -18,7 +18,8 @@ * limitations under the License. */ -// Delcare commone struct and functions used in fast restore +// This file delcares common struct and functions shared by restore roles, i.e., +// RestoreMaster, RestoreLoader, RestoreApplier #pragma once #if defined(NO_INTELLISENSE) && !defined(FDBSERVER_RestoreRoleCommon_G_H) @@ -32,9 +33,8 @@ #include "fdbclient/FDBTypes.h" #include "fdbclient/CommitTransaction.h" #include "fdbrpc/fdbrpc.h" -#include "fdbserver/CoordinationInterface.h" #include "fdbrpc/Locality.h" - +#include "fdbserver/CoordinationInterface.h" #include "fdbserver/RestoreUtil.h" #include "fdbserver/RestoreWorkerInterface.h" diff --git a/fdbserver/RestoreUtil.actor.cpp b/fdbserver/RestoreUtil.actor.cpp index 921961b0f7..78abc2f168 100644 --- a/fdbserver/RestoreUtil.actor.cpp +++ b/fdbserver/RestoreUtil.actor.cpp @@ -18,6 +18,8 @@ * limitations under the License. */ +// This file implements the functions defined in RestoreUtil.h + #include "fdbserver/RestoreUtil.h" #include "flow/actorcompiler.h" // This must be the last #include. diff --git a/fdbserver/RestoreWorkerInterface.h b/fdbserver/RestoreWorkerInterface.h index 1bf898f870..115394e896 100644 --- a/fdbserver/RestoreWorkerInterface.h +++ b/fdbserver/RestoreWorkerInterface.h @@ -18,7 +18,8 @@ * limitations under the License. */ -// Declare and define the interface for restore worker/loader/applier +// This file declare and define the interface for RestoreWorker and restore roles +// which are RestoreMaster, RestoreLoader, and RestoreApplier #ifndef FDBSERVER_RESTORE_WORKER_INTERFACE_H #define FDBSERVER_RESTORE_WORKER_INTERFACE_H