[MDEV-26322] Last binlog file and position are "empty" in mariabackup --prepare output Created: 2021-08-09 Updated: 2022-04-05 Resolved: 2022-04-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | mariabackup |
| Affects Version/s: | 10.5.7, 10.5.9, 10.5.13, 10.5, 10.6 |
| Fix Version/s: | 10.5.16, 10.6.8, 10.7.4, 10.8.3, 10.9.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Vladislav Lesin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression-10.5 | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Normally (till 10.5.x) mariabackup prepare stage reports last binlog file and position at the end, for example:
But in 10.5.x it's reported as "empty":
It looks like a regression bug, but maybe there is a good reason NOT to report it (where is it documented then?) In the latter case why this output appears at the log at all? It adds no value, just a confusion. See also MDEV-21611 and related bugs there. Cross checking vs the information reported at --backup stage and xtrabackup_binlog_info is important for troubleshooting in some cases. |
| Comments |
| Comment by Marko Mäkelä [ 2021-08-26 ] | |||||||||||||||||||||||||||||||||||||||||
|
The function trx_rseg_update_binlog_offset() is still there, but it was refactored in 10.5 by | |||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-08-26 ] | |||||||||||||||||||||||||||||||||||||||||
|
alice, can you try to produce an mtr test case for this? I just checked
in a 10.6-based branch (which I believed to be similar enough to 10.5) and I do see the information being filled in. So, it is not obviously broken in the database server.
Maybe it is broken somewhere else. Maybe Mariabackup is not copying the binlog files? I am not too familiar with the binlog, so I would appreciate a self-contained test case that I can execute in mtr. | |||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2021-09-03 ] | |||||||||||||||||||||||||||||||||||||||||
|
marko, I repeated on 10.5-10.6, 10.4 indeed reports position, while 10.5 shows 0. for mtr I used mariabackup.binlog test - just check /mysql-test/var/log/mysqltest.log after running the test - it shows "Last binlog file , position 0" | |||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-09-03 ] | |||||||||||||||||||||||||||||||||||||||||
|
I diagnosed this with the following patch:
According to the rr replay, we do not initialize the variables at all:
In 10.4, the initialization happens with the following stack trace:
This was broken in MariaDB Server 10.5.7 by a change that aimed to speed up Mariabackup. I think that it should suffice to read the binlog information from the rollback segment header pages, without reading all the undo pages that are reachable via the header pages. I think that this is a regression that deserves to be fixed. It is a separate discussion whether a future major release could stop storing binlog information in InnoDB. | |||||||||||||||||||||||||||||||||||||||||
| Comment by Vladislav Lesin [ 2022-03-30 ] | |||||||||||||||||||||||||||||||||||||||||
|
marko, yes, you are correct, the cause of the bug is 59a0236da4810a5ae243e77cb7a9c6262639a6e4. But I don't understand why this commit was necessary, because both trx_lists_init_at_db_start() and trx_rseg_mem_restore() contain special cases for srv_operation == SRV_OPERATION_RESTORE condition, and on this condition only rseg headers are read:
So the fix I propose is to revert that commit. The only doubt I have is the reason of that commit. Was there any performance testing or support cases which caused that fix? Note: binlog position is written with trx_rseg_update_binlog_offset(). | |||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-04-01 ] | |||||||||||||||||||||||||||||||||||||||||
|
vlad.lesin, you are right, that change should be reverted and a test case be added, so that this bug will not be reintroduced again. I did not realize that we actually must read the rollback segment header pages so that the binlog position can be reported. The call trx_rseg_read_wsrep_checkpoint() probably is unnecessary in mariadb-backup, but it should not incur significant additional cost. The bulk of the cost should be reading the 128 rollback segment header pages. |