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

NodeProbe: allow addressing table name with colon in it #355

Closed
wants to merge 1 commit into from

Conversation

nyh
Copy link
Contributor

@nyh nyh commented Nov 20, 2023

As the ObjectName documentation explains, when an addressing an MBean in JMX, when a value contains a comma, equals, colon or quote - it must be quoted, otherwise the ObjectName cannot be constructed.

CQL or Alternator table names cannot contain any of these characters, but in Alternator the names of secondary indexes do contain a colon, so before this patch nodetool cannot address them - it tries to construct an ObjectName with that name, and fails.

Note that "nodetool tablestats" is also broken by this bug, because even if the user doesn't try to specify one specific table, nodetool iterates on all tables and fails when it reaches the view with the colon in its name.

So this patch adds the missing quoting if the table name contains a colon. We don't quote table names that don't have a colon to preserve backward compatibility with old implmentation of JMX that don't know how to unquote these names. A separate patch to scylla-jmx added support for unquoting - see scylladb/scylla-jmx#227.

After this patch "nodetool tablestats" can work even if there is an Alternator GSI or LSI.

As the ObjectName documentation explains, when an addressing an MBean
in JMX, when a value contains a comma, equals, colon or quote - it must
be quoted, otherwise the ObjectName cannot be constructed.

CQL or Alternator table names cannot contain any of these characters,
but in Alternator the names of secondary indexes *do* contain a colon,
so before this patch nodetool cannot address them - it tries to
construct an ObjectName with that name, and fails.

Note that "nodetool tablestats" is also broken by this bug, because even
if the user doesn't try to specify one specific table, nodetool iterates
on all tables and fails when it reaches the view with the colon in its
name.

So this patch adds the missing quoting if the table name contains a
colon.  We don't quote table names that don't have a colon to preserve
backward compatibility with old implmentation of JMX that don't know
how to unquote these names. A separate patch to scylla-jmx added
support for unquoting - see scylladb/scylla-jmx#227.

After this patch "nodetool tablestats" can work even if there is an
Alternator GSI or LSI.

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

nyh commented Nov 20, 2023

See also pull requests in other repositories:

  1. Fix handling of table names with colon characters scylla-jmx#227 - patch for scylla-jmx to support the quoted table names that this patch can send for a table with a colon in its name.
  2. https://github.com/scylladb/scylla-dtest/pull/3738 - two dtests that reproduce the original bug, and check that it's fixed. This PR makes the nodetool tablestats test work after the JMX PR already made the necessary preperations and made nodetool info work.

@denesb
Copy link
Contributor

denesb commented Nov 21, 2023

@nyh should I wait for scylladb/scylla-jmx#227 to promote in scylla.git, or can I merge right away?

@mykaul
Copy link
Contributor

mykaul commented Nov 22, 2023

@nyh should I wait for scylladb/scylla-jmx#227 to promote in scylla.git, or can I merge right away?

It's merged, I think we can merge this one as well.

@denesb
Copy link
Contributor

denesb commented Nov 22, 2023

@nyh should I wait for scylladb/scylla-jmx#227 to promote in scylla.git, or can I merge right away?

It's merged, I think we can merge this one as well.

It is only queued, and it will probably need dequeuing because it is apparently causing problems.

@denesb denesb closed this in 26f5f71 Nov 23, 2023
@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
As the ObjectName documentation explains, when an addressing an MBean
in JMX, when a value contains a comma, equals, colon or quote - it must
be quoted, otherwise the ObjectName cannot be constructed.

CQL or Alternator table names cannot contain any of these characters,
but in Alternator the names of secondary indexes *do* contain a colon,
so before this patch nodetool cannot address them - it tries to
construct an ObjectName with that name, and fails.

Note that "nodetool tablestats" is also broken by this bug, because even
if the user doesn't try to specify one specific table, nodetool iterates
on all tables and fails when it reaches the view with the colon in its
name.

So this patch adds the missing quoting if the table name contains a
colon.  We don't quote table names that don't have a colon to preserve
backward compatibility with old implmentation of JMX that don't know
how to unquote these names. A separate patch to scylla-jmx added
support for unquoting - see scylladb/scylla-jmx#227.

After this patch "nodetool tablestats" can work even if there is an
Alternator GSI or LSI.

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

Closes: #355
(cherry picked from commit 26f5f71)
nyh added a commit that referenced this pull request Dec 5, 2023
As the ObjectName documentation explains, when an addressing an MBean
in JMX, when a value contains a comma, equals, colon or quote - it must
be quoted, otherwise the ObjectName cannot be constructed.

CQL or Alternator table names cannot contain any of these characters,
but in Alternator the names of secondary indexes *do* contain a colon,
so before this patch nodetool cannot address them - it tries to
construct an ObjectName with that name, and fails.

Note that "nodetool tablestats" is also broken by this bug, because even
if the user doesn't try to specify one specific table, nodetool iterates
on all tables and fails when it reaches the view with the colon in its
name.

So this patch adds the missing quoting if the table name contains a
colon.  We don't quote table names that don't have a colon to preserve
backward compatibility with old implmentation of JMX that don't know
how to unquote these names. A separate patch to scylla-jmx added
support for unquoting - see scylladb/scylla-jmx#227.

After this patch "nodetool tablestats" can work even if there is an
Alternator GSI or LSI.

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

Closes: #355
(cherry picked from commit 26f5f71)
(cherry picked from commit 3764ae9)
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

3 participants