MCPcopy
hub / github.com/pingcap/tidb / TruncateLogRestoreTableIDsBlocklistFiles

Function TruncateLogRestoreTableIDsBlocklistFiles

br/pkg/restore/misc.go:257–268  ·  view source on GitHub ↗

TruncateLogRestoreTableIDsBlocklistFiles truncates the blocklist files whose restore commit ts is not larger than truncate until ts.

(
	ctx context.Context,
	s storage.ExternalStorage,
	untilTs uint64,
)

Source from the content-addressed store, hash-verified

255
256// TruncateLogRestoreTableIDsBlocklistFiles truncates the blocklist files whose restore commit ts is not larger than truncate until ts.
257func TruncateLogRestoreTableIDsBlocklistFiles(
258 ctx context.Context,
259 s storage.ExternalStorage,
260 untilTs uint64,
261) error {
262 err := fastWalkLogRestoreTableIDsBlocklistFile(ctx, s, func(restoreCommitTs, restoreTargetTs uint64) bool {
263 return untilTs < restoreCommitTs
264 }, func(ctx context.Context, filename string, _, _, _ uint64, _, _ []int64) error {
265 return s.DeleteFile(ctx, filename)
266 })
267 return errors.Trace(err)
268}
269
270type UniqueTableName struct {
271 DB string

Callers 2

RunStreamTruncateFunction · 0.92

Calls 2

DeleteFileMethod · 0.65