- Notifications
You must be signed in to change notification settings - Fork6
Closed
Description
Seems that there have been some improvements in the compression algo (we are on v1.0.1). However updating requires changing two things
three references to CompressionLevel need to change
// current versionzw := lz4.NewWriter(w)zw.Header.HighCompression = true// new versionzw := lz4.NewWriter(w)zw.Header.CompressionLevel = CompressionLevel// where CompressionLevel is derived from a global var which may be setvar CompressionLevel int// compression.gofunc init() {viper.BindEnv("LZ4_COMPRESSION_LEVEL")viper.SetDefault("LZ4_COMPRESSION_LEVEL", 40)CompressionLevel = viper.GetInt("LZ4_COMPRESSION_LEVEL")}Also test need to be updated. This alteration will cause writer test to periodically fail with either:
--- FAIL: TestFuzz (0.98s) writer_test.go:270: maxVal 92765; maxBuffer 26264139; seed 1539774761052879507panic: Read 4194304 bytes but expected 26221599 [recovered] panic: Read 4194304 bytes but expected 26221599goroutine 6 [running]:testing.tRunner.func1(0xc0000e8200) /usr/local/go1.11.1.linux-amd64/src/testing/testing.go:792 +0x387panic(0x8760e0, 0xc0000921c0) /usr/local/go1.11.1.linux-amd64/src/runtime/panic.go:513 +0x1b9log.Panicf(0x921509, 0x1d, 0xc00088da28, 0x2, 0x2) /usr/local/go1.11.1.linux-amd64/src/log/log.go:333 +0xdagithub.com/carapace/cellar.loadChunkIntoBuffer(0xc0000a2300, 0x2d, 0xc0009d0080, 0x10, 0x10, 0x1901c1f, 0xc004d04000, 0x1901c1f, 0x1901c1f, 0x0, ...) /home/karel/go/src/github.com/abdullin/cellar/reader.go:283 +0x484github.com/carapace/cellar.(*Reader).Scan(0xc00088def0, 0xc00088de68, 0x0, 0x0) /home/karel/go/src/github.com/abdullin/cellar/reader.go:135 +0x4bagithub.com/carapace/cellar.TestFuzz(0xc0000e8200) /home/karel/go/src/github.com/abdullin/cellar/writer_test.go:311 +0x3e5testing.tRunner(0xc0000e8200, 0x9330a0) /usr/local/go1.11.1.linux-amd64/src/testing/testing.go:827 +0xbfcreated by testing.(*T).Run /usr/local/go1.11.1.linux-amd64/src/testing/testing.go:878 +0x353FAIL github.com/carapace/cellar 1.205sOr
--- FAIL: TestFuzz (0.00s) writer_test.go:270: maxVal 110817; maxBuffer 30725211; seed 1539774415500550257panic: runtime error: index out of range [recovered] panic: runtime error: index out of rangegoroutine 8 [running]:testing.tRunner.func1(0xc0000ce200) /usr/local/go1.11.1.linux-amd64/src/testing/testing.go:792 +0x387panic(0x8a2480, 0xe88f90) /usr/local/go1.11.1.linux-amd64/src/runtime/panic.go:513 +0x1b9github.com/carapace/cellar.TestFuzz(0xc0000ce200) /home/karel/go/src/github.com/abdullin/cellar/writer_test.go:297 +0xb28testing.tRunner(0xc0000ce200, 0x9330a0) /usr/local/go1.11.1.linux-amd64/src/testing/testing.go:827 +0xbfcreated by testing.(*T).Run /usr/local/go1.11.1.linux-amd64/src/testing/testing.go:878 +0x353FAIL github.com/carapace/cellar 0.193sI don't really have enough knowledge of the db to fix the tests/verify if it is compatible withlz4@v2.
Metadata
Metadata
Assignees
Labels
No labels