Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
  • Loading branch information
wjhuang2016 committed Jul 26, 2023
1 parent 1153120 commit eddfd26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions br/pkg/lightning/backend/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -1717,16 +1717,6 @@ func (remote *Backend) writeToTiKV(ctx context.Context, j *regionJob) error {
return errors.Trace(err)
}
requests[i].Chunk.(*sst.WriteRequest_Batch).Batch.Pairs = pairs[:count]

var prevKey []byte
for _, pair := range pairs[:count] {
if len(prevKey) > 0 && bytes.Compare(prevKey, pair.Key) >= 0 {
log.FromContext(context.Background()).Error("", zap.ByteString("prevKey", prevKey), zap.ByteString("key", pair.Key))
return errors.New("write batch keys are not in order")
}
prevKey = pair.Key
}

if err := clients[i].Send(requests[i]); err != nil {
res := sst.WriteResponse{}
newErr := clients[i].RecvMsg(&res)
Expand All @@ -1752,7 +1742,6 @@ func (remote *Backend) writeToTiKV(ctx context.Context, j *regionJob) error {

var remainingStartKey []byte
startTime := time.Now()
var prevKey []byte
for iter.Next() {
key := kv.Key(iter.Key())
if key.Cmp(j.keyRange.start) < 0 {
Expand All @@ -1762,12 +1751,6 @@ func (remote *Backend) writeToTiKV(ctx context.Context, j *regionJob) error {
break
}

if len(prevKey) > 0 && bytes.Compare(prevKey, key) >= 0 {
log.FromContext(context.Background()).Error("", zap.Any("prevKey", prevKey), zap.Any("key", key))
return errors.New("write batch keys are not in order")
}
prevKey = key.Clone()

//readableKey := hex.EncodeToString(iter.Key())
//_, _, vals, err := tablecodec.DecodeIndexKey(iter.Key())
//log.FromContext(ctx).Info("iter", zap.String("key", readableKey), zap.String("colVal", vals[0]), zap.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion ddl/disttask_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (h *litBackfillFlowHandle) splitSubtaskRanges(ctx context.Context, taskHand
return nil, err
}
if len(splitKey) == 0 {
endKey = lastKey
endKey = lastKey.Next()
} else {
endKey = splitKey.Clone()
}
Expand Down

0 comments on commit eddfd26

Please sign in to comment.