[MDEV-27343] Useless warning "InnoDB: Allocated tablespace ID <id> for <tablename>, old maximum was 0" during backup stage Created: 2021-12-22 Updated: 2022-06-03 Resolved: 2022-04-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | mariabackup, Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9 |
| Fix Version/s: | 10.2.44, 10.3.35, 10.4.25, 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: | None | ||
| Description |
|
We can often see warnings like this:
upon startup of MariaDB server (after crash recovery, while preparing the backup etc). What is the point to warn DBA about this? From quick code review (see fil_space_create( ) function, storage/innobase/fil/fil0fil.cc line 1254 in current 10.4 on GitHub, for example) it seems to be written once as soon as there is any other tablespace that the 0 one. Next tablespace will produce no warning. So, why is it a warning, not even Info, and what is the point to give it (and then suppress in the tests)? If the warning is something to ignore, can we get rid of it in non-debug builds or in mariabackup at least? If it has a point, can we document what does it mean for production DBA? |
| Comments |
| Comment by Valerii Kravchuk [ 2022-01-03 ] | |||||||||||||||||||||||
|
We have plenty of MTR test cases where this warning is suppressed. Take innodb.innodb_force_recovery as an example, this one: https://github.com/MariaDB/server/blob/10.4/mysql-test/suite/innodb/t/innodb_force_recovery.test and comment out line 9 there:
Then save it and run the test as usual. You'll see several warnings like those the bug report is about (1 for t1 table and 2 for t2 table in case of 10.4.23 built from GitHub source). As this happens during recovery, I think it's close enough to customer use case. | |||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-01-12 ] | |||||||||||||||||||||||
|
valerii, those tests are for crash recovery and not applying a backup. Possibly the warning is useless altogether. There used to be problems related to this in MySQL 5.1 or 5.5 when the InnoDB was killed during crash recovery. That is why the warning message was added. I believe that problems are unlikely, given that a persistent sequence of tablespace IDs (DICT_HDR_MAX_SPACE_ID) was added a long time ago. Furthermore, the MLOG_FILE_NAME record that was introduced in 10.2.2 and renamed to FILE_MODIFY in In any case, I would not remove the warning without carefully analyzing under which circumstances the warnings are being issued. | |||||||||||||||||||||||
| Comment by Vladislav Lesin [ 2022-02-02 ] | |||||||||||||||||||||||
|
I agree with marko, we need to understand when the warning is issued. If the warning still makes sense, we need more detailed explanation in diagnostics message what does it mean and what to do next. | |||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-02-08 ] | |||||||||||||||||||||||
|
The following observation on buildbot suggests that removing this message might not be that trivial:
| |||||||||||||||||||||||
| Comment by Vladislav Lesin [ 2022-03-29 ] | |||||||||||||||||||||||
|
valerii, I have just checked innodb.innodb_force_recovery test you referred to. It issues such warnings not on recovery, but on "select * from t1" execution. Moreover, such warning must not be issued on recovery at all because the condition of its issuing contains !recv_recovery_is_on():
As mariabackup sets recv_recovery_on global flag on "--prepare" execution, and recv_recovery_is_on() returns true, the warning must not be issued during backup preparing as well as during innodb recovery. If this happens, we need reproducible test for it. The only exclusion is for "mariabackup --prepare --export". In this case server is started in mariabackup to export tablespaces, what might cause the above warning. At the other hand, if fil_system.max_assigned_id can be changed during "select", what will happen if some tablespace is created before the "select"? I am checking it. | |||||||||||||||||||||||
| Comment by Vladislav Lesin [ 2022-03-30 ] | |||||||||||||||||||||||
|
I have just found the reason of why https://github.com/MariaDB/server/blob/10.4/mysql-test/suite/innodb/t/innodb_force_recovery.test issues such warnings:
So if srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE maximum space id is loaded from dictionary. In the test --innodb-force-recovery=4 is used, that's why we can see the above warnings. So the question stays opened. Under what circumstances the above warning was issued on the customer's side? Did they use innodb-force-recovery !=0? Did they use "mariabackup --prepare --export"? | |||||||||||||||||||||||
| Comment by Vladislav Lesin [ 2022-03-30 ] | |||||||||||||||||||||||
|
The description is not accurate as the above warning arises during backup, but not during backup preparing. mariabackup does not load dictionary during backup, but it loads tablespaces, that is why fil_system.max_assigned_id is not set with dict_check_tablespaces_and_store_max_id(). I don't see any sense to issue the warning during backup, so the fix I propose is the following:
| |||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-03-30 ] | |||||||||||||||||||||||
|
vlad.lesin, thank you, this makes sense to me. I think that we should rewrite at least some of the regression tests to not discard all output of the mariabackup or mariadb-backup invocations, and maybe also carefully review whether each message is truly useful. |