mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 18:40:38 +00:00
only reading from view. The current implementation of materialized views does no keep the version to which a specific version of materialized view schema corresponds to. This complicate things especially on old views versions that the schema doesn't support anymore. However, the views, being also an independent table should allow reading from them as long as they exist even if the base table changed since then. For the reading purpose, we don't need to know the exact composition of view primary key columns that are not part of the base primary key, we only need to know that there are any, and this is a much looser constrain on the schema. We can rely on a table invariants such as the fact that pk columns are not going to disappear on newer version of the table. This means that if we don't find a view column in the base table, it is not a part of the base table primary key. This information is enough for us to perform read on the view. This commit adds support for being able to rely on such partial information along with a validation that it is not going to be used for writes. If it is, we simply abort since this means that our schema integrity is compromised.