Skip to content

Commit

Permalink
transfer page ut matrixorigin#16953
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenbin1002 committed Jul 2, 2024
1 parent f5553d7 commit 801d500
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
5 changes: 3 additions & 2 deletions pkg/vm/engine/tae/db/test/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package test
import (
"bytes"
"context"
"errors"
"fmt"
"github.com/matrixorigin/matrixone/pkg/vm/engine/tae/model"
"math/rand"
Expand Down Expand Up @@ -9136,8 +9137,8 @@ func TestClearPersistTransferTable(t *testing.T) {

page.SetLocation(location)

tae.Runtime.TransferTable.RunTTL()
time.Sleep(2 * time.Second)
tae.Runtime.TransferTable.RunTTL()
_, err = tae.Runtime.TransferTable.Pin(*page.ID())
assert.Equal(t, err, moerr.GetOkExpectedEOB())
assert.True(t, errors.Is(err, moerr.GetOkExpectedEOB()))
}
8 changes: 2 additions & 6 deletions pkg/vm/engine/tae/tables/txnentries/flushTableTail.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,8 @@ func (entry *flushTableTailEntry) addTransferPages() {
}
id := entry.ablksHandles[i].Fingerprint()
entry.pageIds = append(entry.pageIds, id)
if model.RD == nil {
model.SetBlockRead(blockio.NewBlockRead())
}
if model.FS == nil {
model.SetFileService(entry.rt.Fs.Service)
}
model.SetBlockRead(blockio.NewBlockRead())
model.SetFileService(entry.rt.Fs.Service)
page := model.NewTransferHashPage(id, time.Now(), len(m), isTransient)
for srcRow, dst := range m {
blkid := objectio.NewBlockidWithObjectID(entry.createdBlkHandles.GetID(), uint16(dst.BlkIdx))
Expand Down
8 changes: 2 additions & 6 deletions pkg/vm/engine/tae/tables/txnentries/mergeobjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,8 @@ func (entry *mergeObjectsEntry) prepareTransferPage() {
isTransient := !tblEntry.GetLastestSchema().HasPK()
id := obj.AsCommonID()
id.SetBlockOffset(uint16(j))
if model.RD == nil {
model.SetBlockRead(blockio.NewBlockRead())
}
if model.FS == nil {
model.SetFileService(entry.rt.Fs.Service)
}
model.SetBlockRead(blockio.NewBlockRead())
model.SetFileService(entry.rt.Fs.Service)
page := model.NewTransferHashPage(id, time.Now(), len(m), isTransient)
for srcRow, dst := range m {
objID := entry.createdObjs[dst.ObjIdx].ID
Expand Down

0 comments on commit 801d500

Please sign in to comment.