diff --git a/backup_test.go b/backup_test.go index c77cd6d..000ba5a 100644 --- a/backup_test.go +++ b/backup_test.go @@ -27,9 +27,9 @@ func TestBackupEngine(t *testing.T) { // retrieve v1, err := db.Get(ro, givenKey) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() // retrieve bytes _v1, err := db.GetBytes(ro, givenKey) @@ -39,15 +39,15 @@ func TestBackupEngine(t *testing.T) { // update require.Nil(t, db.Put(wo, givenKey, givenVal2)) v2, err := db.Get(ro, givenKey) - defer v2.Free() require.Nil(t, err) require.EqualValues(t, v2.Data(), givenVal2) + v2.Free() // retrieve pinned v3, err := db.GetPinned(ro, givenKey) - defer v3.Destroy() require.Nil(t, err) require.EqualValues(t, v3.Data(), givenVal2) + v3.Destroy() engine, err := CreateBackupEngine(db) require.Nil(t, err) diff --git a/build.sh b/build.sh index 2f8cdfd..35ac226 100755 --- a/build.sh +++ b/build.sh @@ -37,7 +37,7 @@ cd $BUILD_PATH && wget https://github.com/facebook/zstd/archive/v${zstd_version} # Note: if you don't have a good reason, please do not set -DPORTABLE=ON # This one is set here on purpose of compatibility with github action runtime processor -rocksdb_version="9.5.2" +rocksdb_version="9.6.1" cd $BUILD_PATH && wget https://github.com/facebook/rocksdb/archive/v${rocksdb_version}.tar.gz && tar xzf v${rocksdb_version}.tar.gz && cd rocksdb-${rocksdb_version}/ && \ mkdir -p build_place && cd build_place && cmake -DCMAKE_BUILD_TYPE=Release $CMAKE_REQUIRED_PARAMS -DCMAKE_PREFIX_PATH=$INSTALL_PREFIX -DWITH_TESTS=OFF -DWITH_GFLAGS=OFF \ -DWITH_BENCHMARK_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_MD_LIBRARY=OFF -DWITH_RUNTIME_DEBUG=OFF -DROCKSDB_BUILD_SHARED=OFF -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_LIBURING=OFF \ diff --git a/cf_test.go b/cf_test.go index 8b1d84d..4e81b54 100644 --- a/cf_test.go +++ b/cf_test.go @@ -91,18 +91,18 @@ func TestColumnFamilyBatchPutGet(t *testing.T) { b0.PutCF(cfh[0], givenKey0, givenVal0) require.Nil(t, db.Write(wo, b0)) actualVal0, err := db.GetCF(ro, cfh[0], givenKey0) - defer actualVal0.Free() require.Nil(t, err) require.EqualValues(t, actualVal0.Data(), givenVal0) + actualVal0.Free() b1 := NewWriteBatch() defer b1.Destroy() b1.PutCF(cfh[1], givenKey1, givenVal1) require.Nil(t, db.Write(wo, b1)) actualVal1, err := db.GetCF(ro, cfh[1], givenKey1) - defer actualVal1.Free() require.Nil(t, err) require.EqualValues(t, actualVal1.Data(), givenVal1) + actualVal1.Free() actualVal, err := db.GetCF(ro, cfh[0], givenKey1) require.Nil(t, err) @@ -113,8 +113,8 @@ func TestColumnFamilyBatchPutGet(t *testing.T) { { v := db.KeyMayExistsCF(ro, cfh[0], givenKey0, "") - defer v.Free() require.True(t, v.Size() > 0) + v.Free() } // trigger flush @@ -178,15 +178,15 @@ func TestColumnFamilyPutGetDelete(t *testing.T) { { require.Nil(t, db.PutCF(wo, cfh[0], givenKey0, givenVal0)) actualVal0, err := db.GetCF(ro, cfh[0], givenKey0) - defer actualVal0.Free() require.Nil(t, err) require.EqualValues(t, actualVal0.Data(), givenVal0) + actualVal0.Free() require.Nil(t, db.PutCF(wo, cfh[1], givenKey1, givenVal1)) actualVal1, err := db.GetCF(ro, cfh[1], givenKey1) - defer actualVal1.Free() require.Nil(t, err) require.EqualValues(t, actualVal1.Data(), givenVal1) + actualVal1.Free() actualVal, err := db.GetCF(ro, cfh[0], givenKey1) require.Nil(t, err) @@ -202,16 +202,16 @@ func TestColumnFamilyPutGetDelete(t *testing.T) { { v := db.KeyMayExistsCF(ro, cfh[0], givenKey0, "") - defer v.Free() + v.Free() } } { require.Nil(t, db.PutCF(wo, cfh[0], givenKey0, givenVal0)) actualVal0, err := db.GetCF(ro, cfh[0], givenKey0) - defer actualVal0.Free() require.Nil(t, err) require.EqualValues(t, actualVal0.Data(), givenVal0) + actualVal0.Free() require.Nil(t, db.DeleteRangeCF(wo, cfh[0], givenKey0, givenKey1)) actualVal, err := db.GetCF(ro, cfh[0], givenKey0) @@ -219,9 +219,9 @@ func TestColumnFamilyPutGetDelete(t *testing.T) { require.EqualValues(t, actualVal.Size(), 0) actualVal1, err := db.GetCF(ro, cfh[1], givenKey1) - defer actualVal1.Free() require.Nil(t, err) require.EqualValues(t, actualVal1.Data(), givenVal1) + actualVal1.Free() } } diff --git a/cf_ts_test.go b/cf_ts_test.go index 7262371..06334ac 100644 --- a/cf_ts_test.go +++ b/cf_ts_test.go @@ -42,58 +42,58 @@ func TestColumnFamilyPutGetDeleteWithTS(t *testing.T) { require.Nil(t, db.PutCFWithTS(wo, cfh[0], givenKey0, givenTs0, givenVal0)) actualVal0, actualTs0, err := db.GetCFWithTS(ro, cfh[0], givenKey0) - defer actualVal0.Free() - defer actualTs0.Free() require.Nil(t, err) require.EqualValues(t, actualVal0.Data(), givenVal0) require.EqualValues(t, actualTs0.Data(), givenTs0) + actualVal0.Free() + actualTs0.Free() require.Nil(t, db.PutCFWithTS(wo, cfh[1], givenKey1, givenTs1, givenVal1)) actualVal1, actualTs1, err := db.GetCFWithTS(ro, cfh[1], givenKey1) - defer actualVal1.Free() - defer actualTs1.Free() require.Nil(t, err) require.EqualValues(t, actualVal1.Data(), givenVal1) require.EqualValues(t, actualTs1.Data(), givenTs1) + actualVal1.Free() + actualTs1.Free() actualVal, actualTs, err := db.GetCFWithTS(ro, cfh[0], givenKey1) - defer actualVal.Free() - defer actualTs.Free() require.Nil(t, err) require.EqualValues(t, actualVal.Size(), 0) require.EqualValues(t, actualTs.Size(), 0) + actualVal.Free() + actualTs.Free() actualVal, actualTs, err = db.GetCFWithTS(ro, cfh[1], givenKey0) - defer actualVal.Free() - defer actualTs.Free() require.Nil(t, err) require.EqualValues(t, actualVal.Size(), 0) require.EqualValues(t, actualTs.Size(), 0) + actualVal.Free() + actualTs.Free() require.Nil(t, db.DeleteCFWithTS(wo, cfh[0], givenKey0, givenTs2)) actualVal, actualTs, err = db.GetCFWithTS(ro, cfh[0], givenKey0) - defer actualVal.Free() - defer actualTs.Free() require.Nil(t, err) require.EqualValues(t, actualVal.Size(), 0) require.EqualValues(t, actualTs.Size(), 0) + actualVal.Free() + actualTs.Free() } { require.Nil(t, db.PutCFWithTS(wo, cfh[0], givenKey0, givenTs2, givenVal0)) actualVal0, actualTs0, err := db.GetCFWithTS(ro, cfh[0], givenKey0) - defer actualVal0.Free() - defer actualTs0.Free() require.Nil(t, err) require.EqualValues(t, actualVal0.Data(), givenVal0) require.EqualValues(t, actualTs0.Data(), givenTs2) + actualVal0.Free() + actualTs0.Free() actualVal1, actualTs1, err := db.GetCFWithTS(ro, cfh[1], givenKey1) - defer actualVal1.Free() - defer actualTs1.Free() require.Nil(t, err) require.EqualValues(t, actualVal1.Data(), givenVal1) require.EqualValues(t, actualTs1.Data(), givenTs1) + actualVal1.Free() + actualTs1.Free() } } @@ -131,11 +131,8 @@ func TestColumnFamilyMultiGetWithTS(t *testing.T) { // column family 0 only has givenKey1 values, times, err := db.MultiGetCFWithTS(ro, cfh[0], []byte("noexist"), givenKey1, givenKey2, givenKey3) - defer values.Destroy() - defer times.Destroy() require.Nil(t, err) require.EqualValues(t, len(values), 4) - require.EqualValues(t, values[0].Data(), []byte(nil)) require.EqualValues(t, values[1].Data(), givenVal1) require.EqualValues(t, values[2].Data(), []byte(nil)) @@ -145,39 +142,37 @@ func TestColumnFamilyMultiGetWithTS(t *testing.T) { require.EqualValues(t, times[1].Data(), givenTs1) require.EqualValues(t, times[2].Data(), []byte(nil)) require.EqualValues(t, times[3].Data(), []byte(nil)) + values.Destroy() + times.Destroy() // column family 1 only has givenKey2 and givenKey3 values, times, err = db.MultiGetCFWithTS(ro, cfh[1], []byte("noexist"), givenKey1, givenKey2, givenKey3) - defer values.Destroy() - defer times.Destroy() require.Nil(t, err) require.EqualValues(t, len(values), 4) - require.EqualValues(t, values[0].Data(), []byte(nil)) require.EqualValues(t, values[1].Data(), []byte(nil)) require.EqualValues(t, values[2].Data(), givenVal2) require.EqualValues(t, values[3].Data(), givenVal3) - require.EqualValues(t, times[0].Data(), []byte(nil)) require.EqualValues(t, times[1].Data(), []byte(nil)) require.EqualValues(t, times[2].Data(), givenTs2) require.EqualValues(t, times[3].Data(), givenTs3) + values.Destroy() + times.Destroy() - // getting them all from the right CF should return them all + // getting them all from the right CF values, times, err = db.MultiGetMultiCFWithTS(ro, ColumnFamilyHandles{cfh[0], cfh[1], cfh[1]}, [][]byte{givenKey1, givenKey2, givenKey3}, ) - defer values.Destroy() - defer times.Destroy() require.Nil(t, err) require.EqualValues(t, len(values), 3) - require.EqualValues(t, values[0].Data(), givenVal1) require.EqualValues(t, values[1].Data(), givenVal2) require.EqualValues(t, values[2].Data(), givenVal3) - - require.EqualValues(t, times[0].Data(), []byte{}) + require.EqualValues(t, times[0].Data(), []byte{0, 0, 0, 0, 0, 0, 0, 0}) require.EqualValues(t, times[1].Data(), givenTs2) require.EqualValues(t, times[2].Data(), givenTs3) + values.Destroy() + times.Destroy() } diff --git a/db_test.go b/db_test.go index 16edd1d..ef97196 100644 --- a/db_test.go +++ b/db_test.go @@ -67,15 +67,15 @@ func TestDBCRUD(t *testing.T) { // retrieve v1, err := db.Get(ro, givenKey) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() { _v1, err := db.GetCF(ro, df, givenKey) - defer _v1.Free() require.Nil(t, err) require.EqualValues(t, _v1.Data(), givenVal1) + _v1.Free() } // retrieve bytes @@ -86,9 +86,9 @@ func TestDBCRUD(t *testing.T) { // update require.Nil(t, db.Put(wo, givenKey, givenVal2)) v2, err := db.Get(ro, givenKey) - defer v2.Free() require.Nil(t, err) require.EqualValues(t, v2.Data(), givenVal2) + v2.Free() // retrieve pinned for i := 0; i < 1000; i++ { @@ -153,40 +153,40 @@ func TestDBCRUDDBPaths(t *testing.T) { // retrieve v1, err := db.Get(ro, givenKey) - defer v1.Free() require.Nil(t, err) require.True(t, v1.Exists()) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() // update require.Nil(t, db.Put(wo, givenKey, givenVal2)) v2, err := db.Get(ro, givenKey) - defer v2.Free() require.Nil(t, err) require.True(t, v2.Exists()) require.EqualValues(t, v2.Data(), givenVal2) + v2.Free() // update require.Nil(t, db.Put(wo, givenKey, givenVal3)) v3, err := db.Get(ro, givenKey) - defer v3.Free() require.Nil(t, err) require.True(t, v3.Exists()) require.EqualValues(t, v3.Data(), givenVal3) + v3.Free() { v4 := db.KeyMayExists(ro, givenKey, "") - defer v4.Free() require.True(t, v4.Size() > 0) + v4.Free() } // delete require.Nil(t, db.SingleDelete(wo, givenKey)) v4, err := db.Get(ro, givenKey) - defer v4.Free() require.Nil(t, err) require.False(t, v4.Exists()) require.EqualValues(t, v4.Data(), []byte(nil)) + v4.Free() } func newTestDB(t *testing.T, applyOpts func(opts *Options)) *DB { diff --git a/db_ts_test.go b/db_ts_test.go index fc36626..4ba4449 100644 --- a/db_ts_test.go +++ b/db_ts_test.go @@ -35,11 +35,11 @@ func TestDBCRUDWithTS(t *testing.T) { // retrieve v1, t1, err := db.GetWithTS(ro, givenKey) - defer v1.Free() - defer t1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) require.EqualValues(t, t1.Data(), givenTs1) + v1.Free() + t1.Free() // retrieve bytes _v1, _ts1, err := db.GetBytesWithTS(ro, givenKey) @@ -51,39 +51,39 @@ func TestDBCRUDWithTS(t *testing.T) { require.Nil(t, db.PutWithTS(wo, givenKey, givenTs2, givenVal2)) ro.SetTimestamp(givenTs2) v2, t2, err := db.GetWithTS(ro, givenKey) - defer v2.Free() - defer t2.Free() require.Nil(t, err) require.EqualValues(t, v2.Data(), givenVal2) require.EqualValues(t, t2.Data(), givenTs2) + v2.Free() + t2.Free() // delete require.Nil(t, db.DeleteWithTS(wo, givenKey, givenTs3)) ro.SetTimestamp(givenTs3) v3, t3, err := db.GetWithTS(ro, givenKey) - defer v3.Free() - defer t3.Free() require.Nil(t, err) require.True(t, v3.Data() == nil) require.True(t, t3.Data() == nil) + v3.Free() + t3.Free() // ts2 should read deleted data ro.SetTimestamp(givenTs2) v2, t2, err = db.GetWithTS(ro, givenKey) - defer v2.Free() - defer t2.Free() require.Nil(t, err) require.EqualValues(t, v2.Data(), givenVal2) require.EqualValues(t, t2.Data(), givenTs2) + v2.Free() + t2.Free() // ts1 should read old data ro.SetTimestamp(givenTs1) v1, t1, err = db.GetWithTS(ro, givenKey) - defer v1.Free() - defer t1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) require.EqualValues(t, t1.Data(), givenTs1) + v1.Free() + t1.Free() } func TestDBMultiGetWithTS(t *testing.T) { diff --git a/merge_operator_test.go b/merge_operator_test.go index c7cc989..7a4f7b5 100644 --- a/merge_operator_test.go +++ b/merge_operator_test.go @@ -92,9 +92,9 @@ func TestPartialMergeOperator(t *testing.T) { ro := NewDefaultReadOptions() v1, err := db.Get(ro, givenKey) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), fMergeResult) + v1.Free() } func TestMergeMultiOperator(t *testing.T) { @@ -147,9 +147,9 @@ func TestMergeMultiOperator(t *testing.T) { ro := NewDefaultReadOptions() v1, err := db.Get(ro, givenKey) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), fMergeResult) + v1.Free() } // Mock Objects diff --git a/transactiondb_test.go b/transactiondb_test.go index f09913a..3a275b3 100644 --- a/transactiondb_test.go +++ b/transactiondb_test.go @@ -36,23 +36,23 @@ func TestTransactionDBCRUD(t *testing.T) { // retrieve v1, err := db.Get(ro, givenKey) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() // update require.Nil(t, db.Put(wo, givenKey, givenVal2)) v2, err := db.Get(ro, givenKey) - defer v2.Free() require.Nil(t, err) require.EqualValues(t, v2.Data(), givenVal2) + v2.Free() // delete require.Nil(t, db.Delete(wo, givenKey)) v3, err := db.Get(ro, givenKey) - defer v3.Free() require.Nil(t, err) require.True(t, v3.Data() == nil) + v3.Free() // transaction txn := db.TransactionBegin(wo, to, nil) @@ -60,15 +60,15 @@ func TestTransactionDBCRUD(t *testing.T) { // create require.Nil(t, txn.Put(givenTxnKey, givenTxnVal1)) v4, err := txn.Get(ro, givenTxnKey) - defer v4.Free() require.Nil(t, err) require.EqualValues(t, v4.Data(), givenTxnVal1) + v4.Free() require.Nil(t, txn.Commit()) v5, err := db.Get(ro, givenTxnKey) - defer v5.Free() require.Nil(t, err) require.EqualValues(t, v5.Data(), givenTxnVal1) + v5.Free() // transaction txn2 := db.TransactionBegin(wo, to, nil) @@ -78,9 +78,9 @@ func TestTransactionDBCRUD(t *testing.T) { // rollback require.Nil(t, txn2.Rollback()) v6, err := txn2.Get(ro, givenTxnKey2) - defer v6.Free() require.Nil(t, err) require.True(t, v6.Data() == nil) + v6.Free() // transaction txn3 := db.TransactionBegin(wo, to, nil) @@ -97,9 +97,9 @@ func TestTransactionDBCRUD(t *testing.T) { require.Nil(t, txn3.Commit()) v7, err := db.Get(ro, givenTxnKey) - defer v7.Free() require.Nil(t, err) require.True(t, v7.Data() == nil) + v7.Free() // transaction txn4 := db.TransactionBegin(wo, to, nil) @@ -115,9 +115,9 @@ func TestTransactionDBCRUD(t *testing.T) { require.Nil(t, txn4.Commit()) v8, err := db.Get(ro, givenTxnKey) - defer v8.Free() require.Nil(t, err) require.True(t, v8.Data() != nil) // due to rebuild -> put -> key exists + v8.Free() // transaction txn5 := db.TransactionBegin(wo, to, nil) @@ -139,9 +139,9 @@ func TestTransactionDBCRUD(t *testing.T) { require.Nil(t, txn5.Commit()) v9, err := db.Get(ro, givenTxnKey2) - defer v9.Free() require.Nil(t, err) - require.True(t, v8.Data() != nil) // due to rebuild -> put -> key exists + require.True(t, v9.Data() != nil) // due to rebuild -> put -> key exists + v9.Free() } func TestTransactionDBGetForUpdate(t *testing.T) { @@ -166,8 +166,8 @@ func TestTransactionDBGetForUpdate(t *testing.T) { defer txn.Destroy() v, err := txn.GetForUpdate(ro, givenKey) - defer v.Free() require.Nil(t, err) + v.Free() // expect lock timeout error to be thrown if err := db.Put(wo, givenKey, givenVal); err == nil { @@ -224,7 +224,7 @@ func TestTransactionDBColumnFamilyBatchPutGet(t *testing.T) { givenKey2 := []byte("hello2") givenVal2 := []byte("world2") - writeReadBatch := func(cf *ColumnFamilyHandle, keys [][]byte, values [][]byte) { + writeReadBatch := func(cf *ColumnFamilyHandle, keys, values [][]byte) { b := NewWriteBatch() defer b.Destroy() for i := range keys { diff --git a/write_batch_test.go b/write_batch_test.go index d1479f7..ded97c5 100644 --- a/write_batch_test.go +++ b/write_batch_test.go @@ -34,14 +34,14 @@ func TestWriteBatch(t *testing.T) { // check changes ro := NewDefaultReadOptions() v1, err := db.Get(ro, givenKey1) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() v2, err := db.Get(ro, givenKey2) - defer v2.Free() require.Nil(t, err) require.True(t, v2.Data() == nil) + v2.Free() // DeleteRange test wb.Clear() @@ -51,9 +51,9 @@ func TestWriteBatch(t *testing.T) { require.Nil(t, db.Write(wo, wb)) v1, err = db.Get(ro, givenKey1) - defer v1.Free() require.Nil(t, err) require.True(t, v1.Data() == nil) + v1.Free() } func TestWriteBatchWithParams(t *testing.T) { @@ -83,14 +83,14 @@ func TestWriteBatchWithParams(t *testing.T) { // check changes ro := NewDefaultReadOptions() v1, err := db.Get(ro, givenKey1) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() v2, err := db.Get(ro, givenKey2) - defer v2.Free() require.Nil(t, err) require.True(t, v2.Data() == nil) + v2.Free() // DeleteRange test wb.Clear() @@ -100,9 +100,9 @@ func TestWriteBatchWithParams(t *testing.T) { require.Nil(t, db.Write(wo, wb)) v1, err = db.Get(ro, givenKey1) - defer v1.Free() require.Nil(t, err) require.True(t, v1.Data() == nil) + v1.Free() } func TestWriteBatchIterator(t *testing.T) { diff --git a/write_batch_ts_test.go b/write_batch_ts_test.go index c236691..d2950e9 100644 --- a/write_batch_ts_test.go +++ b/write_batch_ts_test.go @@ -41,16 +41,16 @@ func TestWriteBatchWithTS(t *testing.T) { ro := NewDefaultReadOptions() ro.SetTimestamp(givenTs2) v1, t1, err := db.GetWithTS(ro, givenKey1) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) require.EqualValues(t, t1.Data(), givenTs2) + v1.Free() v2, t2, err := db.GetWithTS(ro, givenKey2) - defer v2.Free() require.Nil(t, err) require.True(t, v2.Data() == nil) require.True(t, t2.Data() == nil) + v2.Free() wb.Clear() // DeleteRange not supported for timestamp diff --git a/write_batch_wi_test.go b/write_batch_wi_test.go index abe6ec5..7aefce2 100644 --- a/write_batch_wi_test.go +++ b/write_batch_wi_test.go @@ -40,48 +40,48 @@ func TestWriteBatchWI(t *testing.T) { // check before writing to db ro := NewDefaultReadOptions() v1, err := wb.GetFromDB(db, ro, givenKey1) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() v2, err := wb.GetFromDB(db, ro, givenKey2) - defer v2.Free() require.Nil(t, err) require.EqualValues(t, v2.Data(), givenVal2Updated) + v2.Free() v3, err := wb.GetFromDB(db, ro, givenKey3) - defer v3.Free() require.Nil(t, err) require.True(t, v3.Data() == nil) + v3.Free() v4, err := wb.GetFromDB(db, ro, givenKey4) - defer v4.Free() require.Nil(t, err) require.EqualValues(t, v4.Data(), givenVal4) + v4.Free() // perform the batch require.Nil(t, db.WriteWI(wo, wb)) // check changes v1, err = db.Get(ro, givenKey1) - defer v1.Free() require.Nil(t, err) require.EqualValues(t, v1.Data(), givenVal1) + v1.Free() v2, err = db.Get(ro, givenKey2) - defer v2.Free() require.Nil(t, err) require.EqualValues(t, v2.Data(), givenVal2Updated) + v2.Free() v3, err = db.Get(ro, givenKey3) - defer v3.Free() require.Nil(t, err) require.True(t, v3.Data() == nil) + v3.Free() v4, err = db.Get(ro, givenKey4) - defer v4.Free() require.Nil(t, err) require.EqualValues(t, v4.Data(), givenVal4) + v4.Free() wb.Clear() // DeleteRange not supported