schema_tables: Don't alter tables which differ only in version

We apply deletion of scylla_tables.version to the incoming schema
mutations so that table schema version is recalculated after merge.
The mutations which we read from local schema tables may not have it
deleted in which case all tables would be considered as differing on
the presence of the version field. Avoid this by deleting the field
from old mutations as well.
This commit is contained in:
Tomasz Grabiec
2017-09-14 19:09:18 +02:00
parent 99272087e6
commit f943d2efbf
2 changed files with 13 additions and 0 deletions

View File

@@ -801,6 +801,15 @@ static future<> do_merge_schema(distributed<service::storage_proxy>& proxy, std:
/*auto& old_aggregates = */read_schema_for_keyspaces(proxy, AGGREGATES, keyspaces).get0();
#endif
// Incoming mutations have the version field deleted. Delete here as well so that
// schemas which are otherwise equal don't appear as differing.
for (auto&& e : old_column_families) {
schema_mutations& sm = e.second;
if (sm.scylla_tables()) {
delete_schema_version(*sm.scylla_tables());
}
}
proxy.local().mutate_locally(std::move(mutations)).get0();
if (do_flush) {

View File

@@ -69,6 +69,10 @@ public:
return _scylla_tables;
}
mutation_opt& scylla_tables() {
return _scylla_tables;
}
const mutation_opt& indices_mutation() const {
return _indices;
}