From 49bf832f97deb7d2be2a5db39337385e1c50f34b Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Fri, 29 Nov 2019 14:11:58 +0100 Subject: [PATCH] Finalize documentation of --force flag for hotbackup. This now contains a stern warning hopefully convincing customers not to use this option. --- .../Rest/BackupRestore/post_admin_backup_create.md | 11 +++++++++++ arangosh/Backup/BackupFeature.cpp | 8 ++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_create.md b/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_create.md index 496c48c68a..3ea71fcd3c 100644 --- a/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_create.md +++ b/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_create.md @@ -28,6 +28,17 @@ acquired within the given timeout, a possibly inconsistent backup is taken. The default for this flag is `false` and in this case a timeout results in an HTTP 408 error. +@RESTBODYPARAM{force,boolean,optional,boolean} +If this flag is set to `true` and no global transaction lock can be +acquired within the given timeout, all running transctions are +forcefully aborted to ensure that a consistent backup can be created. +This option is rather brutal and almost certainly not what your application +is going to like. In the presence of intermediate commits it can even +destroy the atomicity of your transactions. Use at your own risk, and only +if you need a consistent backup at all costs. The default and recommended value is `false`. If both +`allowInconsistent` and `force` are set to `true`, then the latter +takes precedence and transactions are aborted. + @RESTRETURNCODES @RESTRETURNCODE{201} diff --git a/arangosh/Backup/BackupFeature.cpp b/arangosh/Backup/BackupFeature.cpp index 45355de93c..60550fbbe0 100644 --- a/arangosh/Backup/BackupFeature.cpp +++ b/arangosh/Backup/BackupFeature.cpp @@ -736,8 +736,12 @@ void BackupFeature::collectOptions(std::shared_ptr opti new BooleanParameter(&_options.abort)); options->addOption("--force", - "abort transactions if needed to ensure a consistent snapshot" - "(create operation)", + "abort transactions if needed to ensure a consistent snapshot." + " (create operation).", + " Note that this is rather brutal and is almost certainly not what your " + "application is going to like. In the presence of intermediate commits using " + "this option can even destroy the atomicity of your transactions. Use at your " + "own risk and only if you really need a consistent backup at all costs." new BooleanParameter(&_options.abortTransactionsIfNeeded)); #endif /*