Closed zuyu closed 8 years ago
@zuyu: So what happens when the catalog changes?
I have one refactoring suggestion for better performance and echoing @pateljm's question on catalog changes.
@pateljm @hbdeshmukh As noted in #110, we does not support schema changes.
When we support schema changes, we may want to have a version number in CatalogRelationSchema
to indicate whether we need to update CatalogDatabaseCache
in another separate PR.
If the changed schema has been cached, a naive way is to flush all the blocks belonged to the schema to the disk, before we reset the schema. There are certain scheduling optimization could be done as well, i.e., postpone the schema changes unless no queries are using it.
@hbdeshmukh I've refactored using fine-grained locks to update CatalogRelationSchema
s. Please take a look. Thanks!
Looks good, merging.
In distributed version, it is not safe to update cached
CatalogRelationSchema
on the fly, while some storage blocks still have reference to the existing schema.So, disable updates in the cache for now.