dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

MySQL Query Cache Invalidation with comment_propagation

Open zmariscal opened this issue 1 year ago • 7 comments

Current Behaviour: When enabling comment_propagation for the mysql2 adapter, we noticed that it invalidates MySQL's query cache. It appears to be potentially linked to a known MySQL issue documented here: MySQL Bug #40986. The specific line in the codebase possibly implicated in this behavior can be found here.

Expected Behaviour: At the very least, there should be documentation outlining the implications of enabling comment_propagation.

Steps to Reproduce:

Datadog.configure do |c|
    c.tracing.instrument :mysql2, comment_propagation: "full"

Environment:

  • ddtrace version: 1.20.0
  • Ruby version: 3.2.0

zmariscal avatar Mar 27 '24 23:03 zmariscal

Thanks @zmariscal , I will have a look!

TonyCTHsu avatar Apr 02 '24 09:04 TonyCTHsu

From MySQL Bug #40986:

'/* */'-style comments are fine and do not affect caching.

This is possibly a workaround.

marcotc avatar Apr 02 '24 20:04 marcotc

Any update on this issue? Anything I can do to help?

zmariscal avatar May 20 '24 17:05 zmariscal

From MySQL Bug #40986:

'/* */'-style comments are fine and do not affect caching.

This is possibly a workaround.

This is the current implementation. I am forwarding this to our DBM team.

TonyCTHsu avatar Jun 18 '24 16:06 TonyCTHsu

Hi @zmariscal, which version of MySQL are you querying and is it self-hosted, Aurora, etc?

sethsamuel avatar Jun 24 '24 14:06 sethsamuel

Hi @zmariscal, which version of MySQL are you querying and is it self-hosted, Aurora, etc?

The AWS Engine version is as follows: 5.7.mysql_aurora.2.11.2

zmariscal avatar Jun 25 '24 02:06 zmariscal

Ok, thanks for the report. We've opened a ticket and will get back to you when we know more

sethsamuel avatar Jun 25 '24 13:06 sethsamuel