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

ShardingProxy 5.5.0 version: SQL cannot to be routed to the shadow database data source for execution. #33045

Open
liuli12345 opened this issue Sep 29, 2024 · 0 comments

Comments

@liuli12345
Copy link

Version 5.2.1 is good, but after upgrading to version 5.5.0, SQL cannot to be routed to the shadow database data source for execution.

database-shadow.YAML

databaseName: shadow_db
dataSources:
 ds:
   url: jdbc:mysql://localhost:3306/user?serverTimezone=UTC&useSSL=false
   username: root
   password: xxx
   connectionTimeoutMilliseconds: 30000
   idleTimeoutMilliseconds: 60000
   maxLifetimeMilliseconds: 1800000
   maxPoolSize: 50
   minPoolSize: 1
 shadow_ds:
   url: jdbc:mysql://localhost:3306/user_shadow?serverTimezone=UTC&useSSL=false
   username: root
   password: xxx
   connectionTimeoutMilliseconds: 30000
   idleTimeoutMilliseconds: 60000
   maxLifetimeMilliseconds: 1800000
   maxPoolSize: 50
   minPoolSize: 1

rules:
- !SINGLE
 tables:
   - "*.*"
 defaultDataSource: ds
- !SHADOW
  dataSources:
    shadowDataSource:
      productionDataSourceName: ds
      shadowDataSourceName: shadow_ds
  defaultShadowAlgorithmName: sql_hint_algorithm
  shadowAlgorithms:
    sql_hint_algorithm:
      type: SQL_HINT

An example of using shadow SQL Hint:

/* SHARDINGSPHERE_HINT: SHADOW=true */ SELECT * FROM t_user;
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

No branches or pull requests

1 participant