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

txn: add ts information in the pre split path #1206

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions txnkv/transaction/2pc.go
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,8 @@ func (c *twoPhaseCommitter) groupMutations(bo *retry.Backoffer, mutations Commit
if uint32(group.mutations.Len()) >= preSplitDetectThresholdVal {
logutil.BgLogger().Info("2PC detect large amount of mutations on a single region",
zap.Uint64("region", group.region.GetID()),
zap.Int("mutations count", group.mutations.Len()))
zap.Int("mutations count", group.mutations.Len()),
zap.Uint64("startTS", c.startTS))
if c.preSplitRegion(bo.GetCtx(), group) {
didPreSplit = true
}
Expand Down Expand Up @@ -905,14 +906,15 @@ func (c *twoPhaseCommitter) preSplitRegion(ctx context.Context, group groupedMut
regionIDs, err := c.store.SplitRegions(ctx, splitKeys, true, nil)
if err != nil {
logutil.BgLogger().Warn("2PC split regions failed", zap.Uint64("regionID", group.region.GetID()),
zap.Int("keys count", keysLength), zap.Error(err))
zap.Int("keys count", keysLength), zap.Error(err), zap.Uint64("startTS", c.startTS))
return false
}

for _, regionID := range regionIDs {
err := c.store.WaitScatterRegionFinish(ctx, regionID, 0)
if err != nil {
logutil.BgLogger().Warn("2PC wait scatter region failed", zap.Uint64("regionID", regionID), zap.Error(err))
logutil.BgLogger().Warn("2PC wait scatter region failed", zap.Uint64("regionID", regionID), zap.Error(err),
zap.Uint64("startTS", c.startTS))
}
}
// Invalidate the old region cache information.
Expand Down
Loading