Open NimzyMaina opened 1 week ago
cc @nielm
cc: @thiagotnunes
The fix may have to be more complicated than the suggested solution, as it is possible to have multiple schemas in a spanner database.
I have handed this over to the team responsible for maintaining SpannerIO Change streams.
Hi @nielm,
Thanks for your quick response. I understand that may be the case. If they can come up with a quick solution that will factor that in then that would be great.
However, if that will take a bit of time, could we please have this added as an intermediate solution. As the SDK is right now, it's not usable. This solution will allow people to use the SDK as we await for a permanent solution.
If this is still not acceptable, can we please have something like this instead that will not throw an Exception on restart?
CREATE TABLE IF NOT EXISTS metadata_table ...
@shuranzhang
Are you using Postgres dialect by any chance? If so are you seeing table_schema set to public?
What happened?
The method used to check whether a table exists on spanner can in some scenarios always return
false
as there is no ability to specify thetable_catalog
andtable_schema
. In my case, these fields are always populated in theinformation_schema.tables
view.The first time I run the application, it runs fine as it creates the metadata table. The problem arrises when I restart the application & specify the same metadata table. It tries to recreate the table but it already exists resulting in a Spanner Exception.
Link to tableExists code
Link to Where it is used
This results in a scenario where a change stream consumer cannot recover from a restart.
Suggested solution
Issue Priority
Priority: 1 (data loss / total loss of function)
Issue Components