Skip to content

Commit

Permalink
Allow removing LocationInfo sstables (to allow cluster rename)
Browse files Browse the repository at this point in the history
patch by amorton; reviewed by slebresne for CASSANDRA-2632


git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1101792 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pcmanus committed May 11, 2011
1 parent c8f2414 commit c5bb467
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Don't allow {LOCAL|EACH}_QUORUM unless strategy is NTS (CASSANDRA-2627)
* Fix regression where bootstrapping a node with no schema fails
(CASSANDRA-2625)
* Allow removing LocationInfo sstables (CASSANDRA-2632)


0.7.5
Expand Down
15 changes: 3 additions & 12 deletions src/java/org/apache/cassandra/db/SystemTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,9 @@ public static void checkHealth() throws ConfigurationException, IOException
if (cf == null)
{
// this is either a brand new node (there will be no files), or the partitioner was changed from RP to OPP.
for (String path : DatabaseDescriptor.getAllDataFileLocationsForTable("system"))
{
File[] dbContents = new File(path).listFiles(new FilenameFilter()
{
public boolean accept(File dir, String name)
{
return name.endsWith(".db");
}
});
if (dbContents.length > 0)
throw new ConfigurationException("Found system table files, but they couldn't be loaded. Did you change the partitioner?");
}
ColumnFamilyStore cfs = table.getColumnFamilyStore(STATUS_CF);
if (!cfs.getSSTables().isEmpty())
throw new ConfigurationException("Found system table files, but they couldn't be loaded. Did you change the partitioner?");

// no system files. this is a new node.
RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, LOCATION_KEY);
Expand Down

0 comments on commit c5bb467

Please sign in to comment.