Till recently (I assume until MDEV-18215) one could override encryption options specified in the generated cnf file from the command line. It is convenient, for example, when you move the backup between hosts or environments, and paths change. It could look like this (notice file-key-management-filename treatment):
10.4 9d479e25
|
$ /data/bld/10.4-debug/bin/mariabackup --prepare --use-memory=1073741824 --innodb-file-io-threads=1 --target-dir=`pwd`/mdev23115/backup_before_prepare_0 --file-key-management-filename=`pwd`/mysql-test/std_data/keys.txt --plugin-dir=`pwd`/lib/plugin
|
Warning: option 'innodb_file_io_threads': signed value 1 adjusted to 4
|
/data/bld/10.4-debug/bin/mariabackup based on MariaDB server 10.4.14-MariaDB Linux (x86_64)
|
[00] 2020-07-07 21:13:56 cd to /data/bld/10.5-debug-nightly/mdev23115/backup_before_prepare_0/
|
[00] 2020-07-07 21:13:56 Loading encryption plugin from file_key_management=file_key_management
|
[00] 2020-07-07 21:13:56 Loading encryption plugin
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--plugin_load=file_key_management=file_key_management'
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--file_key_management_encryption_algorithm=aes_cbc'
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--file_key_management_filekey='
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--file_key_management_filename=/xxhome/mdbe/data/file_key_management_keys.txt'
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--innodb_encrypt_log=1'
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--prepare'
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--use-memory=1073741824'
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--target-dir=/data/bld/10.5-debug-nightly/mdev23115/backup_before_prepare_0'
|
[00] 2020-07-07 21:13:56 Encryption plugin parameter : '--file-key-management-filename=/data/bld/10.5-debug-nightly/mysql-test/std_data/keys.txt'
|
...
|
[00] 2020-07-07 21:13:58 completed OK!
|
Now I don't seem to be able to do it anymore.
If I try to put it on the command line as a "regular" mariabackup option, it rejects it:
10.5 ee584137
|
$ /data/bld/10.5-debug-nightly/bin/mariabackup --prepare --use-memory=1073741824 --innodb-file-io-threads=1 --target-dir=`pwd`/mdev23115/backup_before_prepare_0 --file-key-management-filename=`pwd`/mysql-test/std_data/keys.txt --plugin-dir=`pwd`/lib/plugin
|
Warning: option 'innodb_file_io_threads': signed value 1 adjusted to 4
|
Warning: option 'innodb_file_io_threads': signed value 1 adjusted to 4
|
/data/bld/10.5-debug-nightly/bin/mariabackup: unknown variable 'file-key-management-filename=/data/bld/10.5-debug-nightly/mysql-test/std_data/keys.txt'
|
And if I put it after mysqld-args, it gets ignored and the one from the cnf file is still used:
$ /data/bld/10.5-debug-nightly/bin/mariabackup --prepare --use-memory=1073741824 --innodb-file-io-threads=1 --target-dir=`pwd`/mdev23115/backup_before_prepare_0 --plugin-dir=`pwd`/lib/plugin --mysqld-args --file-key-management-filename=`pwd`/mysql-test/std_data/keys.txt
|
Warning: option 'innodb_file_io_threads': signed value 1 adjusted to 4
|
Warning: option 'innodb_file_io_threads': signed value 1 adjusted to 4
|
/data/bld/10.5-debug-nightly/bin/mariabackup based on MariaDB server 10.5.5-MariaDB Linux (x86_64)
|
[00] 2020-07-07 21:22:15 cd to /data/bld/10.5-debug-nightly/mdev23115/backup_before_prepare_0/
|
[00] 2020-07-07 21:22:15 Loading encryption plugin from file_key_management=file_key_management
|
[00] 2020-07-07 21:22:15 Loading encryption plugin
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--plugin_load=file_key_management=file_key_management'
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--file_key_management_encryption_algorithm=aes_cbc'
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--file_key_management_filekey='
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--file_key_management_filename=/xxhome/mdbe/data/file_key_management_keys.txt'
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--innodb_encrypt_log=1'
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--prepare'
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--use-memory=1073741824'
|
[00] 2020-07-07 21:22:15 Encryption plugin parameter : '--target-dir=/data/bld/10.5-debug-nightly/mdev23115/backup_before_prepare_0'
|
/data/bld/10.5-debug-nightly/bin/mariabackup: Can't find file: '/xxhome/mdbe/data/file_key_management_keys.txt' (errno: 2 "No such file or directory")
|
{"report":{"fcp":1909.5,"ttfb":602.6000003814697,"pageVisibility":"visible","entityId":89250,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"4121af24-28a5-4b5d-9ca1-a010e03f8006","navigationType":0,"readyForUser":2019.5,"redirectCount":0,"resourceLoadedEnd":4742.400000095367,"resourceLoadedStart":610.4000000953674,"resourceTiming":[{"duration":443.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":610.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":610.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1053.5,"responseStart":0,"secureConnectionStart":0},{"duration":443.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":610.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":610.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1053.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":445.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":610.8000001907349,"connectEnd":610.8000001907349,"connectStart":610.8000001907349,"domainLookupEnd":610.8000001907349,"domainLookupStart":610.8000001907349,"fetchStart":610.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":610.8000001907349,"responseEnd":1056,"responseStart":1056,"secureConnectionStart":610.8000001907349},{"duration":509.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":611,"connectEnd":611,"connectStart":611,"domainLookupEnd":611,"domainLookupStart":611,"fetchStart":611,"redirectEnd":0,"redirectStart":0,"requestStart":611,"responseEnd":1120.7000002861023,"responseStart":1120.7000002861023,"secureConnectionStart":611},{"duration":577.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":611.1000003814697,"connectEnd":611.1000003814697,"connectStart":611.1000003814697,"domainLookupEnd":611.1000003814697,"domainLookupStart":611.1000003814697,"fetchStart":611.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":611.1000003814697,"responseEnd":1188.2000002861023,"responseStart":1188.2000002861023,"secureConnectionStart":611.1000003814697},{"duration":577.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":611.3000001907349,"connectEnd":611.3000001907349,"connectStart":611.3000001907349,"domainLookupEnd":611.3000001907349,"domainLookupStart":611.3000001907349,"fetchStart":611.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":611.3000001907349,"responseEnd":1188.6000003814697,"responseStart":1188.6000003814697,"secureConnectionStart":611.3000001907349},{"duration":578,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":611.4000000953674,"connectEnd":611.4000000953674,"connectStart":611.4000000953674,"domainLookupEnd":611.4000000953674,"domainLookupStart":611.4000000953674,"fetchStart":611.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":611.4000000953674,"responseEnd":1189.4000000953674,"responseStart":1189.4000000953674,"secureConnectionStart":611.4000000953674},{"duration":698,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":611.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":611.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1309.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":578.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":611.8000001907349,"connectEnd":611.8000001907349,"connectStart":611.8000001907349,"domainLookupEnd":611.8000001907349,"domainLookupStart":611.8000001907349,"fetchStart":611.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":611.8000001907349,"responseEnd":1189.9000000953674,"responseStart":1189.9000000953674,"secureConnectionStart":611.8000001907349},{"duration":697.8000001907349,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":611.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":611.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1309.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":578.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":612.1000003814697,"connectEnd":612.1000003814697,"connectStart":612.1000003814697,"domainLookupEnd":612.1000003814697,"domainLookupStart":612.1000003814697,"fetchStart":612.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":612.1000003814697,"responseEnd":1190.9000000953674,"responseStart":1190.9000000953674,"secureConnectionStart":612.1000003814697},{"duration":3460.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":641.8000001907349,"connectEnd":641.8000001907349,"connectStart":641.8000001907349,"domainLookupEnd":641.8000001907349,"domainLookupStart":641.8000001907349,"fetchStart":641.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":641.8000001907349,"responseEnd":4102.700000286102,"responseStart":4102.700000286102,"secureConnectionStart":641.8000001907349},{"duration":4001.699999809265,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":648.6000003814697,"connectEnd":648.6000003814697,"connectStart":648.6000003814697,"domainLookupEnd":648.6000003814697,"domainLookupStart":648.6000003814697,"fetchStart":648.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":648.6000003814697,"responseEnd":4650.300000190735,"responseStart":4650.300000190735,"secureConnectionStart":648.6000003814697},{"duration":2781.6000003814697,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1335,"connectEnd":1335,"connectStart":1335,"domainLookupEnd":1335,"domainLookupStart":1335,"fetchStart":1335,"redirectEnd":0,"redirectStart":0,"requestStart":1335,"responseEnd":4116.60000038147,"responseStart":4116.60000038147,"secureConnectionStart":1335},{"duration":2991.8999996185303,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1754.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1754.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":4746.5,"responseStart":0,"secureConnectionStart":0},{"duration":620.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":4121.60000038147,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":4121.60000038147,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":4742.400000095367,"responseStart":0,"secureConnectionStart":0},{"duration":538.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":4122.60000038147,"connectEnd":4122.60000038147,"connectStart":4122.60000038147,"domainLookupEnd":4122.60000038147,"domainLookupStart":4122.60000038147,"fetchStart":4122.60000038147,"redirectEnd":0,"redirectStart":0,"requestStart":4122.60000038147,"responseEnd":4660.800000190735,"responseStart":4660.800000190735,"secureConnectionStart":4122.60000038147},{"duration":540.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":4123,"connectEnd":4123,"connectStart":4123,"domainLookupEnd":4123,"domainLookupStart":4123,"fetchStart":4123,"redirectEnd":0,"redirectStart":0,"requestStart":4123,"responseEnd":4663.300000190735,"responseStart":4663.300000190735,"secureConnectionStart":4123}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":435,"responseStart":603,"responseEnd":650,"domLoading":609,"domInteractive":4954,"domContentLoadedEventStart":4954,"domContentLoadedEventEnd":5011,"domComplete":5383,"loadEventStart":5383,"loadEventEnd":5384,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":4870.300000190735},{"name":"bigPipe.sidebar-id.end","time":4871.200000286102},{"name":"bigPipe.activity-panel-pipe-id.start","time":4871.400000095367},{"name":"bigPipe.activity-panel-pipe-id.end","time":4873.400000095367},{"name":"activityTabFullyLoaded","time":5030.900000095367}],"measures":[],"correlationId":"2959eceb143c4b","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Encryption plugin is initialized from xtrabackup_prepare_func():
â–¾ encryption_plugin_init
â–¾ encryption_plugin_prepare_init
â–¾ xtrabackup_prepare_func
â–¾ main_low
• main
But the options are parsed before xtrabackup_prepare_func() call, in handle_options(), which is invoked from main().
The fix can be in moving encryption_plugin_prepare_init() call from xtrabackup_prepare_func() to handle_options().