Skip to content

Commit 1f0e2cc

Browse files
committed
Decrease max value size
1 parent daecf26 commit 1f0e2cc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lsmtree.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const (
1616
// MaxValueSize is the maximum allowed value size.
1717
// The size is hard-coded and must not be changed since it has
1818
// impact on the encoding features.
19-
MaxValueSize = math.MaxUint32
19+
MaxValueSize = math.MaxUint16
2020
)
2121

2222
const (

lsmtree_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ func TestPutForErrors(t *testing.T) {
121121
t.Fatalf("expected %v, but got %v", lsmtree.ErrKeyTooLarge, err)
122122
}
123123

124-
// var largeValue [4294967296]byte
125-
// err = tree.Put([]byte("some key"), largeValue[:])
126-
// if !errors.Is(err, lsmtree.ErrValueTooLarge) {
127-
// t.Fatalf("expected %v, but got %v", lsmtree.ErrValueTooLarge, err)
128-
// }
124+
var largeValue [65536]byte
125+
err = tree.Put([]byte("some key"), largeValue[:])
126+
if !errors.Is(err, lsmtree.ErrValueTooLarge) {
127+
t.Fatalf("expected %v, but got %v", lsmtree.ErrValueTooLarge, err)
128+
}
129129
}
130130

131131
func TestPut100(t *testing.T) {

0 commit comments

Comments
 (0)