Skip to content

Commit f1c744d

Browse files
committed
Remove TransformPartitionedLog parameter from restore()
Instead, infer the flag from backup description.
1 parent a9416e2 commit f1c744d

File tree

4 files changed

+35
-45
lines changed

4 files changed

+35
-45
lines changed

fdbclient/FileBackupAgent.actor.cpp

+25-31
Original file line numberDiff line numberDiff line change
@@ -7568,28 +7568,26 @@ class FileBackupAgentImpl {
75687568
// When set to true, gives an inconsistent snapshot, thus not recommended
75697569
// beginVersions: restore's begin version for each range
75707570
// randomUid: the UID for lock the database
7571-
ACTOR static Future<Version> restore(
7572-
FileBackupAgent* backupAgent,
7573-
Database cx,
7574-
Optional<Database> cxOrig,
7575-
Key tagName,
7576-
Key url,
7577-
Optional<std::string> proxy,
7578-
Standalone<VectorRef<KeyRangeRef>> ranges,
7579-
Standalone<VectorRef<Version>> beginVersions,
7580-
WaitForComplete waitForComplete,
7581-
Version targetVersion,
7582-
Verbose verbose,
7583-
Key addPrefix,
7584-
Key removePrefix,
7585-
LockDB lockDB,
7586-
UnlockDB unlockDB,
7587-
OnlyApplyMutationLogs onlyApplyMutationLogs,
7588-
InconsistentSnapshotOnly inconsistentSnapshotOnly,
7589-
Optional<std::string> encryptionKeyFileName,
7590-
UID randomUid,
7591-
Optional<std::string> blobManifestUrl,
7592-
TransformPartitionedLog transformPartitionedLog = TransformPartitionedLog::False) {
7571+
ACTOR static Future<Version> restore(FileBackupAgent* backupAgent,
7572+
Database cx,
7573+
Optional<Database> cxOrig,
7574+
Key tagName,
7575+
Key url,
7576+
Optional<std::string> proxy,
7577+
Standalone<VectorRef<KeyRangeRef>> ranges,
7578+
Standalone<VectorRef<Version>> beginVersions,
7579+
WaitForComplete waitForComplete,
7580+
Version targetVersion,
7581+
Verbose verbose,
7582+
Key addPrefix,
7583+
Key removePrefix,
7584+
LockDB lockDB,
7585+
UnlockDB unlockDB,
7586+
OnlyApplyMutationLogs onlyApplyMutationLogs,
7587+
InconsistentSnapshotOnly inconsistentSnapshotOnly,
7588+
Optional<std::string> encryptionKeyFileName,
7589+
UID randomUid,
7590+
Optional<std::string> blobManifestUrl) {
75937591
// The restore command line tool won't allow ranges to be empty, but correctness workloads somehow might.
75947592
if (ranges.empty()) {
75957593
throw restore_error();
@@ -7654,7 +7652,7 @@ class FileBackupAgentImpl {
76547652
beginVersion,
76557653
randomUid,
76567654
blobManifestUrl,
7657-
transformPartitionedLog));
7655+
TransformPartitionedLog(desc.partitioned)));
76587656
wait(tr->commit());
76597657
break;
76607658
} catch (Error& e) {
@@ -7943,8 +7941,7 @@ Future<Version> FileBackupAgent::restore(Database cx,
79437941
OnlyApplyMutationLogs onlyApplyMutationLogs,
79447942
InconsistentSnapshotOnly inconsistentSnapshotOnly,
79457943
Optional<std::string> const& encryptionKeyFileName,
7946-
Optional<std::string> blobManifestUrl,
7947-
TransformPartitionedLog transformPartitionedLog) {
7944+
Optional<std::string> blobManifestUrl) {
79487945
return FileBackupAgentImpl::restore(this,
79497946
cx,
79507947
cxOrig,
@@ -7964,8 +7961,7 @@ Future<Version> FileBackupAgent::restore(Database cx,
79647961
inconsistentSnapshotOnly,
79657962
encryptionKeyFileName,
79667963
deterministicRandom()->randomUniqueID(),
7967-
blobManifestUrl,
7968-
transformPartitionedLog);
7964+
blobManifestUrl);
79697965
}
79707966

79717967
Future<Version> FileBackupAgent::restore(Database cx,
@@ -7985,8 +7981,7 @@ Future<Version> FileBackupAgent::restore(Database cx,
79857981
InconsistentSnapshotOnly inconsistentSnapshotOnly,
79867982
Version beginVersion,
79877983
Optional<std::string> const& encryptionKeyFileName,
7988-
Optional<std::string> blobManifestUrl,
7989-
TransformPartitionedLog transformPartitionedLog) {
7984+
Optional<std::string> blobManifestUrl) {
79907985
Standalone<VectorRef<Version>> beginVersions;
79917986
for (auto i = 0; i < ranges.size(); ++i) {
79927987
beginVersions.push_back(beginVersions.arena(), beginVersion);
@@ -8008,8 +8003,7 @@ Future<Version> FileBackupAgent::restore(Database cx,
80088003
onlyApplyMutationLogs,
80098004
inconsistentSnapshotOnly,
80108005
encryptionKeyFileName,
8011-
blobManifestUrl,
8012-
transformPartitionedLog);
8006+
blobManifestUrl);
80138007
}
80148008

80158009
Future<Version> FileBackupAgent::restore(Database cx,

fdbclient/include/fdbclient/BackupAgent.actor.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#elif !defined(FDBCLIENT_BACKUP_AGENT_ACTOR_H)
2626
#define FDBCLIENT_BACKUP_AGENT_ACTOR_H
2727

28+
#include <ctime>
29+
#include <climits>
30+
2831
#include "flow/flow.h"
2932
#include "fdbclient/NativeAPI.actor.h"
3033
#include "fdbclient/TaskBucket.h"
3134
#include "fdbclient/Notified.h"
3235
#include "flow/IAsyncFile.h"
3336
#include "fdbclient/KeyBackedTypes.actor.h"
34-
#include <ctime>
35-
#include <climits>
3637
#include "fdbclient/BackupContainer.h"
3738
#include "flow/actorcompiler.h" // has to be last include
3839

@@ -205,8 +206,7 @@ class FileBackupAgent : public BackupAgentBase {
205206
OnlyApplyMutationLogs = OnlyApplyMutationLogs::False,
206207
InconsistentSnapshotOnly = InconsistentSnapshotOnly::False,
207208
Optional<std::string> const& encryptionKeyFileName = {},
208-
Optional<std::string> blobManifestUrl = {},
209-
TransformPartitionedLog transformPartitionedLog = TransformPartitionedLog::False);
209+
Optional<std::string> blobManifestUrl = {});
210210

211211
// this method will construct range and version vectors and then call restore()
212212
Future<Version> restore(Database cx,
@@ -245,8 +245,7 @@ class FileBackupAgent : public BackupAgentBase {
245245
InconsistentSnapshotOnly inconsistentSnapshotOnly = InconsistentSnapshotOnly::False,
246246
Version beginVersion = ::invalidVersion,
247247
Optional<std::string> const& encryptionKeyFileName = {},
248-
Optional<std::string> blobManifestUrl = {},
249-
TransformPartitionedLog transformPartitionedLog = TransformPartitionedLog::False);
248+
Optional<std::string> blobManifestUrl = {});
250249

251250
Future<Version> atomicRestore(Database cx,
252251
Key tagName,
@@ -536,7 +535,7 @@ struct RCGroup {
536535
Version version; // this is read version for this group
537536
uint64_t groupKey; // this is the original version for this group
538537

539-
RCGroup() : version(-1), groupKey(ULLONG_MAX){};
538+
RCGroup() : version(-1), groupKey(ULLONG_MAX) {}
540539

541540
template <class Ar>
542541
void serialize(Ar& ar) {

fdbserver/workloads/BackupCorrectnessPartitioned.actor.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,7 @@ struct BackupAndRestorePartitionedCorrectnessWorkload : TestWorkload {
501501
InconsistentSnapshotOnly::False,
502502
::invalidVersion,
503503
self->encryptionKeyFileName,
504-
{},
505-
TransformPartitionedLog::True)));
504+
{})));
506505
printf("BackupCorrectness, backupAgent.restore finished for tag:%s\n", restoreTag.toString().c_str());
507506
return Void();
508507
}
@@ -657,8 +656,7 @@ struct BackupAndRestorePartitionedCorrectnessWorkload : TestWorkload {
657656
InconsistentSnapshotOnly::False,
658657
::invalidVersion,
659658
self->encryptionKeyFileName,
660-
{},
661-
TransformPartitionedLog::True));
659+
{}));
662660

663661
wait(waitForAll(restores));
664662

fdbserver/workloads/Restore.actor.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,13 @@ struct RestoreWorkload : TestWorkload {
206206
Verbose::True,
207207
Key(),
208208
Key(),
209-
LockDB::True, // self->locked,
209+
self->locked,
210210
UnlockDB::True,
211211
OnlyApplyMutationLogs::False,
212212
InconsistentSnapshotOnly::False,
213213
::invalidVersion,
214214
self->encryptionKeyFileName,
215-
{},
216-
TransformPartitionedLog::True);
215+
{});
217216

218217
wait(success(restore));
219218
ASSERT(!restore.isError());

0 commit comments

Comments
 (0)