Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: interface conversion: tsm1.Value is *tsm1.StringValue, not *tsm1.FloatValue #6652

Closed
jwilder opened this issue May 17, 2016 · 5 comments

Comments

@jwilder
Copy link
Contributor

jwilder commented May 17, 2016

This panic can occur during compactions between series with different field types. It was introduced in d99c5e2.

panic: interface conversion: tsm1.Value is *tsm1.StringValue, not *tsm1.FloatValue

goroutine 35 [running]:
panic(0xb68180, 0xc821cd7ec0)
    /usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/influxdb/tsdb/engine/tsm1.encodeFloatBlock(0x0, 0x0, 0x0, 0xc8223d2500, 0x3e8, 0x450, 0x0, 0x0, 0x0, 0x0, ...)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:367 +0x8cd
github.com/influxdata/influxdb/tsdb/engine/tsm1.Values.Encode(0xc8223d2500, 0x3e8, 0x450, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:193 +0x408
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*tsmKeyIterator).chunk(0xc8200e2300, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:974 +0xe3
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*tsmKeyIterator).combine(0xc8200e2300, 0xc82003a300, 0x0, 0x0, 0x0)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:965 +0xd0a
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*tsmKeyIterator).merge(0xc8200e2300)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:845 +0x13f
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*tsmKeyIterator).Next(0xc8200e2300, 0xc800437cff)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:813 +0xbe5
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).write(0xc82019b530, 0xc8206e2100, 0x38, 0x7f2a2fbfe798, 0xc8200e2300, 0x0, 0x0)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:560 +0x53b
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).writeNewFiles(0xc82019b530, 0x20, 0x5, 0x7f2a2fbfe798, 0xc8200e2300, 0x0, 0x0, 0x0, 0x0, 0x0)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:507 +0x3a1
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).compact(0xc82019b530, 0xc82000db00, 0xc8208b41c0, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:473 +0x4fe
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).CompactFull(0xc82019b530, 0xc8208b41c0, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:478 +0x71
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).compactTSMFull.func1(0xc820218e70, 0xc82011fad0, 0x0, 0xc8208b41c0, 0x2, 0x2)
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:754 +0x4c6
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).compactTSMFull
    /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:772 +0x27e
@daviesalex
Copy link
Contributor

This does not appear to occur on jw-compact-fix, latest 0b25541

@jwilder
Copy link
Contributor Author

jwilder commented May 18, 2016

Fixed via #6653

@jsvisa
Copy link

jsvisa commented Nov 9, 2016

@jwilder Hi, seems this panic was not fixed completely, I'm running InfluxDB 1.0.2, the seem issue occured again:

panic: interface conversion: tsm1.Value is *tsm1.FloatValue, not *tsm1.IntegerValue

goroutine 510 [running]:
panic(0xbaefa0, 0xc82a9b2400)
        /usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/influxdb/tsdb/engine/tsm1.encodeIntegerBlock(0x0, 0x0, 0x0, 0xc8393ed200, 0x5, 0x8, 0x0, 0x0, 0x0, 0x0, ...)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:427 +0x72b
github.com/influxdata/influxdb/tsdb/engine/tsm1.Values.Encode(0xc8393ed200, 0x5, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/encoding.go:78 +0x22c
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*cacheKeyIterator).Read(0xc83949c8f0, 0x0, 0x0, 0x14853e7f80939400, 0x14853e9220f2b400, 0x0, 0x0, 0x0, 0x0, 0x0)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:1266 +0x321
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).write(0xc82049a180, 0xc8e44cc870, 0x46, 0x7f709c14b2e0, 0xc83949c8f0, 0x0, 0x0)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:731 +0x4ab
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).writeNewFiles(0xc82049a180, 0x7a, 0x1, 0x7f709c14b2e0, 0xc83949c8f0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:672 +0x3a1
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Compactor).WriteSnapshot(0xc82049a180, 0xc82cb2c700, 0x0, 0x0, 0x0, 0x0, 0x0)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/compact.go:533 +0x174
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).writeSnapshotAndCommit(0xc8204041c0, 0xc8cab8a000, 0xe5, 0x100, 0xc82cb2c700, 0x0, 0x0)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:776 +0xab
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).WriteSnapshot(0xc8204041c0, 0x0, 0x0)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:751 +0x306
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).compactCache(0xc8204041c0)
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:814 +0x25d
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).SetCompactionsEnabled
        /root/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:166 +0x13f

does #7533 can fix it completely?

Before this bug fixed, what should I do to avoid this panic?

@jwilder
Copy link
Contributor Author

jwilder commented Nov 10, 2016

@jsvisa That is a slightly different panic than the one in this issue. The one you posted is fixed in 1.1 via #7498

@jwilder jwilder removed their assignment Nov 10, 2016
@jsvisa
Copy link

jsvisa commented Nov 11, 2016

@jwilder Thanks

@timhallinflux timhallinflux added this to the 1.0.0 milestone Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants