Skip to content

2025.2.0.0-b94

@hulien22 hulien22 tagged this 07 Nov 22:34
Summary:
Adding support for CREATE/ALTER/DROP MATERIALIZED VIEW as well as REFRESH MATERIALIZED VIEW.

- Create is implemented similarly to CTAS, where we do not perform the data fill on the target (that data is just replicated to the other side). There is additional handling for CREATE ... WITH DATA, where we need to also mark the table as scannable on the target.
- Drop is similar to other drop relation commands.
- Alter is similar to pg only ddls, these commands don't change any data in the materialized views.
- Refresh is a table rewrite, so we follow the same behaviour there of not performing the data fill on the target.

Also making changes to `IsTableEligibleForXClusterReplication` as materialized views are a new table type that's only supported in automatic mode (still disabled in other modes).
Jira: DB-18198

Original commit: 159dde75013bf54db488e4959bc9b2011cda254d / D47644

Test Plan:
```
ybd --cxx-test integration-tests_xcluster_ddl_replication-test --gtest_filter XClusterDDLReplicationTest.MatViewWithIndex
ybd --cxx-test integration-tests_xcluster_ddl_replication-test --gtest_filter XClusterDDLReplicationTest.MatViewWithColocation
ybd --cxx-test integration-tests_xcluster_ddl_replication-test --gtest_filter XClusterDDLReplicationTest.MatViewWithPartitions
ybd --cxx-test integration-tests_xcluster_ddl_replication_pgregress-test --gtest_filter XClusterPgRegressDDLReplicationTest.PgRegressMaterializedViews
```

Reviewers: hsunder, mlillibridge, xCluster

Reviewed By: mlillibridge

Subscribers: ybase, xCluster, yql

Differential Revision: https://phorge.dev.yugabyte.com/D48109
Assets 2
Loading