DataDog / dd-trace-rb

Datadog Tracing Ruby Client
https://docs.datadoghq.com/tracing/
Other
299 stars 368 forks source link

MySQL Query Cache Invalidation with comment_propagation #3561

Open zmariscal opened 3 months ago

zmariscal commented 3 months ago

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:

TonyCTHsu commented 3 months ago

Thanks @zmariscal , I will have a look!

marcotc commented 3 months ago

From MySQL Bug #40986:

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

This is possibly a workaround.

zmariscal commented 1 month ago

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

TonyCTHsu commented 2 weeks ago

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.

sethsamuel commented 1 week ago

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

zmariscal commented 1 week ago

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

sethsamuel commented 1 week ago

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