Skip to content

Commit 20a2f8e

Browse files
committed
cursor bug
1 parent 607c2e4 commit 20a2f8e

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • apps/framework-cli/src/framework/core

apps/framework-cli/src/framework/core/plan.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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!(

0 commit comments

Comments
 (0)