File tree Expand file tree Collapse file tree
apps/framework-cli/src/framework/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -399,17 +399,20 @@ pub async fn reconcile_with_reality<T: OlapOperations + Sync>(
399399 // Update mismatched MVs (exist in both but differ)
400400 for change in discrepancies. mismatched_materialized_views {
401401 match change {
402- OlapChange :: MaterializedView ( Change :: Updated { before, .. } ) => {
402+ OlapChange :: MaterializedView ( Change :: Updated { before, after } ) => {
403403 // We use 'before' (the actual MV from reality) because we want the
404404 // reconciled map to reflect the current state of the database.
405- let name = & before. name ;
405+ let name = before. name . clone ( ) ;
406406 debug ! (
407407 "Updating mismatched materialized view in infrastructure map to match reality: {}" ,
408408 name
409409 ) ;
410- reconciled_map
411- . materialized_views
412- . insert ( name. clone ( ) , * before) ;
410+ let mut mv = * before;
411+ // Preserve lifecycle from the infra map, matching the pattern used for tables.
412+ // The reality MV always has FullyManaged since ClickHouse doesn't store
413+ // lifecycle metadata; the infra map is the source of truth.
414+ mv. life_cycle = after. life_cycle ;
415+ reconciled_map. materialized_views . insert ( name, mv) ;
413416 }
414417 _ => {
415418 tracing:: warn!(
You can’t perform that action at this time.
0 commit comments