@@ -1926,6 +1926,7 @@ func (sm *SnapshotMeta) AccountToTableSnapshots(
19261926 dbTableSnapshots [dbID ] = make ([]types.TS , 0 )
19271927 }
19281928 dbTableSnapshots [dbID ] = append (dbTableSnapshots [dbID ], tableTSList ... )
1929+ delete (snapshots .tables , tableID )
19291930 }
19301931 }
19311932 }
@@ -1952,14 +1953,14 @@ func (sm *SnapshotMeta) AccountToTableSnapshots(
19521953 var allApplicableSnapshots []types.TS
19531954
19541955 // 1. Add table-specific snapshots
1955- // if tableTSList := snapshots.tables[tid]; len(tableTSList) > 0 {
1956- // logutil.Warn("GC-PANIC-DUP-TABLE-SNAP",
1957- // zap.String("level", "table"),
1958- // zap.Uint64("id", tid),
1959- // zap.Int("count", len(tableTSList)),
1960- // )
1961- // allApplicableSnapshots = append(allApplicableSnapshots, tableTSList...)
1962- // }
1956+ if tableTSList := snapshots .tables [tid ]; len (tableTSList ) > 0 {
1957+ logutil .Warn ("GC-PANIC-DUP-TABLE-SNAP" ,
1958+ zap .String ("level" , "table" ),
1959+ zap .Uint64 ("id" , tid ),
1960+ zap .Int ("count" , len (tableTSList )),
1961+ )
1962+ allApplicableSnapshots = append (allApplicableSnapshots , tableTSList ... )
1963+ }
19631964
19641965 // 2. Add snapshots from other tables in the same database (if any table in this DB has snapshots)
19651966 if dbTableTSList := dbTableSnapshots [info .dbID ]; len (dbTableTSList ) > 0 {
@@ -2033,6 +2034,7 @@ func (sm *SnapshotMeta) MergeTableInfo(
20332034 dbTableSnapshots [dbID ] = make ([]types.TS , 0 )
20342035 }
20352036 dbTableSnapshots [dbID ] = append (dbTableSnapshots [dbID ], tableTSList ... )
2037+ delete (snapshots .tables , tableID )
20362038 }
20372039 }
20382040 }
@@ -2057,9 +2059,9 @@ func (sm *SnapshotMeta) MergeTableInfo(
20572059 var applicableSnapshots []types.TS
20582060
20592061 // 1. Add table-specific snapshots
2060- // if tableSnapshots := snapshots.tables[table.tid]; len(tableSnapshots) > 0 {
2061- // applicableSnapshots = append(applicableSnapshots, tableSnapshots...)
2062- // }
2062+ if tableSnapshots := snapshots .tables [table .tid ]; len (tableSnapshots ) > 0 {
2063+ applicableSnapshots = append (applicableSnapshots , tableSnapshots ... )
2064+ }
20632065
20642066 // 2. Add snapshots from other tables in the same database (if any table in this DB has snapshots)
20652067 if dbTableTSList := dbTableSnapshots [table .dbID ]; len (dbTableTSList ) > 0 {
0 commit comments