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
api (docker)
spring boot 2.7.18
shardingsphere 5.5.1
flyway
mariadb (docker)
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
api (IDEA / maven)
spring boot 2.7.18
shardingsphere 5.5.1
flyway
mariadb (testcontainers)
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.
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.