[MDEV-12367] Upgrade from previous versions to 10.2 with innodb-read-only does not work Created: 2017-03-26  Updated: 2021-04-26  Resolved: 2021-04-26

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2
Fix Version/s: 10.2.7, 10.3.1

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-12548 Add maria backup tool to MariaDB 10.2 Closed
relates to MDEV-12776 Do not create the InnoDB temporary ta... Closed
relates to MDEV-12227 Defer writes to the InnoDB temporary ... Closed

 Description   

Note: It might well be intended, but it's worth checking. Also, maybe it could benefit from a better error message.

Version: '10.1.23-MariaDB-debug'  socket: '/data/bld/10.1/data/tmp/mysql.sock'  port: 3306  Source distribution
2017-03-27  2:18:25 140478047542016 [Note] /data/bld/10.1/bin/mysqld: Normal shutdown
 
2017-03-27  2:18:25 140478047542016 [Note] Event Scheduler: Purging the queue. 0 events
2017-03-27  2:18:26 140477273724672 [Note] InnoDB: FTS optimize thread exiting.
2017-03-27  2:18:26 140478047542016 [Note] InnoDB: Starting shutdown...
2017-03-27  2:18:26 140478047542016 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2017-03-27  2:18:28 140478047542016 [Note] InnoDB: Shutdown completed; log sequence number 1622848
2017-03-27  2:18:28 140478047542016 [Note] /data/bld/10.1/bin/mysqld: Shutdown complete
 
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Started in read only mode
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Uses event mutexes
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Using Linux native AIO
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Number of pools: 1
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Using SSE2 crc32 instructions
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Disabling background log and ibuf IO write threads.
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Completed initialization of buffer pool
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Highest supported file format is Barracuda.
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-03-27  2:18:43 139835740817280 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-03-27  2:18:44 139835740817280 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-03-27  2:18:44 139835740817280 [ERROR] InnoDB: Cannot create system tables in read-only mode
2017-03-27  2:18:44 139835740817280 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[2577] with error Read only transaction
2017-03-27  2:18:44 139835740817280 [Note] InnoDB: Starting shutdown...
2017-03-27  2:18:44 139835740817280 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-03-27  2:18:44 139835740817280 [ERROR] Plugin 'InnoDB' init function returned error.
2017-03-27  2:18:44 139835740817280 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-03-27  2:18:44 139835740817280 [Note] Plugin 'FEEDBACK' is disabled.
2017-03-27  2:18:44 139835740817280 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-03-27  2:18:44 139835740817280 [ERROR] Aborting



 Comments   
Comment by Marko Mäkelä [ 2017-04-04 ]

This is intentional, and also so in upstream. In addition to this, until MDEV-12700 is fixed, we would also refuse an innodb_read_only startup if the change buffer is not empty.
If you have specific suggestions how to improve the handling, I am happy to implement it.

Comment by Elena Stepanova [ 2017-04-04 ]

From the log it looks like InnoDB attempts to do something, and only then realizes that it can't due to the read-only mode. When it happens this way, there is always a danger that it does something towards upgrade before aborting, thus leaving the datadir in a half-upgraded state. I would much prefer if it checked the read-only mode from the very beginning, and refused to do anything at all with a proper error message. (I don't know how it really works internally, maybe that's what is already happening, and the log just FUD-ish).

Comment by Marko Mäkelä [ 2017-04-19 ]

The only ‘permanent damage’ that the upgrade does is the creation of the temporary tablespace file(s) (by default, the file ibtmp1).
The other messages in the error log are about the initialization of main-memory based data structures and subsystems.

I agree that we should postpone the creation of the temporary tablespace until the very last moment, right before accepting user connections.

Comment by Marko Mäkelä [ 2021-04-26 ]

It looks like starting with MDEV-12548, we no longer create the temporary tablespace in innodb_read_only mode.

The upgrade would be aborted, because the table SYS_VIRTUAL would have to be created.

Generated at Thu Feb 08 07:57:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.