mirror of https://github.com/apache/cassandra
handle schema loading when a node has had all keyspaces dropped. Patch by gdusbabek, reviewed by jbellis. CASSANDRA-1203.
git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@959722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
14e2a114ad
commit
ed623da76d
|
|
@ -438,8 +438,15 @@ public class DatabaseDescriptor
|
|||
Table.open(def.name);
|
||||
}
|
||||
|
||||
// since we loaded definitions from local storage, log a warning if definitions exist in yaml.
|
||||
// happens when someone manually deletes all tables and restarts.
|
||||
if (tableDefs.size() == 0)
|
||||
{
|
||||
logger.warn("No schema definitions were found in local storage.");
|
||||
// set defsVersion so that migrations leading up to emptiness aren't replayed.
|
||||
defsVersion = uuid;
|
||||
}
|
||||
|
||||
// since we loaded definitions from local storage, log a warning if definitions exist in yaml.
|
||||
if (conf.keyspaces != null && conf.keyspaces.size() > 0)
|
||||
logger.warn("Schema definitions were defined both locally and in " + STORAGE_CONF_FILE +
|
||||
". Definitions in " + STORAGE_CONF_FILE + " were ignored.");
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ public class DefsTable
|
|||
Collection<KSMetaData> tables = new ArrayList<KSMetaData>();
|
||||
for (IColumn col : cf.getSortedColumns())
|
||||
{
|
||||
// don't allow deleted columns.
|
||||
if (col instanceof DeletedColumn)
|
||||
continue;
|
||||
KSMetaData ks = KSMetaData.deserialize(new ByteArrayInputStream(col.value()));
|
||||
tables.add(ks);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue