CASSANDRA-21157 add table_id to system_distributed.compression_dictionaries table#4601
CASSANDRA-21157 add table_id to system_distributed.compression_dictionaries table#4601smiklosovic wants to merge 2 commits intoapache:trunkfrom
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.
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.
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 ...
| */ | ||
| @Nullable | ||
| public static List<LightweightCompressionDictionary> retrieveLightweightCompressionDictionaries(String keyspaceName, String tableName) | ||
| public static List<LightweightCompressionDictionary> retrieveLightweightCompressionDictionaries() |
There was a problem hiding this comment.
Is it only called by retrieveOrphanedLightweightCompressionDictionaries. If so, should they consolidate?
There was a problem hiding this comment.
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.
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