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

Update retention policy before saving database #1564

Merged
merged 3 commits into from
Feb 11, 2015
Merged

Conversation

otoolep
Copy link
Contributor

@otoolep otoolep commented Feb 11, 2015

Without this change, new shard group information is not persisted in the
metastore and only when the next database-save took place would this
update be persisted. If the server shutdown before the update, the new
shard group would be lost.

Without this change, new shard group information is not persisted in the
metastore and only when the next database-save took place would this
update be persisted. If the server shutdown before the update, the new
shard group would be lost.
@otoolep
Copy link
Contributor Author

otoolep commented Feb 11, 2015

@benbjohnson

@otoolep
Copy link
Contributor Author

otoolep commented Feb 11, 2015

Green build.

@otoolep
Copy link
Contributor Author

otoolep commented Feb 11, 2015

I have updated the unit tests so it explicitly tests that shard groups are persisted to disk after a restart. With this change in place, I am now seeing this failure:

--- FAIL: TestServer_CreateShardGroupIfNotExist (1.15s)
panic: open: load: cannot open shard store: id=1, err=timeout [recovered]
        panic: open: load: cannot open shard store: id=1, err=timeout

goroutine 6 [running]:
testing.func·006()
        /home/philip/.gvm/gos/go1.4/src/testing/testing.go:441 +0x181
github.com/influxdb/influxdb_test.(*Server).Restart(0xc208044060)
        /home/philip/Dropbox/repos/influxdb/src/github.com/influxdb/influxdb/server_test.go:1132 +0x23a
github.com/influxdb/influxdb_test.TestServer_CreateShardGroupIfNotExist(0xc208060090)
        /home/philip/Dropbox/repos/influxdb/src/github.com/influxdb/influxdb/server_test.go:875 +0x370
testing.tRunner(0xc208060090, 0xa74470)
        /home/philip/.gvm/gos/go1.4/src/testing/testing.go:447 +0xbf
created by testing.RunTests
        /home/philip/.gvm/gos/go1.4/src/testing/testing.go:555 +0xa8b

goroutine 1 [chan receive]:
testing.RunTests(0x92f3f0, 0xa740e0, 0x30, 0x30, 0xa77c01)
        /home/philip/.gvm/gos/go1.4/src/testing/testing.go:556 +0xad6
testing.(*M).Run(0xc2080462d0, 0xa7f0a0)
        /home/philip/.gvm/gos/go1.4/src/testing/testing.go:485 +0x6c
main.main()
        github.com/influxdb/influxdb/_test/_testmain.go:148 +0x1d5

goroutine 5 [chan receive]:
code.google.com/p/log4go.ConsoleLogWriter.run(0xc20805c060, 0x7f95e0082e98, 0xc208044008)
        /home/philip/Dropbox/repos/influxdb/src/code.google.com/p/log4go/termlog.go:27 +0x7a
created by code.google.com/p/log4go.NewConsoleLogWriter
        /home/philip/Dropbox/repos/influxdb/src/code.google.com/p/log4go/termlog.go:19 +0x6b

goroutine 7 [select]:
github.com/influxdb/influxdb.(*Server).processor(0xc20805e500, 0x7f95e0083310, 0xc208034600, 0xc20805c360)
        /home/philip/Dropbox/repos/influxdb/src/github.com/influxdb/influxdb/server.go:2486 +0x5c8
created by github.com/influxdb/influxdb.(*Server).setClient
        /home/philip/Dropbox/repos/influxdb/src/github.com/influxdb/influxdb/server.go:319 +0x132
exit status 2
FAIL    github.com/influxdb/influxdb    1.158s
~/Dropbox/repos/influxdb/src/github.com/influxdb/influxdb (persist_policies)$ git add -p
diff --git a/server_test.go b/server_test.go
index b947841..5efbd06 100644

so this change may have brought out something else.

@benbjohnson
Copy link
Contributor

The shards aren't being closed in Server.Close(). Fixed: e417852

@otoolep
Copy link
Contributor Author

otoolep commented Feb 11, 2015

Shipt it from @benbjohnson

otoolep added a commit that referenced this pull request Feb 11, 2015
Update retention policy before saving database
@otoolep otoolep merged commit beefdee into master Feb 11, 2015
@otoolep otoolep deleted the persist_policies branch February 11, 2015 05:25
mark-rushakoff pushed a commit that referenced this pull request Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants