Catalog Version Mismatch: A DDL occurred while processing this query error when refreshing multiple materialized views in YugabyteDB

18 views Asked by At

Dreaded Catalog Version Mismatch: A DDL occurred while processing this query error when refreshing multiple materialized views.

I'm using a few materialized views to cache slow foreign data wrapper tables on schedule. I have to make sure the refreshes don't overlap or I get the dreaded catalog mismatch.

I assume that refresh materialized view must therefore be considered DDL?

I can work around that with thread management but I find that if I do a DML query like an insert, I get the same issue if it happens at the same time (or very close to) a materialised view refresh.

A view refresh should only be data right? It doesn't refresh the design.

1

There are 1 answers

0
dh YB On

The reason this happens is because presently REFRESH MATERIALIZED VIEW is considered a DDL and a breaking catalog change -- the issue is tracked here https://github.com/yugabyte/yugabyte-db/issues/15788.

The temporary fix is to send a query for each statement.