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

Some nodetool commands break when there is an Alternator GSI in the database #16153

Closed
nyh opened this issue Nov 23, 2023 · 14 comments
Closed

Some nodetool commands break when there is an Alternator GSI in the database #16153

nyh opened this issue Nov 23, 2023 · 14 comments
Assignees
Labels
Milestone

Comments

@nyh
Copy link
Contributor

nyh commented Nov 23, 2023

We already have an issue about this in a different repository, scylladb/scylla-jmx#226 because the fix is in scylla-jmx and scylla-tools-java, not scylladb core. But I'm nevertheless opening an issue also here because we will need to update the scylla-jmx and scylla-tools-java submodules - and this update will "Fixes" this issue. This will allow us to also track the backporting of this update.

Normally, CQL table names may only have alphanumeric characters or underscores. The DynamoDB API also adds dash and dot as allowed characters. But when Alternator creates a GSI or LSI, the materialized view name will also contain a ":" or "!" characters, respectively.

It turns out that JMX, used by nodetool, saves the Java Bean "address" of table names as Java ObjectName, which is constructed with a string like org.apache.cassandra.db:type=tname,keyspace=ksname,columnfamily=cfname. But when the cfname string contains a colon, it must be quoted. As the ObjectName documentation explains:

Each value associated with a key is a string of characters that is either unquoted or quoted.
An unquoted value is a possibly empty string of characters which may not contain any of the characters comma, equals, colon, or quote.

Of these characters (comma, equals, colon or quote), only the colon is actually possible in table names.

If we don't quote these names, two kinds of bugs can happen:

  1. Nodetool may fail when it tries to create an ObjectName to send to the JMX server.
  2. The JMX server may fail when it internally tries to list tables and save them as ObjectName.

There are three PRs that fix the known bugs:

And also a dtest PR that reproduce the bug - and verify the fix - specifically in "nodetool info" and "nodetool tablestates". We may need to write additional tests later (and it's possible we didn't fix all the nodetool bugs in this area...).

@nyh nyh added type/bug area/nodetool area/alternator Alternator related Issues labels Nov 23, 2023
@mykaul mykaul added this to the 6.0 milestone Nov 23, 2023
@mykaul mykaul added Backport candidate backport/5.4 Issues that should be backported to 5.4 branch once they'll be fixed backport/5.2 Issues that should be backported to 5.2 branch once they'll be fixed labels Nov 23, 2023
@eliransin
Copy link
Contributor

@scylladb/scylla-maint can someone handle the backport?
/cc @mykaul

@denesb
Copy link
Contributor

denesb commented Dec 5, 2023

@scylladb/scylla-maint can someone handle the backport? /cc @mykaul

The author is a maintainer himself, so he is the best candidate to do the backport.

@nyh
Copy link
Contributor Author

nyh commented Dec 5, 2023

@scylladb/scylla-maint can someone handle the backport? /cc @mykaul

The author is a maintainer himself, so he is the best candidate to do the backport.

Backporting with all these submodules is no fun, but I accept the challenge. I think because of all these submodules I can't really run CI before merging the various backport, so I hope I don't mess this up.

@denesb
Copy link
Contributor

denesb commented Dec 5, 2023

@scylladb/scylla-maint can someone handle the backport? /cc @mykaul

The author is a maintainer himself, so he is the best candidate to do the backport.

Backporting with all these submodules is no fun, but I accept the challenge. I think because of all these submodules I can't really run CI before merging the various backport, so I hope I don't mess this up.

If you are not sure, you can create a PR in scylla.git for the submodule update, and merge it yourself after CI passes.
I did the same when I backported the dependency updates.

@nyh
Copy link
Contributor Author

nyh commented Dec 5, 2023

@denesb you're right, but it still requires that I merge everything into the submodules first, without a PR. I'll think what is the least ugly and/or risky way to do this.

@mykaul
Copy link
Contributor

mykaul commented Dec 5, 2023

@denesb you're right, but it still requires that I merge everything into the submodules first, without a PR. I'll think what is the least ugly and/or risky way to do this.

Isn't the core issue that submodules do not have a meaningful CI?

@denesb
Copy link
Contributor

denesb commented Dec 5, 2023

@denesb you're right, but it still requires that I merge everything into the submodules first, without a PR. I'll think what is the least ugly and/or risky way to do this.

Yes, you have to cherry-pick the fixes onto the branch-X of the submodule, then push it to origin, and only after that create the PR in sscylla.git. You are right that if CI fails, you already pushed the branches in the submodule. Note that since the submodules are updated with explicit commits, we have a bit more freedom with force-pushes and we can even waive the bisectability requirement for submodule branches. If you find something went wrong, you can backport additional commits, or edit and force-push the existing commit.

@denesb
Copy link
Contributor

denesb commented Dec 5, 2023

@denesb you're right, but it still requires that I merge everything into the submodules first, without a PR. I'll think what is the least ugly and/or risky way to do this.

