@@ -277,10 +277,13 @@ arangodb::Result executeCreate(arangodb::httpclient::SimpleHttpClient& client,
277
277
{
278
278
VPackObjectBuilder guard (&bodyBuilder);
279
279
bodyBuilder.add (" timeout" , VPackValue (options.maxWaitForLock ));
280
- bodyBuilder.add (" allowInconsistent" , VPackValue (options.force ));
280
+ bodyBuilder.add (" allowInconsistent" , VPackValue (options.allowInconsistent ));
281
281
if (!options.label .empty ()) {
282
282
bodyBuilder.add (" label" , VPackValue (options.label ));
283
283
}
284
+ if (options.abortTransactionsIfNeeded ) {
285
+ bodyBuilder.add (" force" , VPackValue (true ));
286
+ }
284
287
}
285
288
std::string const body = bodyBuilder.slice ().toJson ();
286
289
std::unique_ptr<arangodb::httpclient::SimpleHttpResult> response (
@@ -361,8 +364,7 @@ arangodb::Result executeRestore(arangodb::httpclient::SimpleHttpClient& client,
361
364
{
362
365
VPackObjectBuilder guard (&bodyBuilder);
363
366
bodyBuilder.add (" id" , VPackValue (options.identifier ));
364
- bodyBuilder.add (" saveCurrent" , VPackValue (options.saveCurrent ));
365
- if (options.force ) {
367
+ if (options.ignoreVersion ) {
366
368
bodyBuilder.add (" ignoreVersion" , VPackValue (true ));
367
369
}
368
370
}
@@ -383,33 +385,6 @@ arangodb::Result executeRestore(arangodb::httpclient::SimpleHttpClient& client,
383
385
return result;
384
386
}
385
387
386
- if (options.saveCurrent ) {
387
- VPackSlice const resBody = parsedBody->slice ();
388
- if (!resBody.isObject ()) {
389
- result.reset (TRI_ERROR_INTERNAL, " expected response to be an object" );
390
- return result;
391
- }
392
- TRI_ASSERT (resBody.isObject ());
393
-
394
- VPackSlice const resultObject = resBody.get (" result" );
395
- if (!resultObject.isObject ()) {
396
- result.reset (TRI_ERROR_INTERNAL, " expected 'result' to be an object" );
397
- return result;
398
- }
399
- TRI_ASSERT (resultObject.isObject ());
400
-
401
- VPackSlice const previous = resultObject.get (" previous" );
402
- if (!previous.isString ()) {
403
- result.reset (TRI_ERROR_INTERNAL, " expected previous to be a string" );
404
- return result;
405
- }
406
- TRI_ASSERT (previous.isString ());
407
-
408
- LOG_TOPIC (" 08c95" , INFO, arangodb::Logger::BACKUP)
409
- << " current state was saved as backup with identifier '"
410
- << previous.copyString () << " '" ;
411
- }
412
-
413
388
LOG_TOPIC (" b6d4c" , INFO, arangodb::Logger::BACKUP)
414
389
<< " Successfully restored '" << options.identifier << " '" ;
415
390
@@ -706,7 +681,12 @@ void BackupFeature::collectOptions(std::shared_ptr<options::ProgramOptions> opti
706
681
options->addOption (" --allow-inconsistent" ,
707
682
" whether to attempt to continue in face of errors; "
708
683
" may result in inconsistent backup state (create operation)" ,
709
- new BooleanParameter (&_options.force ));
684
+ new BooleanParameter (&_options.allowInconsistent ));
685
+
686
+ options->addOption (" --ignore-version" ,
687
+ " ignore stored version of a backup"
688
+ " restore may not work if version mismatch (restore operation)" ,
689
+ new BooleanParameter (&_options.ignoreVersion ));
710
690
711
691
options->addOption (" --identifier" ,
712
692
" a unique identifier for a backup "
@@ -734,10 +714,6 @@ void BackupFeature::collectOptions(std::shared_ptr<options::ProgramOptions> opti
734
714
"
6D40
span>result of the restore request (restore operation)" ,
735
715
new DoubleParameter (&_options.maxWaitForRestart ));
736
716
737
- options->addOption (" --save-current" ,
738
- " whether to save the current state as a backup before "
739
- " restoring to another state (restore operation)" ,
740
- new BooleanParameter (&_options.saveCurrent ));
741
717
#ifdef USE_ENTERPRISE
742
718
options->addOption (" --status-id" ,
743
719
" returns the status of a transfer process "
@@ -758,6 +734,11 @@ void BackupFeature::collectOptions(std::shared_ptr<options::ProgramOptions> opti
758
734
" abort transfer with given status-id "
759
735
" (upload/download operation)" ,
760
736
new BooleanParameter (&_options.abort ));
737
+
738
+ options->addOption (" --force" ,
739
+ " abort transactions if needed to ensure a consistent snapshot"
740
+ " (create operation)" ,
741
+ new BooleanParameter (&_options.abortTransactionsIfNeeded ));
761
742
#endif
762
743
/*
763
744
options->addSection(
0 commit comments