Skip to content

Commit

Permalink
Merge pull request pingcap#32 from tangenta/new_writer-18
Browse files Browse the repository at this point in the history
fix miss one key inconsistency
  • Loading branch information
wjhuang2016 authored Jul 26, 2023
2 parents eddfd26 + 2f9dc76 commit b82e30b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions br/pkg/lightning/backend/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -1643,8 +1643,8 @@ func (remote *Backend) writeToTiKV(ctx context.Context, j *regionJob) error {
begin := time.Now()
region := j.region.Region

firstKey := codec.EncodeBytes([]byte{}, j.keyRange.start)
lastKey := codec.EncodeBytes([]byte{}, j.keyRange.end)
firstKey := codec.EncodeBytes([]byte{}, j.writeBatch[0].key)
lastKey := codec.EncodeBytes([]byte{}, j.writeBatch[len(j.writeBatch)-1].key)

u := uuid.New()
meta := &sst.SSTMeta{
Expand Down Expand Up @@ -1743,14 +1743,6 @@ func (remote *Backend) writeToTiKV(ctx context.Context, j *regionJob) error {
var remainingStartKey []byte
startTime := time.Now()
for iter.Next() {
key := kv.Key(iter.Key())
if key.Cmp(j.keyRange.start) < 0 {
continue
}
if key.Cmp(j.keyRange.end) > 0 {
break
}

//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

0 comments on commit b82e30b

Please sign in to comment.