Skip to content

Commit

Permalink
Merge pull request #216 from rfyiamcool/fix/update_batch_committed
Browse files Browse the repository at this point in the history
fix: update committed flag after batch commit
  • Loading branch information
roseduan committed Jun 15, 2023
2 parents 67e7a9c + f6cf0be commit 7c5b2b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sync"

"github.com/bwmarrin/snowflake"

"github.com/rosedblabs/wal"
)

Expand Down Expand Up @@ -202,6 +203,7 @@ func (b *Batch) Commit() error {

batchId := b.batchId.Generate()
positions := make(map[string]*wal.ChunkPosition)

// write to wal
for _, record := range b.pendingWrites {
record.BatchId = uint64(batchId)
Expand Down Expand Up @@ -238,5 +240,6 @@ func (b *Batch) Commit() error {
}
}

b.committed = true
return nil
}

0 comments on commit 7c5b2b6

Please sign in to comment.