Skip to content

Commit

Permalink
kv: fix transaction too large error message (#17198)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zejun Li authored May 14, 2020
1 parent bb6ab15 commit eb5927a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kv/memdb_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (m *memDbBuffer) Set(k Key, v []byte) error {

m.sandbox.Put(k, v)
if m.Size() > int(m.bufferSizeLimit) {
return ErrTxnTooLarge.GenWithStackByArgs(m.Size())
return ErrTxnTooLarge.GenWithStackByArgs(atomic.LoadUint64(&TxnTotalSizeLimit))
}
return nil
}
Expand All @@ -108,7 +108,7 @@ func (m *memDbBuffer) Set(k Key, v []byte) error {
func (m *memDbBuffer) Delete(k Key) error {
m.sandbox.Put(k, nil)
if m.Size() > int(m.bufferSizeLimit) {
return ErrTxnTooLarge.GenWithStackByArgs(m.Size())
return ErrTxnTooLarge.GenWithStackByArgs(atomic.LoadUint64(&TxnTotalSizeLimit))
}
return nil
}
Expand Down

0 comments on commit eb5927a

Please sign in to comment.