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

ColumnFamilyStore: only quote table names if necessary #230

Closed
wants to merge 1 commit into from

Conversation

nyh
Copy link
Contributor

@nyh nyh commented Nov 22, 2023

In a recent patch, we added quoting of table names to ColumnFamilyStore, to solve a bug where the existance of a table with a colon in its name broke various JMX requests.

I was under the impression that these quoted names were only used internally, for checking the validity of table names, and the code unquoted them when necessary. I thought based on my not-extensive-enough testing that nodetool now works correctly both when table names with colon names exist, and when they don't.

Unfortunately, further runs of all nodetool dtests revealed that the quoting broke the "nodetool getsstables" command (and only it). For some reason I don't fully understand yet, this specific command ends up using ColumnFamilyStore and getting confused by the quoted table names.

So in this patch, ColumnFamilyStore makes an effort to only quote a table name if it's necessary (i.e., contains a colon), and only unquote it when necessary.

After this patch, the tests for "nodetool tablestats" and "nodetool info" with a colon in a table's name continue to pass (these are the cases solved by the previous patches, and this patch doesn't break them), and the "nodetool getsstables" test starts working again.

In a recent patch, we added quoting of table names to ColumnFamilyStore,
to solve a bug where the existance of a table with a colon in its name
broke various JMX requests.

I was under the impression that these quoted names were only used
internally, for checking the validity of table names, and the code
unquoted them when necessary. I thought based on my not-extensive-enough
testing that nodetool now works correctly both when table names with
colon names exist, and when they don't.

Unfortunately, further runs of all nodetool dtests revealed that the
quoting broke the "nodetool getsstables" command (and only it).
For some reason I don't fully understand yet, this specific command
ends up using ColumnFamilyStore and getting confused by the quoted
table names.

So in this patch, ColumnFamilyStore makes an effort to only quote a
table name if it's necessary (i.e., contains a colon), and only unquote
it when necessary.

After this patch, the tests for "nodetool tablestats" and "nodetool
info" with a colon in a table's name continue to pass (these are
the cases solved by the previous patches, and this patch doesn't
break them), and the "nodetool getsstables" test starts working again.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
@nyh nyh requested a review from denesb November 22, 2023 16:49
@nyh
Copy link
Contributor Author

nyh commented Nov 22, 2023

Hi @denesb, this is a followup to the fix in #227 (it's a followup, meaning I assume you didn't revert that older patch). I'm sorry about the mess.

I confirmed that after this patch, the two dtests that failed the previous CI run now pass. I also confirmed that the two uncommitted dtests fixed by 227 didn't break by this patch. I didn't run all dtests again (life is too short), but I'm hopefull.

@denesb
Copy link
Contributor

denesb commented Nov 23, 2023

Submodule update PR: scylladb/scylladb#16146.

nyh added a commit that referenced this pull request Dec 5, 2023
In a recent patch, we added quoting of table names to ColumnFamilyStore,
to solve a bug where the existance of a table with a colon in its name
broke various JMX requests.

I was under the impression that these quoted names were only used
internally, for checking the validity of table names, and the code
unquoted them when necessary. I thought based on my not-extensive-enough
testing that nodetool now works correctly both when table names with
colon names exist, and when they don't.

Unfortunately, further runs of all nodetool dtests revealed that the
quoting broke the "nodetool getsstables" command (and only it).
For some reason I don't fully understand yet, this specific command
ends up using ColumnFamilyStore and getting confused by the quoted
table names.

So in this patch, ColumnFamilyStore makes an effort to only quote a
table name if it's necessary (i.e., contains a colon), and only unquote
it when necessary.

After this patch, the tests for "nodetool tablestats" and "nodetool
info" with a colon in a table's name continue to pass (these are
the cases solved by the previous patches, and this patch doesn't
break them), and the "nodetool getsstables" test starts working again.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>

Closes: #230
(cherry picked from commit e9b2644)
nyh added a commit that referenced this pull request Dec 5, 2023
In a recent patch, we added quoting of table names to ColumnFamilyStore,
to solve a bug where the existance of a table with a colon in its name
broke various JMX requests.

I was under the impression that these quoted names were only used
internally, for checking the validity of table names, and the code
unquoted them when necessary. I thought based on my not-extensive-enough
testing that nodetool now works correctly both when table names with
colon names exist, and when they don't.

Unfortunately, further runs of all nodetool dtests revealed that the
quoting broke the "nodetool getsstables" command (and only it).
For some reason I don't fully understand yet, this specific command
ends up using ColumnFamilyStore and getting confused by the quoted
table names.

So in this patch, ColumnFamilyStore makes an effort to only quote a
table name if it's necessary (i.e., contains a colon), and only unquote
it when necessary.

After this patch, the tests for "nodetool tablestats" and "nodetool
info" with a colon in a table's name continue to pass (these are
the cases solved by the previous patches, and this patch doesn't
break them), and the "nodetool getsstables" test starts working again.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>

Closes: #230
(cherry picked from commit e9b2644)
(cherry picked from commit f45067f)
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.

None yet

2 participants