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

Paulo Motta commented on CASSANDRA-8928:
----------------------------------------

bq. I tried to find something similar of changes on version 2.2 but I didn't 
find anything, do you have any similar references or similar things, I'll try 
to see if I can breakdown it, but it seems quite difficult in the sense that 
I'm not familiar with Cassandra code base.

This [blog 
post|http://distributeddatastore.blogspot.com.br/2013/08/cassandra-sstable-storage-format.html]
 might have some useful info on previous sstable format to start with. I 
understand this is not a trivial task so you might need to do a lot of 
background reading before start doing some real work. You might want to watch 
these 
[tutorials|http://www.datastax.com/dev/blog/deep-into-cassandra-internals] on 
C* internals, in particular the read write path and compactions to understand 
in which context sstables fit in. The [ccm|https://github.com/pcmanus/ccm] tool 
is very handy to create throw-away cassandra clusters.

A simple exercise you can make to get acquainted with the sstable format is to 
create a simple table on C* 2.2, insert some data on it, and inspect it with 
[sstable2json 
tool|https://docs.datastax.com/en/cassandra/1.2/cassandra/tools/toolsSStable2json_t.html].
 Then create the same table on C* 3.X and inspect it with 
[sstabledump|http://www.datastax.com/dev/blog/debugging-sstables-in-3-0-with-sstabledump]
 and compare the results. 

After that you might inspect the {{StandaloneScrubber}} class on {{trunk}} 
(which implements the 
[sstablescrub|https://docs.datastax.com/en/cassandra/1.2/cassandra/tools/toolsSSTableScrub_t.html]
 tool) to understand the flow of reading an sstable and rewriting it in the 
current format + fix corruptions. Then you might want to hack this tool to read 
in the current format and write in the {{ka}} format by replacing the 
{{SSTableRewriter}} with a {{LegacySSTableWriter}} that could initially be a 
copy of the 2.2 {{BigTableWriter}} (you'll probably have fun for a few weeks 
with this already).

bq. Also before jumping to draw up the framework, I'd like to know is our 
purpose downgrade an existing SSTable to certain older version or add the 
possibility to write older version of SSTable?

SSTable are immutable structures, so in order to downgrade and existing sstable 
you need to read it in the current format and then write it in an older format. 
So the flow is: la-sstable -> <downgradesstables> -> ka-sstable

Please note that if you have questions along the way you can also reach out on 
#cassandra-dev on irc.freenode.net.

> Add downgradesstables
> ---------------------
>
>                 Key: CASSANDRA-8928
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8928
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Priority: Minor
>              Labels: gsoc2016, mentor
>
> As mentioned in other places such as CASSANDRA-8047 and in the wild, 
> sometimes you need to go back.  A downgrade sstables utility would be nice 
> for a lot of reasons and I don't know that supporting going back to the 
> previous major version format would be too much code since we already support 
> reading the previous version.



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

Reply via email to