Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenbin1002 committed Sep 13, 2024
1 parent 4ae6fa9 commit dce23d9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
14 changes: 11 additions & 3 deletions pkg/vm/engine/disttae/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func (txn *Transaction) dumpBatchLocked(offset int) error {
}
}

if typ == PersistedDelete && cnt < txn.engine.insertEntryMaxCount {
if typ == DELETE && cnt < txn.engine.insertEntryMaxCount {
return nil
}

Expand Down Expand Up @@ -570,7 +570,7 @@ func (txn *Transaction) dumpBatchLocked(offset int) error {

if dumpAll {
if txn.approximateInMemDeleteCnt >= txn.engine.insertEntryMaxCount {
if err := dump(PersistedDelete); err != nil {
if err := dump(DELETE); err != nil {
return err
}
}
Expand Down Expand Up @@ -647,7 +647,7 @@ func (txn *Transaction) WriteFileLocked(
tnStore DNStore) error {
txn.hasS3Op.Store(true)
newBat := bat
if typ == INSERT || typ == PersistedDelete {
if typ == INSERT || typ == DELETE {
newBat = batch.NewWithSize(len(bat.Vecs))
newBat.SetAttributes([]string{catalog.BlockMeta_MetaLoc, catalog.ObjectMeta_ObjectStats})

Expand Down Expand Up @@ -677,6 +677,14 @@ func (txn *Transaction) WriteFileLocked(
databaseName,
tableName)
}

if typ == INSERT {
typ = PersistedInsert
}
if typ == DELETE {
typ = PersistedDelete
}

txn.readOnly.Store(false)
entry := Entry{
typ: typ,
Expand Down
3 changes: 1 addition & 2 deletions pkg/vm/engine/disttae/txn_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,7 @@ func (tbl *txnTable) EnhanceDelete(bat *batch.Batch, name string) error {
if err != nil {
return err
}

if err := tbl.getTxn().WriteFile(DELETE, tbl.accountId, tbl.db.databaseId, tbl.tableId,
if err := tbl.getTxn().WriteFile(PersistedDelete, tbl.accountId, tbl.db.databaseId, tbl.tableId,
tbl.db.databaseName, tbl.tableName, fileName, copBat, tbl.getTxn().tnStores[0]); err != nil {
return err
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/vm/engine/disttae/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const (
ALTER // alter command for TN. Update batches for mo_tables and mo_columns will fall into the category of INSERT and DELETE.
PersistedInsert
PersistedDelete
PersistedAlter
)

type NoteLevel string
Expand All @@ -84,6 +85,7 @@ var (
ALTER: "alter",
PersistedInsert: "persisted_insert",
PersistedDelete: "persisted_delete",
PersistedAlter: "persisted_alter",
}
)

Expand Down

0 comments on commit dce23d9

Please sign in to comment.