Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Possible panic when restore a backup that enables cross table merge. #608

Closed
overvenus opened this issue Nov 20, 2020 · 2 comments
Closed
Labels
type/bug Something isn't working

Comments

@overvenus
Copy link
Member

PD can merge regions that belong to different tables. It is possible that a region's start key and end key have different table IDs. And it breaks BR restore's prerequisite. BR needs to be able to restore such regions.

br/pkg/restore/util.go

Lines 200 to 207 in bb4294d

tableID := tablecodec.DecodeTableID(file.GetStartKey())
tableEndID := tablecodec.DecodeTableID(file.GetEndKey())
if tableID != tableEndID {
log.Panic("key range spread between many files.",
zap.String("file name", file.Name),
zap.Stringer("start key", utils.WrapKey(file.GetStartKey())),
zap.Stringer("end key", utils.WrapKey(file.GetEndKey())))
}

Cc tikv/pd#3129

@overvenus overvenus added the type/bug Something isn't working label Nov 20, 2020
@3pointer
Copy link
Collaborator

even PD can merge two table in same the region, BR will backup two tables separately due to BackupRanges, so the each SST file will only contain one tableID.

@overvenus
Copy link
Member Author

Right, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants