Below is the list of changes that have just been committed into a local
6.0 repository of istruewing. When istruewing does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-06-05 22:01:36+02:00, istruewing@stripped +5 -0
Convert BACKUP_BREAKPOINT to DEBUG_SYNC.
Changed synchronization point calls,
adapted backup.test and re-enabled it.
mysql-test/r/backup.result@stripped, 2008-06-05 22:01:34+02:00, istruewing@stripped +10 -12
Convert BACKUP_BREAKPOINT to DEBUG_SYNC.
Changed result.
mysql-test/t/backup.test@stripped, 2008-06-05 22:01:34+02:00, istruewing@stripped +11 -18
Convert BACKUP_BREAKPOINT to DEBUG_SYNC.
Changed test.
mysql-test/t/disabled.def@stripped, 2008-06-05 22:01:34+02:00, istruewing@stripped +1 -1
Convert BACKUP_BREAKPOINT to DEBUG_SYNC.
Re-enabled the converted test case.
sql/backup/be_default.cc@stripped, 2008-06-05 22:01:34+02:00, istruewing@stripped +1 -1
Convert BACKUP_BREAKPOINT to DEBUG_SYNC.
Changed synchronization point calls.
sql/lock.cc@stripped, 2008-06-05 22:01:34+02:00, istruewing@stripped +16 -10
Convert BACKUP_BREAKPOINT to DEBUG_SYNC.
Fixed the placement of the sync points in respect to enter_cond()
to improve the repeatability of the test cases.
diff -Nrup a/mysql-test/r/backup.result b/mysql-test/r/backup.result
--- a/mysql-test/r/backup.result 2008-05-14 18:28:28 +02:00
+++ b/mysql-test/r/backup.result 2008-06-05 22:01:34 +02:00
@@ -1,4 +1,4 @@
-SET GLOBAL debug="d,backup_debug:d,backup";
+SET DEBUG_SYNC= 'RESET';
DROP DATABASE IF EXISTS db1;
DROP DATABASE IF EXISTS db2;
DROP DATABASE IF EXISTS db3;
@@ -42,14 +42,13 @@ CREATE TABLE `tasking` (
LOCK TABLES `tasking` WRITE;
INSERT INTO `tasking` VALUES ('333445555','405',23),('123763153','405',33.5),('921312388','601',44),('800122337','300',13),('820123637','300',9.5),('830132335','401',8.5),('333445555','300',11),('921312388','500',13),('800122337','300',44),('820123637','401',500.5),('830132335','400',12),('333445665','600',300.25),('123654321','607',444.75),('123456789','300',1000);
UNLOCK TABLES;
-breakpoints: Getting lock "locking_thread_added"
-SELECT get_lock("locking_thread_added", 100);
-get_lock("locking_thread_added", 100)
-1
+backup: Activate synchronization points for BACKUP.
+SET DEBUG_SYNC= 'locking_thread_added SIGNAL bup_thread_added
+ WAIT_FOR finish';
backup: Send the backup command.
BACKUP DATABASE db1,db2 TO 'test.ba';
-breakpoints: Check for lock in process list.
-breakpoints: Checking locks.
+breakpoints: Wait for BACKUP to reach its synchronization point.
+SET DEBUG_SYNC= 'now WAIT_FOR bup_thread_added';
SELECT id, command, state, info FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE info LIKE "BACKUP DATABASE%" OR info LIKE "default driver locking thread%";
id #
@@ -58,12 +57,10 @@ state Locking thread: holding table lock
info default driver locking thread
id #
command Query
-state debug_sync_point: locking_thread_added
+state debug sync point: locking_thread_added
info BACKUP DATABASE db1,db2 TO 'test.ba'
-breakpoints: Release lock
-SELECT release_lock("locking_thread_added");
-release_lock("locking_thread_added")
-1
+breakpoints: Sending finish signal to wake BACKUP.
+SET DEBUG_SYNC= 'now SIGNAL finish';
backup_id
#
DROP DATABASE db1;
@@ -134,6 +131,7 @@ tasking CREATE TABLE `tasking` (
DROP DATABASE db1;
DROP DATABASE db2;
DROP DATABASE db3;
+SET DEBUG_SYNC= 'RESET';
DROP DATABASE IF EXISTS bup_default;
CREATE DATABASE bup_default;
CREATE TABLE bup_default.wide (
diff -Nrup a/mysql-test/t/backup.test b/mysql-test/t/backup.test
--- a/mysql-test/t/backup.test 2008-05-14 18:28:29 +02:00
+++ b/mysql-test/t/backup.test 2008-06-05 22:01:34 +02:00
@@ -1,15 +1,14 @@
--source include/have_innodb.inc
--source include/not_embedded.inc
---source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+SET DEBUG_SYNC= 'RESET';
connect (backup,localhost,root,,);
connect (breakpoints,localhost,root,,);
connection backup;
-# Setup the server to use the backup breakpoints
-SET GLOBAL debug="d,backup_debug:d,backup";
-
--disable_warnings
DROP DATABASE IF EXISTS db1;
DROP DATABASE IF EXISTS db2;
@@ -105,31 +104,24 @@ UNLOCK TABLES;
# in the process list and not a complete test of the locking
# thread code.
#
-connection breakpoints;
---echo breakpoints: Getting lock "locking_thread_added"
-SELECT get_lock("locking_thread_added", 100);
-
connection backup;
+--echo backup: Activate synchronization points for BACKUP.
+SET DEBUG_SYNC= 'locking_thread_added SIGNAL bup_thread_added
+ WAIT_FOR finish';
--echo backup: Send the backup command.
send BACKUP DATABASE db1,db2 TO 'test.ba';
# get the lock and wait until lock is identified in process list
connection breakpoints;
---echo breakpoints: Check for lock in process list.
-
-# Wait for lock to be acquired and execution to reach breakpoint
---echo breakpoints: Checking locks.
-let $wait_condition = SELECT count(*) = 1
- FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE info LIKE "default driver locking thread%";
---source include/wait_condition.inc
+--echo breakpoints: Wait for BACKUP to reach its synchronization point.
+SET DEBUG_SYNC= 'now WAIT_FOR bup_thread_added';
--replace_column 1 #
query_vertical SELECT id, command, state, info FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE info LIKE "BACKUP DATABASE%" OR info LIKE "default driver locking thread%";
---echo breakpoints: Release lock
-SELECT release_lock("locking_thread_added");
+--echo breakpoints: Sending finish signal to wake BACKUP.
+SET DEBUG_SYNC= 'now SIGNAL finish';
# reattach to backup job
connection backup;
@@ -174,6 +166,7 @@ SHOW CREATE TABLE tasking;
DROP DATABASE db1;
DROP DATABASE db2;
DROP DATABASE db3;
+SET DEBUG_SYNC= 'RESET';
#
# This test is for the default and snapshot online backup drivers
diff -Nrup a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
--- a/mysql-test/t/disabled.def 2008-06-05 21:17:52 +02:00
+++ b/mysql-test/t/disabled.def 2008-06-05 22:01:34 +02:00
@@ -22,7 +22,7 @@ ctype_create : Bug#32965 main.ct
status : Bug#32966 main.status fails
ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166
user_limits : Bug#23921 2007-12-16 random failure of user_limits.test
-backup :BUG#34235 pending replacement of test facility with WL#4259
+#backup :BUG#34235 pending replacement of test facility with WL#4259
#backup_commit_blocker :BUG#34235 pending replacement of test facility with WL#4259
#backup_ddl_blocker :BUG#34235 pending replacement of test facility with WL#4259
#backup_progress :BUG#34235 pending replacement of test facility with WL#4259
diff -Nrup a/sql/backup/be_default.cc b/sql/backup/be_default.cc
--- a/sql/backup/be_default.cc 2008-05-14 18:28:30 +02:00
+++ b/sql/backup/be_default.cc 2008-06-05 22:01:34 +02:00
@@ -298,7 +298,7 @@ result_t Backup::get_data(Buffer &buf)
case LOCK_ACQUIRED: // First time lock ready for validity point
{
locks_acquired= TRUE;
- BACKUP_BREAKPOINT("locking_thread_added");
+ DEBUG_SYNC(locking_thd->m_thd, "locking_thread_added");
DBUG_RETURN(READY);
}
default: // If first call, signal end of init phase
diff -Nrup a/sql/lock.cc b/sql/lock.cc
--- a/sql/lock.cc 2008-06-05 21:17:53 +02:00
+++ b/sql/lock.cc 2008-06-05 22:01:34 +02:00
@@ -1424,21 +1424,24 @@ bool lock_global_read_lock(THD *thd)
{
const char *old_message;
(void) pthread_mutex_lock(&LOCK_global_read_lock);
+ old_message=thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock,
+ "Waiting to get readlock");
#if defined(ENABLED_DEBUG_SYNC)
/*
The below sync point fires if we have to wait for
protect_against_global_read_lock. Beware to use WAIT_FOR with this
sync point. We hold LOCK_global_read_lock here.
- Call the sync point before calling enter_cond() as it will call it
- itself if WAIT_FOR is used anyhow.
+ Call the sync point after calling enter_cond() so that proc_info
+ is set correctly after a SIGNAL activity. OTOH this placement is
+ another argument, not to use a WAIT_FOR action as it would destroy
+ the mutex settings of enter_cond() and thus make the thread
+ non-killable.
*/
if (protect_against_global_read_lock)
DEBUG_SYNC(thd, "wait_protect_global_read_lock");
#endif /* defined(ENABLED_DEBUG_SYNC) */
- old_message=thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock,
- "Waiting to get readlock");
DBUG_PRINT("info",
("waiting_for: %d protect_against: %d",
waiting_for_read_lock, protect_against_global_read_lock));
@@ -1527,21 +1530,24 @@ bool wait_if_global_read_lock(THD *thd,
*/
DBUG_RETURN(is_not_commit);
}
+ old_message=thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock,
+ "Waiting for release of readlock");
#if defined(ENABLED_DEBUG_SYNC)
/*
The below sync point fires if we have to wait for
- global_read_lock. Beware to use WAIT_FOR with this
- sync point. We hold LOCK_global_read_lock here.
- Call the sync point before calling enter_cond() as it will call it
- itself if WAIT_FOR is used anyhow.
+ global_read_lock. Beware to use WAIT_FOR with this sync point. We
+ hold LOCK_global_read_lock here.
+ Call the sync point after calling enter_cond() so that proc_info
+ is set correctly after a SIGNAL activity. OTOH this placement is
+ another argument, not to use a WAIT_FOR action as it would destroy
+ the mutex settings of enter_cond() and thus make the thread
+ non-killable.
*/
if (must_wait)
DEBUG_SYNC(thd, "wait_if_global_read_lock");
#endif /* defined(ENABLED_DEBUG_SYNC) */
- old_message=thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock,
- "Waiting for release of readlock");
while (must_wait && ! thd->killed &&
(!abort_on_refresh || thd->version == refresh_version))
{
| Thread |
|---|
| • bk commit into 6.0 tree (istruewing:1.2628) | Ingo Struewing | 5 Jun |