Skip to content

Commit 0f2b559

Browse files
format
1 parent d03a905 commit 0f2b559

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

fdbbackup/backup.actor.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,9 @@ static void printBackupUsage(bool devhelp) {
11301130
"and ignore the range files.\n");
11311131
printf(" --encryption-key-file"
11321132
" The AES-256-GCM key in the provided file is used for encrypting backup files.\n"
1133-
" For modify operations, need to pass key only if Backup container URL is changed to re-encrypt all future "
1134-
"backup files. \n");
1133+
" For modify operations, need to pass encryption key file only if Backup container URL is "
1134+
"changed to "
1135+
"re-encrypt all future backup files. \n");
11351136
printf(" --encrypt-files 0/1"
11361137
" If passed, this argument will allow the user to override the database encryption state to "
11371138
"either enable (1) or disable (0) encryption at rest with snapshot backups. This option refers to block "
@@ -3033,8 +3034,10 @@ ACTOR Future<Void> modifyBackup(Database db, std::string tagName, BackupModifyOp
30333034
TraceEvent("ModifyBackupSetNewContainer")
30343035
.detail("TagName", tagName)
30353036
.detail("DestURL", options.destURL.get())
3036-
.detail("EncryptionKeyFile", options.encryptionKeyFile.present() ? options.encryptionKeyFile.get() : "None");
3037-
bc = openBackupContainer(exeBackup.toString().c_str(), options.destURL.get(), options.proxy, options.encryptionKeyFile);
3037+
.detail("EncryptionKeyFile",
3038+
options.encryptionKeyFile.present() ? options.encryptionKeyFile.get() : "None");
3039+
bc = openBackupContainer(
3040+
exeBackup.toString().c_str(), options.destURL.get(), options.proxy, options.encryptionKeyFile);
30383041
try {
30393042
wait(timeoutError(bc->create(), 30));
30403043
} catch (Error& e) {
@@ -3046,6 +3049,12 @@ ACTOR Future<Void> modifyBackup(Database db, std::string tagName, BackupModifyOp
30463049
e.what());
30473050
throw backup_error();
30483051
}
3052+
} else {
3053+
if (options.encryptionKeyFile.present()) {
3054+
fprintf(stdinfo,
3055+
" Encryption key file specified without a new destination URL."
3056+
" The encryption key will not be used.\n");
3057+
}
30493058
}
30503059

30513060
state Reference<ReadYourWritesTransaction> tr(new ReadYourWritesTransaction(db));

0 commit comments

Comments
 (0)