pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.42k stars 5.85k forks source link

snapshot infoschema should block GC #57952

Open tiancaiamao opened 15 hours ago

tiancaiamao commented 15 hours ago

Enhancement

Currently, the meta package use old transaction API, unlike normal internal transaction, those APIs can not block the GC worker (not updating min start ts).

This may cause "GC life time is shorter than transaction duration" error for InfoSchema V2.

Maybe a possible fix is collect the min start ts of all snapshot infoschemas.

tiancaiamao commented 15 hours ago

/cc @MyonKeminta

lance6716 commented 1 hour ago

maybe https://github.com/pingcap/tidb/issues/57960 is also related? Maintaining minTS for GC should be designed at a proper layer, without these special handling of infoschema and analyze

tiancaiamao commented 5 minutes ago

maybe #57960 is also related? Maintaining minTS for GC should be designed at a proper layer, without these special handling of infoschema and analyze

I'm not sure. We need to check the error stack to confirm it.