Fix a bug in dependencies causing MVs to miss INSERTs#82222
Fix a bug in dependencies causing MVs to miss INSERTs#82222evillique merged 4 commits intoClickHouse:masterfrom
Conversation
|
The bug description: In the beginning, when we execute the CREATE query, we add a During the ALTER query we update this ClickHouse/src/Databases/DatabaseOrdinary.cpp Line 660 in 090cb5a After that if we rename ClickHouse/src/Interpreters/DatabaseCatalog.cpp Line 1601 in 090cb5a So now, if we to create another mv with the same name So finally we have From fiddle it seems like the first version where it reproduces is 25.5, so we probably only started to use these dependencies for inserts since #79963. |
| assert(tables_from.size() == 1); | ||
| const auto & the_table_from = *tables_from.begin(); | ||
|
|
||
| view_dependencies.removeDependency(the_table_from, StorageID{old_name, table_name}); |
There was a problem hiding this comment.
As far as I see, we always call removeDependency with remove_isolated_tables = true. What do you think about either removing remove_isolated_tables or changing its default value to make TablesDependencyGraph less bugphrone?
Cherry pick #82222 to 25.5: Fix a bug in dependencies causing MVs to miss INSERTs
Cherry pick #82222 to 25.6: Fix a bug in dependencies causing MVs to miss INSERTs
Backport #82222 to 25.6: Fix a bug in dependencies causing MVs to miss INSERTs
Backport #82222 to 25.5: Fix a bug in dependencies causing MVs to miss INSERTs
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix a bug in table dependencies causing Materialized Views to miss INSERT queries.
Documentation entry for user-facing changes