Isn't the core issue that submodules do not have a meaningful CI?

Yes, that is one of the issues. We merge/backport directly to master/branch-X not to next[-X].

nyh added a commit to nyh/scylla that referenced this issue Dec 5, 2023
Fixes scylladb#16153

* jmx 166599f...f45067f (3):
  > ColumnFamilyStore: only quote table names if necessary
  > APIBuilder: allow quoted scope names
  > ColumnFamilyStore: don't fail if there is a table with ":" in its name

* java dfbf3726ee...3764ae94db (1):
  > NodeProbe: allow addressing table name with colon in it

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
nyh added a commit to nyh/scylla that referenced this issue Dec 5, 2023
Fixes scylladb#16153

* jmx 166599f...f45067f (3):
  > ColumnFamilyStore: only quote table names if necessary
  > APIBuilder: allow quoted scope names
  > ColumnFamilyStore: don't fail if there is a table with ":" in its name

* java dfbf3726ee...3764ae94db (1):
  > NodeProbe: allow addressing table name with colon in it

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

nyh commented Dec 5, 2023

Merged into master submodules.
PR for the submodule updates:
#16294 (5.4)
#16296 (5.2)

When CI passes on those, I can merge them...

nyh added a commit to nyh/scylla that referenced this issue Dec 5, 2023
Fixes scylladb#16153

* java e716e1bd1d...80701efa8d (1):
  > NodeProbe: allow addressing table name with colon in it

/home/nyh/scylla/tools$ git submodule summary jmx | cat
* jmx bc4f8ea...f21550e (3):
  > ColumnFamilyStore: only quote table names if necessary
  > APIBuilder: allow quoted scope names
  > ColumnFamilyStore: don't fail if there is a table with ":" in its name

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

nyh commented Dec 5, 2023

@denesb you're right, but it still requires that I merge everything into the submodules first, without a PR. I'll think what is the least ugly and/or risky way to do this.

Yes, you have to cherry-pick the fixes onto the branch-X of the submodule, then push it to origin, and only after that create the PR in sscylla.git. You are right that if CI fails, you already pushed the branches in the submodule. Note that since the submodules are updated with explicit commits, we have a bit more freedom with force-pushes and we can even waive the bisectability requirement for submodule branches. If you find something went wrong, you can backport additional commits, or edit and force-push the existing commit.

Right, I know all this, but it's still extremely ugly and error-prone. Even if an error doesn't mean absolute disaster, it's still annoying, and is especially problematic if multiple people are trying to backport in parallel, which I admit isn't common. Anyway, I'll manage :-)

nyh added a commit that referenced this issue Dec 6, 2023
Fixes #16153

* jmx 166599f...f45067f (3):
  > ColumnFamilyStore: only quote table names if necessary
  > APIBuilder: allow quoted scope names
  > ColumnFamilyStore: don't fail if there is a table with ":" in its name

* java dfbf3726ee...3764ae94db (1):
  > NodeProbe: allow addressing table name with colon in it

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

Closes #16294
nyh added a commit that referenced this issue Dec 6, 2023
Fixes #16153

* java e716e1bd1d...80701efa8d (1):
  > NodeProbe: allow addressing table name with colon in it

/home/nyh/scylla/tools$ git submodule summary jmx | cat
* jmx bc4f8ea...f21550e (3):
  > ColumnFamilyStore: only quote table names if necessary
  > APIBuilder: allow quoted scope names
  > ColumnFamilyStore: don't fail if there is a table with ":" in its name

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

Closes #16296
@nyh
Copy link
Contributor Author

nyh commented Dec 6, 2023

Merged into master submodules. PR for the submodule updates: #16294 (5.4) #16296 (5.2)

When CI passes on those, I can merge them...

The two CI runs passed, and I now merged the tools/java and tools/jmx changes into the scylladb.git next-5.2 and next-5.4 branches. They should hopefully be promoted to branch-5.2 and branch-5.4 soon (which should be successful because the CI already tested that I didn't goof up the backport).

Please note that I did NOT backport the dtest commit (see https://github.com/scylladb/scylla-dtest/pull/3738) that verifies that these patches actually fixes the original bug.

@mykaul mykaul removed Backport candidate backport/5.2 Issues that should be backported to 5.2 branch once they'll be fixed backport/5.4 Issues that should be backported to 5.4 branch once they'll be fixed labels Dec 13, 2023
@nyh
Copy link
Contributor Author

nyh commented Jan 24, 2024

@kostja what is the meaning of assigning this closed issue to me? As I noted above, I already backported it to 5.2 and 5.4.
What else would you want me to do on this issue?
Did you perhaps intend to assign me some non-open-source-branch issue, not this one?

@kostja
Copy link
Contributor

kostja commented Jan 24, 2024

You worked on this issue, so I assigned it to you. It's good for the stats, and for getting notifications (sometimes there are notifications on closed issues).

@nyh
Copy link
Contributor Author

nyh commented Jan 24, 2024

Oh :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants