File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ use std::{
66} ;
77
88use common:: {
9+ bootstrap_model:: tables:: {
10+ TableMetadata ,
11+ TableState ,
12+ } ,
13+ document:: {
14+ ParseDocument ,
15+ ParsedDocument ,
16+ } ,
917 json:: JsonForm ,
1018 persistence:: {
1119 new_static_repeatable_recent,
@@ -547,6 +555,19 @@ fn add_revision(
547555 } ,
548556 _ => { } ,
549557 }
558+ if let Some ( new_doc) = revision_pair. document ( ) {
559+ let table_metadata: ParsedDocument < TableMetadata > = new_doc. parse ( ) ?;
560+ if table_metadata. state == TableState :: Deleting {
561+ // Hax alert! Remove shape tracking from soft-deleted tables'
562+ // summaries, to prevent old shapes from filling up the overall
563+ // table summary object.
564+ // It's not correct to remove the summary entry entirely because
565+ // we still want to be able to rewind through this revision.
566+ if let Some ( summary) = tables. get_mut ( & tablet_id) {
567+ summary. reset_shape ( ) ;
568+ }
569+ }
570+ }
550571 }
551572 let id = & revision_pair. id ;
552573 let summary = tables. entry ( id. table ( ) ) . or_insert_with (
You can’t perform that action at this time.
0 commit comments