influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.95k stars 3.56k forks source link

Panic when trying to set retentionPolicy to inf #774

Closed neuroid closed 10 years ago

neuroid commented 10 years ago

Hi,

I get a panic when trying to create a database with the following config:

[
  {
    "database": "test",
    "spaces": [
      {
        "name": "default",
        "retentionPolicy": "inf",
        "shardDuration": "7d",
        "regex": "/.*/",
        "replicationFactor": 1,
        "split": 1
      }
    ]
  }
]

Here's the error:

# influxdb -load-database-config=database_conf.json
Loading config from  database_conf.json
panic: Server returned (400): Rat.Scan: invalid syntax

goroutine 1 [running]:
runtime.panic(0xae4620, 0xc2100367e0)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/runtime/panic.c:266 +0xb6
main.main()
    /home/vagrant/gocodez/src/github.com/influxdb/influxdb/daemon/influxd.go:82 +0x6cf

goroutine 3 [syscall]:
os/signal.loop()
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/os/signal/signal_unix.go:27 +0x31

goroutine 4 [chan receive]:
code.google.com/p/log4go.ConsoleLogWriter.run(0xc21006a000, 0x7fcaa59b8110, 0xc210000008)
    /home/vagrant/gocodez/src/code.google.com/p/log4go/termlog.go:27 +0x60
created by code.google.com/p/log4go.NewConsoleLogWriter
    /home/vagrant/gocodez/src/code.google.com/p/log4go/termlog.go:19 +0x67

goroutine 5 [syscall]:
runtime.goexit()
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/runtime/proc.c:1394

goroutine 7 [IO wait]:
net.runtime_pollWait(0x7fcaa59b9b58, 0x72, 0x0)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(*pollDesc).Wait(0xc21007bc30, 0x72, 0x7fcaa59b7f88, 0xb)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(*pollDesc).WaitRead(0xc21007bc30, 0xb, 0x7fcaa59b7f88)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(*netFD).Read(0xc21007bbd0, 0xc2100a0000, 0x1000, 0x1000, 0x0, ...)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/fd_unix.go:204 +0x2a0
net.(*conn).Read(0xc210000518, 0xc2100a0000, 0x1000, 0x1000, 0x30, ...)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/net.go:122 +0xc5
bufio.(*Reader).fill(0xc21004f540)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/bufio/bufio.go:91 +0x110
bufio.(*Reader).Peek(0xc21004f540, 0x1, 0x0, 0x0, 0x0, ...)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/bufio/bufio.go:119 +0xcb
net/http.(*persistConn).readLoop(0xc210078480)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/http/transport.go:687 +0xb7
created by net/http.(*Transport).dialConn
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/http/transport.go:528 +0x607

goroutine 8 [select]:
net/http.(*persistConn).writeLoop(0xc210078480)
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/http/transport.go:791 +0x271
created by net/http.(*Transport).dialConn
    /home/vagrant/.gvm/gos/go1.2.1/src/pkg/net/http/transport.go:529 +0x61e

According to the docs inf is a valid retentionPolicy value. As a side note, what is the default retentionPolicy when creating a database using the web gui? I was loading historical data points spanning over six months and noticed that shards were being dropped.

I'm running 0.8.0-rc.3.

neuroid commented 10 years ago

769 might explain why the shards are being dropped even though retentionPolicy is set to inf.