summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2022-03-072-4/+6
|\
| * Merge 10.2 into 10.3Marko Mäkelä2022-03-042-4/+6
| |\
| | * MMDEV-27823 mariadb-install-db --group failsMonty2022-03-012-4/+6
| | | | | | | | | | | | | | | | | | Fixed by not sending --group option to the server (for now) Reviwer: Sergei Golubchik
* | | Merge 10.3 into 10.4Marko Mäkelä2022-02-254-402/+664
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2022-02-254-402/+664
| |\ \ | | |/
| | * MDEV-26377: Stricter validation of ssl-mode valuesJulius Goryavsky2022-02-234-86/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds validation of the values of the ssl-mode parameter in SSL scripts, since now only a basic check for the presence of the "VERIFY_" prefix is performed there to detect "VERIFY_IDENTITY" and "VERIFY_CA", but all other values are not checked at all. In addition, this commit removes leading and trailing spaces from parameter values that SST scripts read from configuration files or from the command line so that they do not interfere with parameter checks and substitutions. Parameter substitution has been made more robust against characters in strings that the shell might erroneously interpret as regexp.
| | * MDEV-27777: Some Galera tests fail on FreeBSDJulius Goryavsky2022-02-224-16/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes problems due to bugs and quirks in bsdtar (the FreeBSD version of tar). Separate tests are not required, because without these fixes, many other tests fail when tested in the FreeBSD environment. Also, the grep patterns for reading utility version numbers has been made more robust. The notation of some options of the "cut" utility has been changed.
| | * MDEV-27524: Incorrect binlogs after Galera SST using rsync and mariabackupJulius Goryavsky2022-02-225-413/+721
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds correct handling of binlogs for SST using rsync or mariabackup. Before this fix, binlogs were handled incorrectly - - only one (last) binary log file was transferred during SST, which then led to various failures (for example, when trying to list all events from the binary log). These bugs were long masked by flaws in the primitive binlogs handling code in the SST scripts, which causing binary logs files to be erased after transfer or not added to the binlog index on the joiner node. Now the correct transfer of all binary logs (not just the last of the binary log files) has been implemented both for the rsync (at the script level) and for the mariabackup (at the level of the main utility code). This commit also adds a new sst_max_binlogs=<n> parameter, which can be located in the [sst] section or in the [xtrabackup] section (historically, supported for mariabackup only, not for rsync), or in one of the server sections. This parameter specifies the number of binary log files to be sent to the joiner node during SST. This option is added for compatibility with old SST scripting behavior, which can be emulated by setting the sst_max_binlogs=1 (although in general this can cause problems for the reasons described above). In addition, setting the sst_max_binlogs=0 can be used to suppress the transmission of binary logs to the joiner nodes during SST (although sometimes a single file with the current binary log can still be transmitted to the joiner, even with sst_max_binlogs=0, because this sometimes necessary in modes that involve the use of GTIDs with Galera). Also, this commit ensures correct handling of paths to various innodb files and directories in the SST scripts, and fixes some problems with this that existed in mariabackup utility (which were associated with incorrect handling of the innodb_data_dir parameter in some scenarios). In addition, this commit contains the following enhancements: 1) Added tests for mtr, which check the correct work with binlogs after SST (using rsync and mariabackup); 2) Added correct handling of slashes at the end of all paths that the SST script receives as parameters; 3) Improved parsing code for --mysqld-args parameters. Now it correctly processes the sequence "--" after the name of the one-letter option; 4) Checking the secret signature during joiner authentication is made independent of presence of bash (as a unix shell) in the system and diff utility no longer needed to check certificates compliance; 5) All directories that are necessary for the correct placement of various logs are automatically created by SST scripts in advance (before running mariabackup on the joiner node); 6) Removal of old binary logs on joiner is done using the binlog index (if it exists) (not only by fixed pattern that based on the current binlog name, as before); 7) Paths for placing binary logs are correctly processed if they are set as relative paths (to the datadir); 8) SST scripts are made even more resistant to spaces in filenames (now for binlogs); 9) In case of failure, SST scripts now always end with an exit code other than zero; 10) SST script for rsync now correctly create a tar file with the binlogs, even if the paths to them (in the binlog index file) are specified as a mix of absolute and relative paths, and even if they do not match with the datadir path specified in the current configuration settings.
* | | Merge branch '10.3' into 10.4mariadb-10.4.24Sergei Golubchik2022-02-103-4/+12
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3mariadb-10.3.34Sergei Golubchik2022-02-103-4/+12
| |\ \ | | |/
| | * MDEV-27737 Wsrep SST scripts not working on FreeBSDbb-10.2-galeraTeemu Ollakka2022-02-083-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Changed SST scripts to use /usr/bin/env bash instead of /bin/bash for better portability. - Fixed use of mktemp on non-Linux platforms to produce temporary file instead of directory. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2022-01-304-14/+131
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3mariadb-10.3.33Oleksandr Byelkin2022-01-293-5/+31
| |\ \ | | |/
| | * Silence the file-key-management plugin during mysql_install_dbMonty2022-01-271-1/+1
| | | | | | | | | | | | | | | | | | This avoids printing the error "mysqld: file-key-management-filename is not set" which can happen if the file-key-management pluging is statically compiled
| | * Remove --upgrade-info option from mysql_upgradeMonty2022-01-271-6/+0
| | | | | | | | | | | | | | | | | | Removed the option as it safe to always create the file when we have created the MariaDB data directories. This fixes this issue not only for debian but for all MariaDB users.
| | * MDEV-27477 Remaining SUSE patches for 10.2+Monty2022-01-273-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch let's you specify not only user to use but also group that MariaDB should use. Original patch: https://github.com/openSUSE/mysql-packaging/blob/master/patches/mysql-patches/mariadb-10.2.3-group.patch Author: Kristyna Streitova Reviewer: monty@mariadb.org
| | * MDEV-27607: mysql_install_db to install mysql_upgrade_infoDaniel Black2022-01-271-0/+7
| | | | | | | | | | | | | | | | | | | | | For compatibility this is under an extra option --upgrade-info The goal here is to install a data directory with the required info to let mysql_upgrade know that an upgrade isn't required.
| * | MDEV-27477 Remaining SUSE patches for 10.2+Monty2022-01-271-9/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds reload and --datadir functionality to mysqld_multi Increased version to 3.0 Source: https://github.com/openSUSE/mysql-packaging/blob/master/patches/mysql-patches/mariadb-10.0.15-mysqld_multi-features.patch Author: Michal Hrusecky <Michal.Hrusecky@opensuse.org> Reviewer: monty@mariadb.org
* | | Merge branch 10.3 into 10.4Julius Goryavsky2021-12-253-206/+206
|\ \ \ | |/ /
| * | Merge branch 10.2 into 10.3st-10.3-juliusJulius Goryavsky2021-12-243-206/+206
| |\ \ | | |/
| | * MDEV-24097: galera[_3nodes] suite tests in MTR sporadically failsbb-10.2-MDEV-24097-galeraJulius Goryavsky2021-12-234-277/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first part of the fixes for MDEV-24097. This commit contains the fixes for instability when testing Galera and when restarting nodes quickly: 1) Protection against a "stuck" old SST process during the execution of the new SST (after restarting the node) is now implemented for mariabackup / xtrabackup, which should help to avoid almost all conflicts due to the use of the same ports - both during testing with mtr, so and when restarting nodes quickly in a production environment. 2) Added more protection to scripts against unexpected return of the rc != 0 (in the commands for deleting temporary files, etc). 3) Added protection against unexpected crashes during binlog transfer (in SST scripts for rsync). 4) Spaces and some special characters in binlog filenames shouldn't be a problem now (at the script level). 5) Daemon process termination tracking has been made more robust against crashes due to unexpected termination of the previous SST process while new scripts are running. 6) Reading ssl encryption parameters has been moved from specific SST scripts to a common wsrep_sst_common.sh script, which allows unified error handling, unified diagnostics and simplifies script revisions in the future. 7) Improved diagnostics of errors related to the use of openssl. 8) Corrections have been made for xtrabackup-v2 (both in tests and in the script code) that restore the work of xtrabackup with updated versions of innodb. 9) Fixed some tests for galera_3nodes, although the complete solution for the problem of starting three nodes at the same time on fast machines will be done in a separate commit. No additional tests are required as this commit fixes problems with existing tests.
| * | Merge branch 10.2 into 10.3Julius Goryavsky2021-12-231-1/+1
| |\ \ | | |/
| | * MDEV-27181 fixup: compatibility with Windows + small correctionsbb-10.2-MDEV-27181-fixJulius Goryavsky2021-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | 1) Removed symlinks that are not very well supported in tar under Windows. 2) Added comment + changed code formatting in viosslfactories.c 3) Fixed a small bug in the yassl code. 4) Fixed a typo in the script code.
| | * MDEV-27181: Galera SST scripts should use ssl_capath for CA directorybb-10.2-MDEV-27181-galeraJulius Goryavsky2021-12-146-400/+488
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA directory. The current implementation tries to automatically detect the path using the trailing slash in the ssl_ca variable value, but this approach is not compatible with the server configuration. Now, by analogy with the server, SST scripts also use a separate ssl_capath variable. In addition, a similar tcapath variable has been added for the old-style configuration (in the "sst" section). 2. Openssl utility detection made more reliable. 3. Removed extra spaces in automatically generated command lines - to simplify debugging of the SST scripts. 4. In general, the code for detecting the presence or absence of auxiliary utilities has been improved - it is made more reliable in some configurations (and for shells other than bash).
| * | MDEV-27181: Galera SST scripts should use ssl_capath for CA directorybb-10.3-MDEV-27181-galeraJulius Goryavsky2021-12-144-248/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA directory. The current implementation tries to automatically detect the path using the trailing slash in the ssl_ca variable value, but this approach is not compatible with the server configuration. Now, by analogy with the server, SST scripts also use a separate ssl_capath variable. In addition, a similar tcapath variable has been added for the old-style configuration (in the "sst" section). 2. Openssl utility detection made more reliable. 3. Removed extra spaces in automatically generated command lines - to simplify debugging of the SST scripts. 4. In general, the code for detecting the presence or absence of auxiliary utilities has been improved - it is made more reliable in some configurations (and for shells other than bash).
* | | MDEV-27181: Galera SST scripts should use ssl_capath for CA directorybb-10.4-MDEV-27181-galeraJulius Goryavsky2021-12-144-248/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA directory. The current implementation tries to automatically detect the path using the trailing slash in the ssl_ca variable value, but this approach is not compatible with the server configuration. Now, by analogy with the server, SST scripts also use a separate ssl_capath variable. In addition, a similar tcapath variable has been added for the old-style configuration (in the "sst" section). 2. Openssl utility detection made more reliable. 3. Removed extra spaces in automatically generated command lines - to simplify debugging of the SST scripts. 4. In general, the code for detecting the presence or absence of auxiliary utilities has been improved - it is made more reliable in some configurations (and for shells other than bash).
* | | Merge 10.3 into 10.4Marko Mäkelä2021-11-291-4/+2
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-11-294-12/+34
| |\ \ | | |/
| | * mysql_install_db: remove MySQL referencesDaniel Black2021-11-241-4/+2
| | | | | | | | | | | | | | | MySQL documentation isn't going to help our users and we shouldn't refer to it.
| | * MDEV-26915: SST scripts do not take log_bin_index setting into accountbb-10.2-MDEV-26915-galeraJulius Goryavsky2021-11-234-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, SST scripts assume that the filename specified in the --log-bin-index argument either does not contain an extension or uses the standard ".index" extension. Similar assumptions are used for the log_bin_index parameter read from the configuration file. This commit adds support for arbitrary extensions for the index file paths.
| | * MDEV-26064: mariabackup SST fails when starting with --innodb-force-recoveryJulius Goryavsky2021-11-233-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the server is started with the --innodb-force-recovery argument on the command line, then during SST this argument can be passed to mariabackup only at the --prepare stage, and accordingly it must be removed from the --mysqld-args list (and it is not should be passed to mariabackup otherwise). This commit fixes a flaw in the SST scripts and add a test that checks the ability to run the joiner node in a configuration that uses --innodb-force-recovery=1.
* | | MDEV-27124: Update definer of Add/DropGeometryColumn procedures from 'root' ↵Hugo Wen2021-11-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to 'mariadb.sys' From 10.4.13, the `mariadb.sys` user was created to replace `root` definers. - In commit 0253ea7f2208354b187ffcfa2f3128878597cc11, definer of Add/DropGeometryColumn procedures was changed to `mariadb.sys`, in `scripts/maria_add_gis_sp.sql.in`. However, maria_add_gis_sp.sql only applies to new databases created by installation script. Databases upgraded from old versions will miss this change. - In addition, according to commit 0d6d801e5886208b2632247d88da106a543e1032(MDEV-23102), in some scenarios when root user is replaced it will skip creating `mariadb.sys` user. This commit is to update the definer from `root` to `mariadb.sys` during upgrade. It only makes the change if the original definers are root. Doesn't choose to execute `maria_add_gis_sp.sql` in upgrade script to recreate the procedures is because of considering the scenarios of MDEV-23102 that `root` user is replaced and `mariadb.sys` is not created. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
* | | MDEV-26915 post-fix: deleted unnecessary filebb-10.4-MDEV-26915-galeraJulius Goryavsky2021-11-231-1405/+0
| | |
* | | MDEV-26915: SST scripts do not take log_bin_index setting into accountJulius Goryavsky2021-11-234-7/+1422
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, SST scripts assume that the filename specified in the --log-bin-index argument either does not contain an extension or uses the standard ".index" extension. Similar assumptions are used for the log_bin_index parameter read from the configuration file. This commit adds support for arbitrary extensions for the index file paths.
* | | MDEV-26064: mariabackup SST fails when starting with --innodb-force-recoverybb-10.4-MDEV-26064-galeraJulius Goryavsky2021-11-232-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the server is started with the --innodb-force-recovery argument on the command line, then during SST this argument can be passed to mariabackup only at the --prepare stage, and accordingly it must be removed from the --mysqld-args list (and it is not should be passed to mariabackup otherwise). This commit fixes a flaw in the SST scripts and add a test that checks the ability to run the joiner node in a configuration that uses --innodb-force-recovery=1.
* | | MDEV-26363 Passwords incorrectly expiring after MySQL5.7 -> MariaDB10.3 -> ↵bb-10.4-MDEV-26363-danielblack-zero_last_password_changedDaniel Black2021-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 10.4+ upgrades MySQL-5.7 mysql.user tables have a last_password_changed field. Because before MariaDB-10.4 remained oblivious to this, the act of creating users or otherwise changing a users row left the last_password_field with 0. Running a MariaDB-10.4 instance on this would work correctly, until mysql_upgrade is run, when this 0 value immediately translates to password expired state. MySQL-5.7 relied on the password_expired enum to indicate password expiry so we aren't going to activate password that were expired in MySQL-5.7. Thanks Hans Borresen for the bug report and review of the fix.
* | | Merge 10.3 into 10.4Marko Mäkelä2021-09-243-42/+92
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-09-243-42/+92
| |\ \ | | |/
| | * MDEV-26360: Using hostnames breaks certificate validationbb-10.2-MDEV-26360-galeraJulius Goryavsky2021-09-244-59/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed flaws with overly strict or, conversely, overly soft verification of certificates in some scenarios: 1. Removed the check that the 'commonname' (CN) in the certificate matches the 'localhost' value on the side of the joiner node, which was performed earlier, even if the address was received by the script only as an argument (out of the exchange via the Galera protocol) - since for the joining node this argument always contains its own local address, not the address of the remote host, so it is always treated as 'localhost', which is not necessarily true (outside of mtr testing); 2. Removed checking the domain name or IP-address of the peer node in the encrypt=2 mode; 3. Fixed checking of compliance of certificates when rsync SST is used; 4. Added the ability to specify CA not only as a file, but also as a path to the directory where the certificates are stored. To do this, the user just needs to specify the path to this directory as the value ssl-ca or tca parameter, ending with the '/' character.
* | | Merge 10.3 into 10.4Marko Mäkelä2021-09-222-2/+6
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-09-222-2/+6
| |\ \ | | |/
| | * MDEV-26441: Linux-dependent construct in SST scriptsbb-10.2-MDEV-26441-galeraJulius Goryavsky2021-09-203-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | SST scripts currently use Linux-specific construction to create a temporary directory if the path prefix for that directory is specified by the user. This does not work with FreeBSD. This commit adds support for FreeBSD. No separate test required.
* | | Merge 10.3 into 10.4Marko Mäkelä2021-08-311-2/+6
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-08-311-2/+6
| |\ \ | | |/
| | * Remove FLUSH PRIVILEGES from mysql_setpermissionMarek Kulik2021-08-251-1/+0
| | | | | | | | | | | | FLUSH PRIVILEGES hasn't been needed for very many years.
| | * Fix mysql_setpermission hostname logicMarek Kulik2021-08-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - Don't include port in connection parameters with 'localhost' hostname More info: The hostname, if not specified or specified as '' or 'localhost', will default to a MySQL server running on the local machine using the default for the UNIX socket. To connect to a MySQL server on the local machine via TCP, you must specify the loopback IP address (127.0.0.1) as the host. Reported issue: https://bugzilla.redhat.com/show_bug.cgi?id=1976224
* | | Merge 10.3 into 10.4Marko Mäkelä2021-08-183-18/+50
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2021-08-183-18/+50
| |\ \ | | |/ | | | | | | MDEV-18734 FIXME: vcol.partition triggers ASAN heap-use-after-free
| | * MDEV-26101: Galera WSREP SST broken on 10.6 under FreeBSDJulius Goryavsky2021-08-162-2/+16
| | | | | | | | | | | | | | | | | | This commit fixes a call to the sockstat utility for FreeBSD, where this utility requires an extra "-s" parameter to display the connection status and prints one extra column.
| | * MDEV-26340: rsync uses `--whole-file` only in wan modeJulius Goryavsky2021-08-151-1/+1
| | | | | | | | | | | | | | | This commit fixes a mistake where the --whole-file option is used by rsync SST in WAN mode instead of LAN.