NOTE:
Although I already created this patch, I'm not 100% sure it's a good idea. I'm starting to think maybe it's a bad idea :-(Eliran, you brought this potential issue up - what do you think?
Yes, my patch makes our CQL implementation a tiny more compatible with Cassandra in some esoteric case.But on the other hand, the case it makes compatible is a case where:1. The request doesn't make sense, and is probably (?) a mistake from the user.2. Cassandr'a behavior in this case is to do absolutely nothing, silently.
So in some sense the behavior we had before this patch - giving a reasonably good error message - perhaps it is better than Cassandra's silent-forgiveness behavior in this case? The user will see the error message and understand the request probably has some typo.
What I wonder, though, is perhaps there is some case where some code will assume Cassanra's behavior, creating an index called "xyz" unless it's already an index for anything. Could that possibly be a useful feature?
NOTE:Although I already created this patch, I'm not 100% sure it's a good idea. I'm starting to think maybe it's a bad idea :-(Eliran, you brought this potential issue up - what do you think?Yes, my patch makes our CQL implementation a tiny more compatible with Cassandra in some esoteric case.But on the other hand, the case it makes compatible is a case where:1. The request doesn't make sense, and is probably (?) a mistake from the user.2. Cassandr'a behavior in this case is to do absolutely nothing, silently.So in some sense the behavior we had before this patch - giving a reasonably good error message - perhaps it is better than Cassandra's silent-forgiveness behavior in this case? The user will see the error message and understand the request probably has some typo.What I wonder, though, is perhaps there is some case where some code will assume Cassanra's behavior, creating an index called "xyz" unless it's already an index for anything. Could that possibly be a useful feature?
--
You received this message because you are subscribed to the Google Groups "ScyllaDB development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-dev/CANEVyjtw3sBvfUvP-p001G7CxJu9rboe6_TCmETO6--sC6_6zw%40mail.gmail.com.
On Tue, Aug 10, 2021, 22:05 Nadav Har'El <n...@scylladb.com> wrote:NOTE:Although I already created this patch, I'm not 100% sure it's a good idea. I'm starting to think maybe it's a bad idea :-(Eliran, you brought this potential issue up - what do you think?Yes, my patch makes our CQL implementation a tiny more compatible with Cassandra in some esoteric case.But on the other hand, the case it makes compatible is a case where:1. The request doesn't make sense, and is probably (?) a mistake from the user.2. Cassandr'a behavior in this case is to do absolutely nothing, silently.So in some sense the behavior we had before this patch - giving a reasonably good error message - perhaps it is better than Cassandra's silent-forgiveness behavior in this case? The user will see the error message and understand the request probably has some typo.What I wonder, though, is perhaps there is some case where some code will assume Cassanra's behavior, creating an index called "xyz" unless it's already an index for anything. Could that possibly be a useful feature?It seems like the index namespace is global.It doesn't make sense to not return an error if the index name is already used for some other table.
On Wed, Aug 11, 2021 at 11:21 AM Benny Halevy <bha...@scylladb.com> wrote:On Tue, Aug 10, 2021, 22:05 Nadav Har'El <n...@scylladb.com> wrote:NOTE:Although I already created this patch, I'm not 100% sure it's a good idea. I'm starting to think maybe it's a bad idea :-(Eliran, you brought this potential issue up - what do you think?Yes, my patch makes our CQL implementation a tiny more compatible with Cassandra in some esoteric case.But on the other hand, the case it makes compatible is a case where:1. The request doesn't make sense, and is probably (?) a mistake from the user.2. Cassandr'a behavior in this case is to do absolutely nothing, silently.So in some sense the behavior we had before this patch - giving a reasonably good error message - perhaps it is better than Cassandra's silent-forgiveness behavior in this case? The user will see the error message and understand the request probably has some typo.What I wonder, though, is perhaps there is some case where some code will assume Cassanra's behavior, creating an index called "xyz" unless it's already an index for anything. Could that possibly be a useful feature?It seems like the index namespace is global.It doesn't make sense to not return an error if the index name is already used for some other table.It took me a while to understand the double negative :-)So if I understand you correctly, you want to return an error if the index name is used for a different table.I'd argue that if we do this, we should also return an error if the index name is used for a different column. The point is that in Scylla's index you don't use its "name" to query it - you just do a query on the base table, and expect to be able to do WHERE restrictions on the indexed column - so if the indexed column is different, it's not the same index - even if the same was chosen.
This is why I tend to think that Scylla's current behavior - printing an error in this case - is the correct one. Piotr Sarna also seems to lean in this direction according to his last mail. I'm also waiting for Eliran's opinion - he was the first one who suggested that the current behavior might be incorrect.
That's a great existential observation. What does it mean to exist?
a. An index with the same name exists
b. An index with exactly the same specification - including the name - exists.
I agree we should choose b. If anything in the request doesn't
match the existing index, we need to provide an error.