-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-21157 add table_id to system_distributed.compression_dictionaries table #4601
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
base: trunk
Are you sure you want to change the base?
Conversation
e283bc1 to
5e48792
Compare
5e48792 to
967aaa0
Compare
5642c85 to
773db9a
Compare
| "PRIMARY KEY ((keyspace_name, table_name), table_id, dict_id)) " + | ||
| "WITH CLUSTERING ORDER BY (table_id DESC, dict_id DESC)"; // in order to retrieve the latest dictionary; the contract is the newer the dictionary the larger the dict_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should table_id be part of the partition key? (instead of being a clustering key).
dict_id is used to order the dictionaries for the same table. The table_id is not useful for the purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that means that we would need to specify it every single time. If I just want to see what is there for keyspace / table I can't because I would need to know table id too. We also do not need to be afraid that we would fetch "too much" if PK is just keyspace and table, because these are retrieved in a lightweight manner anyway and we have a way how to clear orphaned too so ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair.
| */ | ||
| @Nullable | ||
| public static List<LightweightCompressionDictionary> retrieveLightweightCompressionDictionaries(String keyspaceName, String tableName) | ||
| public static List<LightweightCompressionDictionary> retrieveLightweightCompressionDictionaries() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it only called by retrieveOrphanedLightweightCompressionDictionaries. If so, should they consolidate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is possible but I would just keep it how it is, I guess that having a way to just fetch everything, being it lightweight, does not hurt at all, for possible future usages we do not know how would look like yet.
| @Command(name = "cleanup", description = "Clean up orphaned dictionaries by deleting them from " + SystemDistributedKeyspace.NAME | ||
| + '.' + SystemDistributedKeyspace.COMPRESSION_DICTIONARIES + | ||
| " table, these are ones for which a table they were trained for was dropped.") | ||
| public static class CleanupDictionaries extends AbstractCommand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about CleanupOrphanedDictionaries? Just to be super clear
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira