DataDog / dd-trace-rb

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

Update MySQL 8.0 #3741

Closed TonyCTHsu closed 5 days ago

TonyCTHsu commented 6 days ago

What does this PR do?

Update mysql image with 8.0

Motivation:

The mysql usage is different between docker-compose and circleci.

Why choose mysql:8.0:

  1. mysql2 gem does not test with 8.4, https://github.com/brianmario/mysql2?tab=readme-ov-file#compatibility
  2. Docker compose using 8.4.0 is failing with (This is causing local test failure, such as action_cable)
    2024-06-26 11:45:22+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el8 started.
    2024-06-26 11:45:22+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
    2024-06-26 11:45:22+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el8 started.
    2024-06-26 11:45:22+00:00 [Note] [Entrypoint]: Initializing database files
    2024-06-26T11:45:22.556304Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
    2024-06-26T11:45:22.557430Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.0) initializing of server in progress as process 79
    2024-06-26T11:45:22.565682Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
    2024-06-26T11:45:22.811802Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
    2024-06-26T11:45:23.726832Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.
    2024-06-26T11:45:23.727126Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
    2024-06-26T11:45:23.727137Z 0 [ERROR] [MY-010119] [Server] Aborting
    2024-06-26T11:45:25.008515Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
  3. My laptop (M1) cannot install mysql:5.6, because
    no matching manifest for linux/arm64/v8 in the manifest list entries
  4. 8.4.0 authentication become very verbose with SSL. Needs a ton of changes and still more failing with
    • Many database adapter failed.
    • Mysql2::Error: RSA Encryption not supported - caching_sha2_password plugin was built with GnuTLS support
    • Trilogy::QueryError: trilogy_auth_recv: TRILOGY_UNEXPECTED_PACKET, can be fixed by upgrade 2.8.0 and provide SSL
      
      index e62fb0719..932248c2e 100644
      --- a/spec/datadog/tracing/contrib/rails/support/database.rb
      +++ b/spec/datadog/tracing/contrib/rails/support/database.rb
      @@ -23,7 +23,7 @@ module Datadog
                 elsif adapter.include?('mysql')
                   connector = mysql_url
                 elsif adapter == 'activerecord-trilogy-adapter'
    • connector = mysql_url('trilogy')
    • connector = trilogy_url end rescue LoadError puts "#{adapter} gem not found, trying another connector" @@ -50,9 +50,16 @@ module Datadog } end
  1. 8.4.0 JDBC need to allow public key retrieval
    ActiveRecord::JDBCError: Public Key Retrieval is not allowed

    NOTE

As of MySQL 8.0, caching_sha2_password is now the default authentication plugin rather than mysql_native_password which was the default in previous versions. This means that clients that rely on the mysql_native_password won't be able to connect because of this change.

codecov-commenter commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.10%. Comparing base (7cd7c4c) to head (a0797a5). Report is 9 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3741 +/- ## ======================================== Coverage 98.10% 98.10% ======================================== Files 1232 1234 +2 Lines 73551 73706 +155 Branches 3542 3557 +15 ======================================== + Hits 72156 72311 +155 Misses 1395 1395 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.