Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: mysql 5.x and 8.x jdbc drivers coexist in the server #2328

Merged
merged 1 commit into from
Mar 7, 2020

Conversation

ggndnn
Copy link
Contributor

@ggndnn ggndnn commented Mar 2, 2020

Ⅰ. Describe what this PR did

This PR provided a feature that mysql 5.x and 8.x jdbc drivers coexist in the server to fix issues like #2116.

  1. Made use of DriverClassLoader to load mysql 5.x and 8.x driver separately.
  2. Moved mysql driver jar from classpath to special location that the mysql drivers can coexist.
  3. Upgraded dbcp to avoid loading error (https://issues.apache.org/jira/browse/DBCP-333).
  4. Determined different drivers according to driverClassName:
store.db.driverClassName=com.mysql.jdbc.Driver -> mysql 5.x
store.db.driverClassName=com.mysql.cj.jdbc.Driver -> mysql 8.x
  1. Tested following combinations:
dbcp + mysql-connector-java-5.1.30
dbcp + mysql-connector-java-8.0.19
druid + mysql-connector-java-5.1.30
druid + mysql-connector-java-8.0.19

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Mar 2, 2020

Codecov Report

Merging #2328 into develop will increase coverage by 0.15%.
The diff coverage is 10.25%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2328      +/-   ##
=============================================
+ Coverage       51.6%   51.76%   +0.15%     
- Complexity      2693     2695       +2     
=============================================
  Files            517      517              
  Lines          16734    16752      +18     
  Branches        2039     2033       -6     
=============================================
+ Hits            8636     8672      +36     
+ Misses          7290     7270      -20     
- Partials         808      810       +2
Impacted Files Coverage Δ Complexity Δ
...ata/core/store/db/AbstractDataSourceGenerator.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...eata/server/store/db/DruidDataSourceGenerator.java 100% <100%> (+100%) 2 <0> (+2) ⬆️
...seata/server/store/db/DbcpDataSourceGenerator.java 100% <100%> (+100%) 2 <0> (+2) ⬆️
...o/seata/server/coordinator/DefaultCoordinator.java 54.35% <0%> (-0.52%) 28% <0%> (-1%)
...in/java/io/seata/server/session/GlobalSession.java 84% <0%> (-0.45%) 72% <0%> (-1%)

@slievrly
Copy link
Member

slievrly commented Mar 4, 2020

image

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. IDE(AppClassLoader)+ mysql5 + commit/rollback as expected
  2. IDE(AppClassLoader)+ mysql8 + commit/rollback as expected
  3. distribute pkg(URLClassLoader)+ mysql5 + commit/rollback as expected
  4. distribute pkg(URLClassLoader)+ mysql8 + commit/rollback as expected

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Test passed.

dbcp + mysql5
dbcp + mysql8
druid + mysql5
druid + mysql8

@slievrly slievrly merged commit dc67beb into apache:develop Mar 7, 2020
@slievrly slievrly added this to the 1.2.0 milestone Mar 15, 2020
@ggndnn ggndnn deleted the mysql_multi_version branch May 30, 2020 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants