Skip to content
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

cassandra-stress: switch create table to use keyspace.table format #358

Closed
wants to merge 1 commit into from

Conversation

roydahan
Copy link
Collaborator

Stop using "Use keyspace" since it can fail when using multiple stress commands in parallel due to a race condition.

fixes: #356

Stop using "Use keyspace" since it can fail when using multiple
stress commands in parallel due to a race condition.

fixes: scylladb#356
@@ -152,7 +150,7 @@ String createStandard1StatementCQL3(StressSettings settings)
StringBuilder b = new StringBuilder();

b.append("CREATE TABLE IF NOT EXISTS ")
.append("standard1 (key blob PRIMARY KEY ");
.append("\""+keyspace+"\"".standard1 (key blob PRIMARY KEY ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createCounter1StatementCQL3 might be missing it as well, even that I didn't found any place in the code that calls it.

@mykaul
Copy link
Contributor

mykaul commented Dec 28, 2023

ping

@roydahan
Copy link
Collaborator Author

I never had the chance to test it, but it's also very rare case, so not urgent.

@roydahan roydahan requested a review from avelanarius January 16, 2024 23:55
@avelanarius
Copy link

avelanarius commented Jan 17, 2024

Does it really solve #356? I don't see why it'd solve that problem - if USE keyspace would fail, why wouldn't CREATE keyspace.table also fail?

@roydahan
Copy link
Collaborator Author

The problem happens when you run multiple clients at the same time.
It's a race condition that would be hard to prove that is fixed.
However, In any case I don't see any benefit of using "USE keyspace" instead of creating with full path.

I still need to test that it doesn't break anything, just didn't find a time for it yet.

@mykaul
Copy link
Contributor

mykaul commented Feb 7, 2024

What's holding this?

@avelanarius
Copy link

What's holding this?

This PR lacks any explanation/proof why this really fixes the problem.

And personally I believe that this doesn't fix anything. If it really fixed the problem, that would mean that there is a serious bug in Java Driver around USE statements that should be fixed and not worked around.

@fruch
Copy link
Contributor

fruch commented Feb 7, 2024

What's holding this?

This PR lacks any explanation/proof why this really fixes the problem.

And personally I believe that this doesn't fix anything. If it really fixed the problem, that would mean that there is a serious bug in Java Driver around USE statements that should be fixed and not worked around.

see scylladb/scylladb#16969, it's a really issue in scylla's end, that create KS doesn't always return to the driver that the schema has changed.

anyhow this change is removing one command, that lower the changes of this issue to be happening

@fruch
Copy link
Contributor

fruch commented Feb 7, 2024

taking this change locally, it won't work.

the rest of the calls in c-s are depended on this USE call...

one need to go all over the place to make sure it's mentioning the keyspace in any CQL command is executed

@roydahan
Copy link
Collaborator Author

The real fix should be this one: scylladb/scylladb#16969.
Closing this in favor of handling the real issue.

@roydahan roydahan closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cassandra-stress] creation code of the schema isn't safe
4 participants