summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
authorSunny Bains <Sunny.Bains@Oracle.Com>2010-07-22 09:16:19 +1000
committerSunny Bains <Sunny.Bains@Oracle.Com>2010-07-22 09:16:19 +1000
commite27f4b3a4ba91a62d7b196b7484fe296e1d927a9 (patch)
tree0a8ee63586f9b317b5c25cb8b175d5a22c945030 /storage/innobase/srv
parent779741921cab777153bed28a8f4d97fcbe6b677e (diff)
downloadmariadb-git-e27f4b3a4ba91a62d7b196b7484fe296e1d927a9.tar.gz
Bug#54583 InnoDB: Assertion failure sync/sync0sync.c:1226
Silence the UNIV_SYNC_DEBUG assertion failure while upgrading old data files to multiple rollback segments during server startup. Because the upgrade takes place while InnoDB is running a single thread, we can safely ignore the latching order checks without fearing deadlocks. innobase_start_or_create_for_mysql(): Set srv_is_being_started = FALSE only after trx_sys_create_rsegs() has completed. sync_thread_add_level(): If srv_is_being_started, ignore latching order violations for SYNC_TRX_SYS_HEADER and SYNC_IBUF_BITMAP. Create all the non-IO threads after creating the extra rollback segments. Patch originally from Marko with some additions by Sunny.
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0start.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index 3d4aaa9d5d4..4da836672ec 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -1703,20 +1703,6 @@ innobase_start_or_create_for_mysql(void)
/* fprintf(stderr, "Max allowed record size %lu\n",
page_get_free_space_of_empty() / 2); */
- /* Create the thread which watches the timeouts for lock waits */
- os_thread_create(&srv_lock_timeout_thread, NULL,
- thread_ids + 2 + SRV_MAX_N_IO_THREADS);
-
- /* Create the thread which warns of long semaphore waits */
- os_thread_create(&srv_error_monitor_thread, NULL,
- thread_ids + 3 + SRV_MAX_N_IO_THREADS);
-
- /* Create the thread which prints InnoDB monitor info */
- os_thread_create(&srv_monitor_thread, NULL,
- thread_ids + 4 + SRV_MAX_N_IO_THREADS);
-
- srv_is_being_started = FALSE;
-
if (trx_doublewrite == NULL) {
/* Create the doublewrite buffer to a new tablespace */
@@ -1729,8 +1715,29 @@ innobase_start_or_create_for_mysql(void)
We create the new segments only if it's a new database or
the database was shutdown cleanly. */
+ /* Note: When creating the extra rollback segments during an upgrade
+ we violate the latching order, even if the change buffer is empty.
+ We make an exception in sync0sync.c and check srv_is_being_started
+ for that violation. It cannot create a deadlock because we are still
+ running in single threaded mode essentially. Only the IO threads
+ should be running at this stage. */
+
trx_sys_create_rsegs(TRX_SYS_N_RSEGS - 1);
+ /* Create the thread which watches the timeouts for lock waits */
+ os_thread_create(&srv_lock_timeout_thread, NULL,
+ thread_ids + 2 + SRV_MAX_N_IO_THREADS);
+
+ /* Create the thread which warns of long semaphore waits */
+ os_thread_create(&srv_error_monitor_thread, NULL,
+ thread_ids + 3 + SRV_MAX_N_IO_THREADS);
+
+ /* Create the thread which prints InnoDB monitor info */
+ os_thread_create(&srv_monitor_thread, NULL,
+ thread_ids + 4 + SRV_MAX_N_IO_THREADS);
+
+ srv_is_being_started = FALSE;
+
err = dict_create_or_check_foreign_constraint_tables();
if (err != DB_SUCCESS) {