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
ALTER KEYSPACE can break tables with UDT columns #14139
Comments
Is that a regression? |
It is. I ran the same queries on |
That's an old (enterprise) release. Let's see if we can narrow this down (with OSS versions that'd be great, btw) |
Please attach the backtrace so we see who can fix it. |
What do you mean by "version"? Aren't UDTs identified by name? |
The error is thrown when trying to deserialize schema definition which references the type. |
The issue is likely that ALTER KEYSPACE somehow forgot the type. |
|
Narrowed it down to between Works on |
I don't really mean anything, I don't know how this part of the code works x.x |
A bisect can be the easiest way to identify the problem. |
Bisecting... |
Culprit: 5852959 Fix: diff --git a/data_dictionary/data_dictionary.cc b/data_dictionary/data_dictionary.cc
index a91e9b8769..55411bdf97 100644
--- a/data_dictionary/data_dictionary.cc
+++ b/data_dictionary/data_dictionary.cc
@@ -216,7 +216,7 @@ keyspace_metadata::keyspace_metadata(std::string_view name,
std::move(strategy_options),
durable_writes,
std::move(cf_defs),
- user_types_metadata{},
+ std::move(user_types),
storage_options{}) { }
keyspace_metadata::keyspace_metadata(std::string_view name, |
@michoecho could you make a PR with your fix? |
Wow that is so sad. |
Due to a simple programming oversight, one of keyspace_metadata constructors is using empty user_types_metadata instead of the passed one. Fix that. Fixes scylladb#14139
Done: #14143 Also wrote a pytest which reproduces the issue (not sure if it's worth adding, but why not): #14144 |
It's worth adding, IMHO. |
Good catch. |
Backported to 5.1, 5.2, 5.3. |
I've created a 2 node cluster (2 DCs, 1 node in each) of the latest Scylla (5.4.0~dev-0.20230605.d2e089777bf5).
Running the following queries using
cqlsh
fails:The main problems appears to be:
It looks like the
ALTER KEYSPACE
query changes the UDT version, but other nodes are not aware of it and still use the old UDTs, and then fail on schema operations likeALTER TABLE
orDROP TABLE
.Installation details
Scylla version (or git commit hash): 5.4.0~dev-0.20230605.d2e089777bf5
Cluster size: 2 (2 datacenters, 1 node in each DC)
OS (RHEL/CentOS/Ubuntu/AWS AMI): Fedora 37
(removed references to enterprise repository)
The text was updated successfully, but these errors were encountered: