[ 
https://issues.apache.org/jira/browse/CASSANDRA-11875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15303207#comment-15303207
 ] 

Paulo Motta commented on CASSANDRA-11875:
-----------------------------------------

This looks good so far. Since {{Upgrader}} and {{Downgrader}} are basically the 
same, with the difference that in {{Upgrader}} {{version == 
DatabaseDescriptor.getSSTableFormat().info.getLatestVersion()}}, we can 
probably unify those into a single {{SSTableConverter}} class that receives a 
version as argument in the constructor. 

We can also probably rename {{StandaloneDowngrader}} and {{sstabledowngrader}} 
to {{StandaloneSSTableConverter}} and {{sstableconvert}}, since it basically 
converts sstables in any readable format to sstables in a specific version, 
including the current. Another simplification we can do is to make 
{{StandaloneUpgrader}} a subclass of {{StandaloneSSTableConverter}}, since it's 
basically the same, with the difference that it only converts to the latest 
version (we must keep it for backward compatibility). I will update the ticket 
description to reflect that.

Right now {{StandaloneSSTableConverter}} only converts to {{ma}} version, but 
it would be nice to accept {{version}} as parameter so we can already fail when 
trying to convert to an unsupported format.

It would also be nice to add a simple test suite for {{SStableConverter}} that 
checks that conversion from mb to ma is working as expected and that converting 
to unsupported versions throws a proper exception.

One minor nit is that you should create the patch file from the root directory, 
not from the src directory.

bq. Digest component is always created according to latest version(Reference), 
should it be also modified?

yes

> Create StandaloneDowngrader with support to ma format
> -----------------------------------------------------
>
>                 Key: CASSANDRA-11875
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11875
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: Tools
>            Reporter: Paulo Motta
>            Assignee: Kaide Mu
>            Priority: Minor
>         Attachments: trunk-11875-WIP-V1.patch
>
>
> Currently {{Upgrader}} receives an sstable in any readable format, and writes 
> into {{BigFormat.getLatestVersion()}}. We should generalize it by making it 
> receive a {{target}} version and probably also rename it to 
> {{SSTableConverter}}. 
> Based on this we can create an {{StandaloneDowngrader}} tool which will 
> perform downgrade of specified sstables to a target version. To start with, 
> we should support only downgrading to {{ma}} format (from current format 
> {{mb}}), downgrade to any other version should be forbidden. Since we already 
> support serializing to "ma" we will not need to do any data conversion.
> We should also create a test suite that creates an sstable with data in the 
> current format, perform the downgrade, and verify data in the new format is 
> correct. This will be the base tests suite for more advanced conversions in 
> the future.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to