1

Due to this problem, I'm going to use dtrace to find out what the slave SQL thread is doing with temporary tables follow this guide.

Here is my script:

#!/usr/sbin/dtrace -s

#pragma D option quiet
dtrace:::BEGIN
{
    printf("Tracing... Hit Ctrl-C to end.\n");
}

pid$target::*mysql_parse*:entry
{
    self->query = copyinstr(arg1);
}

pid$target::*Slave_open_temp_tables*:return
{
    @query[self->query] = count();
}

and this is what I got when running:

# ./Slave_open_temp_tables.d -p `pgrep -x mysqld`
proc-stub:rd_event_enable
proc-stub:rd_errstr err=26
dtrace: failed to compile script ./Slave_open_temp_tables.d: line 14: probe description pid29441::*Slave_open_temp_tables*:return does not match any probes
User defined signal 1

I also have tried with create_myisam_tmp_table but got the same result.

Where did I do wrong?

Community
  • 1
  • 1
quanta
  • 3,960
  • 4
  • 40
  • 75

1 Answers1

0

I don't have MySQL installed to look for you, but the -l option to dtrace will tell you what probes are available, from which you should be able to figure out what you're doing wrong.

$ dtrace -ln 'pid$target::*Slave_open_temp_tables*:return' -p `pgrep -x mysqld`

Or try using a less-specific name such as *open_temp_tables* or *tables* or even * to get a broader set of results... it could be that the function no longer exists in your target process due to changes in the source code of MySQL.

Also, I assume you've checked the output of pgrep -x mysqld to make sure it's a valid input pid?

Dan
  • 7,155
  • 2
  • 29
  • 54