Skip to content

Commit

Permalink
Load shards on restart
Browse files Browse the repository at this point in the history
Fix for #2012
  • Loading branch information
otoolep committed Mar 24, 2015
1 parent 0a76c2b commit a8f0dbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [#2034](https://github.com/influxdb/influxdb/pull/2034): Group by should require an aggregate.
- [#2040](https://github.com/influxdb/influxdb/pull/2040): Add missing top-level help for config command
- [#2057](https://github.com/influxdb/influxdb/pull/2057): Move racy "in order" test to integration test suite.
- [#2060](https://github.com/influxdb/influxdb/pull/2060): Reload server shard map on restart.

## v0.9.0-rc15 [2015-03-19]

Expand Down
7 changes: 6 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,16 @@ func (s *Server) load() error {
}
}

// Open all shards owned by server.
// Load shards.
s.shards = make(map[uint64]*Shard)
for _, db := range s.databases {
for _, rp := range db.policies {
for _, g := range rp.shardGroups {
for _, sh := range g.Shards {
// Add to lookups.
s.shards[sh.ID] = sh

// Only open shards owned by the server.
if !sh.HasDataNodeID(s.id) {
continue
}
Expand Down

0 comments on commit a8f0dbc

Please sign in to comment.