[MDEV-27326] Mariabackup being overwhelmed during the prepare phase while using 32GB of memory Created: 2021-12-20 Updated: 2022-04-05 Resolved: 2022-04-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup, Documentation |
| Affects Version/s: | 10.2.27 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Scott Sommerville (Inactive) | Assignee: | Geoff Montee (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
RHEL |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
During the restore step the customer was getting "Restore failed on 10.2.27 with signal 6 and 11" Oct 9 08:19:43 db166020 kernel: [5710622.181729] mariabackup[143845]: segfault at 0 ip 0000561e04a2dc88 sp 00007f2b853d97f0 error 6 in mariabackup[561e041da000+913000] Below is the stack trace from the mariabackup output:
The customer managed to capture thread dumps and the mariabakcup log, which I have attached to this ticket. Unfortunately, there was no cored dump capture during said event. Furthermore, the customer was able to avoid the mariabackup crash during the restore by increasing the previously sizeable "--use-memory" of 32GB to 256GB. However they did not see the following log:
Therefore, it does not seem related to https://jira.mariadb.org/browse/MDEV-20679 as I had initially hoped. If you require any other information, please let us know. |
| Comments |
| Comment by Marko Mäkelä [ 2022-02-17 ] | ||
|
Before Porting | ||
| Comment by Marko Mäkelä [ 2022-02-25 ] | ||
|
The mariadb-backup parameter --use-memory is equivalent to the innodb_buffer_pool_size of the server during recovery. In the implementation of log-based recovery, up to one third of that memory will be used for buffering log records, and the rest for copies of data pages. Before 10.5, it was actually quite a bit more complicated than that. First of all, a single log record could be split into multiple parts if it was longer than RECV_DATA_BLOCK_SIZE. In the I am afraid that before 10.5, it is possible (but unlikely) that recovery may run out of memory even when using the same size of buffer pool that the server was using previously. Preparing a backup is similar to executing crash recovery. The reason for this is that the enforcement of the one-third rule is somewhat inaccurate and scattered in the code. Accurate implementation of the memory limit was possible in 10.5 thanks to the data structure simplification and the rewrite of the recovery logic. Starting with 10.5, the expectation is that recovery will work even if the buffer pool size is significantly reduced, or when using an innodb_log_file_size that is several times innodb_buffer_pool_size. The latest fix The recommendation is to prepare backups with the same version of the backup tool that was used for creating a backup. Personally, I would recommend always preparing every backup, to ensure the validity of the backup. The preparation should best be run on a separate system, to avoid disturbing the database server with extra I/O and memory usage. Due to the log file format change of | ||
| Comment by Matthias Leich [ 2022-03-01 ] | ||
|
| ||
| Comment by Geoff Montee (Inactive) [ 2022-04-05 ] | ||
|
Details and recommendations about memory usage while preparing a backup have been added to the following documentation pages: |