TruncateLogRestoreTableIDsBlocklistFiles truncates the blocklist files whose restore commit ts is not larger than truncate until ts.
( ctx context.Context, s storage.ExternalStorage, untilTs uint64, )
| 255 | |
| 256 | // TruncateLogRestoreTableIDsBlocklistFiles truncates the blocklist files whose restore commit ts is not larger than truncate until ts. |
| 257 | func 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 | |
| 270 | type UniqueTableName struct { |
| 271 | DB string |