From eb5927aa0873ac71857196bd23ce343d581a87d3 Mon Sep 17 00:00:00 2001 From: Zejun Li Date: Thu, 14 May 2020 20:27:13 +0800 Subject: [PATCH] kv: fix transaction too large error message (#17198) --- kv/memdb_buffer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kv/memdb_buffer.go b/kv/memdb_buffer.go index 0bb4ad049b459..2d7affcbd4a36 100644 --- a/kv/memdb_buffer.go +++ b/kv/memdb_buffer.go @@ -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 } @@ -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 }