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

SHOW DIAGNOSTICS must check if shards are local #2340

Merged
merged 1 commit into from
Apr 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [#2326](https://github.com/influxdb/influxdb/pull/2326): Fix parse error in CREATE CONTINUOUS QUERY
- [#2300](https://github.com/influxdb/influxdb/pull/2300): Refactor integration tests. Properly close Graphite/OpenTSDB listeners.
- [#2338](https://github.com/influxdb/influxdb/pull/2338): Fix panic if tag key isn't double quoted when it should have been
- [#2338](https://github.com/influxdb/influxdb/pull/2338): Fix SHOW DIAGNOSTICS panic if any shard was non-local.

## v0.9.0-rc25 [2015-04-15]

Expand Down
11 changes: 8 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3295,14 +3295,19 @@ func (s *Server) DiagnosticsAsRows() []*influxql.Row {
// Shards
shardsRow := &influxql.Row{Columns: []string{}}
shardsRow.Name = "shards_diag"
shardsRow.Columns = append(shardsRow.Columns, "time", "id", "dataNodes", "index", "path")
shardsRow.Columns = append(shardsRow.Columns, "time", "id", "dataNodes", "index")
shardsRow.Tags = tags
for _, sh := range s.shards {
var nodes []string
for _, n := range sh.DataNodeIDs {
nodes = append(nodes, strconv.FormatUint(n, 10))
shardsRow.Values = append(shardsRow.Values, []interface{}{now, strconv.FormatUint(sh.ID, 10), strings.Join(nodes, ","),
strconv.FormatUint(sh.index, 10), sh.store.Path()})
shardsRow.Values = append(shardsRow.Values, []interface{}{now, strconv.FormatUint(sh.ID, 10),
strings.Join(nodes, ","), strconv.FormatUint(sh.index, 10)})
}
// Shard may not be local to this node.
if sh.store != nil {
shardsRow.Columns = append(shardsRow.Columns, "path")
shardsRow.Values = append(shardsRow.Values, []interface{}{sh.store.Path()})
}
}

Expand Down