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

Robert Coli commented on CASSANDRA-1585:
----------------------------------------

To anyone who is wondering about the manual way to do this :

1) create schema for NEW_Keyspace
2) stop writes to OLD_Keyspace from app (reads can continue)
3) flush OLD_Keyspace on every node, via nodetool
4) hard link all sstables from OLD_Keyspace directory to NEW_Keyspace directory
5) call nodetool -h localhost refresh NEW_Keyspace
6) enable reads/writes from/to NEW_Keyspace from app (disable reads on 
OLD_Keyspace)
7) clean up OLD_Keyspace (drop schema, delete files, etc.)

Alternately, if you don't want to do 2/6 because you can't tolerate 
OLD_Keyspace not being writable, you can enable writes to NEW_Keyspace, flush 
OLD_Keyspace, hard link the just-flushed tables and then enable reads from 
NEW_Keyspace. This resolves the delta with a shorter window where you can't 
write. 

The same technique could also be applied to renaming Columnfamilies, although 
in the Columnfamily case the files also need to be renamed. In Cassandra 1.1+, 
the files get renamed to include the Keyspace name, so that would have to 
change as appropriate.
                
> Support renaming columnfamilies and keyspaces
> ---------------------------------------------
>
>                 Key: CASSANDRA-1585
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1585
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Stu Hood
>            Priority: Minor
>
> Renames were briefly supported but were race-prone.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to