3414 Marko Mäkelä 2011-05-31
Bug#12606344 - ADD VALGRIND DIAGNOSTICS TO MTR_START, MTR_COMMIT
mtr_start(): Declare the mtr memory area uninitialized in Valgrind
before initializing the fields.
mtr_commit(): Declare everything uninitialized except
mtr->start_lsn, mtr->end_lsn and mtr->state.
modified:
storage/innobase/include/mtr0mtr.ic
storage/innobase/mtr/mtr0mtr.c
3413 Davi Arnaut 2011-05-30
Bug#11766349 - 59443: query_cache_debug.test is occasionally very slow
The test case problem stemmed from the fact that a debug sync
signal is a global variable that persists until overwritten
by a new signal. This means that if two different signals
are raised in sequence, a thread waiting for the first signal
might miss it if the second signal sets the global variable
before the thread wakes up.
The solution is to deliver a subsequent signal only after the
waiting thread has received it.
@ mysql-test/t/query_cache_debug.test
Wait for signal to be delivered.
modified:
mysql-test/r/query_cache_debug.result
mysql-test/t/query_cache_debug.test
=== modified file 'storage/innobase/include/mtr0mtr.ic'
--- a/storage/innobase/include/mtr0mtr.ic revid:davi.arnaut@stripped
+++ b/storage/innobase/include/mtr0mtr.ic revid:marko.makela@stripped
@@ -37,6 +37,8 @@ mtr_start(
/*======*/
mtr_t* mtr) /*!< out: mini-transaction */
{
+ UNIV_MEM_INVALID(mtr, sizeof *mtr);
+
dyn_array_create(&(mtr->memo));
dyn_array_create(&(mtr->log));
=== modified file 'storage/innobase/mtr/mtr0mtr.c'
--- a/storage/innobase/mtr/mtr0mtr.c revid:davi.arnaut@stripped
+++ b/storage/innobase/mtr/mtr0mtr.c revid:marko.makela@oracle.com-20110531075529-3rtmo1f57435yppp
@@ -265,9 +265,20 @@ mtr_commit(
mtr_memo_pop_all(mtr);
#endif /* !UNIV_HOTBACKUP */
- ut_d(mtr->state = MTR_COMMITTED);
dyn_array_free(&(mtr->memo));
dyn_array_free(&(mtr->log));
+#ifdef UNIV_DEBUG_VALGRIND
+ /* Declare everything uninitialized except
+ mtr->start_lsn, mtr->end_lsn and mtr->state. */
+ {
+ ib_uint64_t start_lsn = mtr->start_lsn;
+ ib_uint64_t end_lsn = mtr->end_lsn;
+ UNIV_MEM_INVALID(mtr, sizeof *mtr);
+ mtr->start_lsn = start_lsn;
+ mtr->end_lsn = end_lsn;
+ }
+#endif /* UNIV_DEBUG_VALGRIND */
+ ut_d(mtr->state = MTR_COMMITTED);
}
#ifndef UNIV_HOTBACKUP
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110531075529-3rtmo1f57435yppp.bundle
| Thread |
|---|
| • bzr push into mysql-5.5 branch (marko.makela:3413 to 3414) Bug#12606344 | marko.makela | 31 May |