apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
20.01k stars 6.76k forks source link

TableNotFoundException "table or view 'xxx' does not exist." #33906

Closed subaio-mads-andersen closed 16 hours ago

subaio-mads-andersen commented 16 hours ago

Question

I'm in the process of upgrading our current ShardingSphere 4.1.1 to ShardingSphere 5.5.1. We do our sharding configuration
completely through the Java API and uses a Hint Algorithm for our sharding.

End 2 end test setup

This setup is working perfectly. I run my tests successfully with python and I get the data in the database that I expect.

IT setup

This time I can't even do a context load test. On server start the app will check if the tables have initialized its partitions and if not, add the partitions and update the partition status to indicate partitioning has been done. However, when writing the status, I get a TableNotFoundException "table or view 'xxx' does not exist." From the code's perspective there shouldn't be any difference, just another mariadb running on another port than usual. But the behavior of ShardingSphere is quite different.

By debugging, I can verify that my Java API sharding configuration is loaded correctly. I can verify that and the datasource is created, flyway does its job and adds all migrations and partitions have been added.

It appears that the tables metadata is null, unlike the end2end test setup where I don't see this issue. I've tried both with and without an explicit ModeConfiguration, but without any effect.

I'm looking for a clue how to get on with the upgrade and get all of my existing integration tests to work with the new version of ShardingSphere.

I see there have been other questions with TableNotFoundException, but none of them seems to cover my problem.

terrymanu commented 16 hours ago

The version 4.x is out of service. Please read 5.x's documents.