Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#57454
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
xuanyu66 authored and ti-chi-bot committed Feb 14, 2025
1 parent cc5e4e2 commit a651493
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions br/pkg/lightning/mydump/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,16 @@ func (pr PooledReader) Read(p []byte) (n int, err error) {

// Seek implements io.Seeker
func (pr PooledReader) Seek(offset int64, whence int) (int64, error) {
<<<<<<< HEAD:br/pkg/lightning/mydump/reader.go
w := pr.ioWorkers.Apply()
defer pr.ioWorkers.Recycle(w)
=======
// Seek(0, io.SeekCurrent) is used to get the current offset, which will not cause any Disk I/O.
if pr.ioWorkers != nil && !(offset == 0 && whence == io.SeekCurrent) {
w := pr.ioWorkers.Apply()
defer pr.ioWorkers.Recycle(w)
}
>>>>>>> 0e3efb6ea8b (Lightning: Skip apply ioworkers when seek(0, io.SeekCurrent) (#57454)):pkg/lightning/mydump/reader.go
return pr.reader.Seek(offset, whence)
}

Expand Down

0 comments on commit a651493

Please sign in to comment.