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

Table or view 'undo_log' does not exist #33523

Open
SilenceDevelopers opened this issue Nov 3, 2024 · 9 comments
Open

Table or view 'undo_log' does not exist #33523

SilenceDevelopers opened this issue Nov 3, 2024 · 9 comments

Comments

@SilenceDevelopers
Copy link

SilenceDevelopers commented Nov 3, 2024

shardingsphere-jdbc 5.5.0 org.apache.seata 2.2.0
my yaml:

spring:
  application:
    name: cola-consumer
  datasource:
    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
    url:  #jdbc:shardingsphere:classpath:sharding.yaml

my sharding.yaml:

dataSources:
  ds_0:
    driverClassName: com.mysql.cj.jdbc.Driver
    dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
    url: jdbc:mysql://192.168.78.201:3306/tb_order?useUnicode=true&characterEncoding=utf-8&useSSL=false
    username: root
    password: 123456
  ds_1:
    driverClassName: com.mysql.cj.jdbc.Driver
    dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
    url: jdbc:mysql://192.168.78.201:3307/tb_order?useUnicode=true&characterEncoding=utf-8&useSSL=false
    username: root
    password: 123456


rules:
  - !SHARDING
    tables:
      sharding_order:
        actualDataNodes: ds.sharding_order_${0..1}
        databaseStrategy: # 分库策略,缺省表示使用默认分库策略,以下的分片策略只能选其
          none:
        tableStrategy:
          standard:
            shardingColumn: id
            shardingAlgorithmName: table_inline
    shardingAlgorithms:
      table_inline: # 分表策略
        type: INLINE
        props:
          # strategy: STANDARD
          algorithm-expression: sharding_order_$->{id % 2 + 1}
  - !READWRITE_SPLITTING
    dataSources:
      ds:
        writeDataSourceName: ds_0
        readDataSourceNames:
          - ds_1
        loadBalancerName: round-robin
    loadBalancers:
      round-robin:
        type: RANDOM

props:
  sql-show: true

transaction:
  defaultType: BASE
  providerType: Seata

my undo_logs:
微信图片_20241104054328
微信图片_20241104054336

when I start up, the error is :Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Table or view 'undo_log' does not exist.

my datasource is com.alibaba.druid.pool.DruidDataSource

I don't know why

@linghengqian
Copy link
Member

  • Can you share a git containing unit tests for testcontainers-java ? The master branch has no problems with the seata integration tests for postgres .
  • By the way, the docker image of seata server does not carry the mysql jdbc driver jar starting from v2.1.0.

@SilenceDevelopers
Copy link
Author

ok I will upload my project sooner.

@SilenceDevelopers
Copy link
Author

SilenceDevelopers commented Nov 4, 2024

my docker images:

nacos/nacos-server                  v2.4.2    325b84d58cf7   6 weeks ago     285MB
canal/canal-server                  v1.6.1    9bf4fbb74f65   7 weeks ago     1.69GB
seataio/seata-server                latest    9ba033ad828e   2 months ago    633MB
apache/rocketmq                     v5.3.0    4802c0635d11   3 months ago    419MB
mysql                               8.1.0     ae2502152260   15 months ago   574MB
redis                               5.0.14    99ee9af2b6b1   23 months ago   110MB

I upload my test project:
https://github.com/SilenceDevelopers/cola-consumer.git

@linghengqian
Copy link
Member

@SilenceDevelopers I don't need all the relevant code, I just need a unit test execution process similar to https://github.com/linghengqian-scratches/code-repo/tree/re-test. The git you uploaded seems to contain multiple unit tests. Which unit test throws the error log you refer to? What are the steps to reproduce?

@SilenceDevelopers
Copy link
Author

oh,sorry,I misunderstood. I didn't do a unit test. just When I was integrating the project, I found that the whole project would not start.

@SilenceDevelopers
Copy link
Author

I found out from the logs that shardingjdbc references Hikari and Druid, but the database driver I configured did not reference Hikari.

@linghengqian
Copy link
Member

I found out from the logs that shardingjdbc references Hikari and Druid, but the database driver I configured did not reference Hikari.

@SilenceDevelopers
Copy link
Author

OK,Thank you for your answer.

@linghengqian
Copy link
Member

  • By the way, if your seata server only uses file mode, you don't need to provide the mysql jdbc driver jar for the seata server's docker container. The seata server's docker container normally does not need to communicate with the mysql server unless you save the seata server's metadata in a mysql server and change the seata server's mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants