[
https://issues.apache.org/jira/browse/CASSANDRA-11875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312874#comment-15312874
]
Paulo Motta commented on CASSANDRA-11875:
-----------------------------------------
Thanks for the update. Overall the patch is looking much better, just a few
minor nits:
* CONVERT_SSTABLES("Converte sstables") -> CONVERT_SSTABLES("Convert sstables"),
* {{compatibleForWriting}} set on BigFormat is a constant, so should probably
be named {{supported_write_formats}} and move next to {{current_version}} and
{{earliest_supported_version}} to be consistent with other constants in
{{BigVersion}}
* We should probably add a {{Descriptor.isCompatibleForWriting}} so we can
check that directly from the descriptor, and use that to throw an exception on
{{SSTableConverter}} if the version is incompatible
** You may have a look on a similar situation on
{{ColumnFamilyStore.loadNewSSTables}}
On the tests, it would be nice if you could read the data before and after
converting (SELECT) to verify it's consistent. Similarly, you should check that
commit log lower bound is different from {{ReplayPosition.NONE}} before the
conversion. On {{testUnsupportedVersionShouldFail}} the test does not guarantee
the program failed with an error, so it's probably better to test that an
exception is being thrown when you try to convert with {{SSTableConverter}}
with an unsupported version.
bq. I'm not sure if we have to make StandaloneUpgrader subclass of
StandaloneConverter. I did a WIP for that, since we have to validate passed
args (validate and add latestVersion to it), we should maintain original
parseArgs of StandaloneUpgrader, also since printUsage is different from
StandaloneConverter we should also maintain it.
The idea of your WIP is correct, but instead of calling the main method of
{{StandaloneUpgrader}} you could create a common method that receives an
{{Options}} object, which in the case of the upgrader it would have a special
flag indicating upgrade to latest version. The argument parsing and Options
creation could be removed from the Options object to the main class so it's
different between the converter and the upgrader. You can do different printing
based on the options flag.
> Create sstableconvert tool 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)