Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain: save action type directly instead of left shift it #39660

Merged
merged 13 commits into from
Dec 7, 2022
2 changes: 1 addition & 1 deletion domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func (do *Domain) tryLoadSchemaDiffs(m *meta.Meta, usedVersion, newVersion int64
}
phyTblIDs = append(phyTblIDs, IDs...)
for i := 0; i < len(IDs); i++ {
actions = append(actions, uint64(1<<diff.Type))
actions = append(actions, uint64(diff.Type))
}
}

Expand Down
5 changes: 2 additions & 3 deletions domain/schema_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@ func (s *schemaValidator) Update(leaseGrantTS uint64, oldVer, currVer int64, cha
actionTypes = change.ActionTypes
}
for idx, ac := range actionTypes {
// NOTE: ac is not an action type, it is (1 << action type).
if ac == 1<<model.ActionUnlockTable {
if ac == uint64(model.ActionUnlockTable) {
s.do.Store().GetMemCache().Delete(tblIDs[idx])
}
if ac == 1<<model.ActionFlashbackCluster {
if ac == uint64(model.ActionFlashbackCluster) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, PTAL @zimulala

s.do.InfoSyncer().GetSessionManager().KillNonFlashbackClusterConn()
}
}
Expand Down