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

Fix panic when reporting shard diagnostics #2430

Closed
wants to merge 1 commit into from
Closed

Fix panic when reporting shard diagnostics #2430

wants to merge 1 commit into from

Conversation

marcosnils
Copy link
Contributor

Shard diagnostics wasn't been populated correctly and it made influx panic when reporting shards.
I also changed the TestSingleServerDiags test to reproduce the error
Fixes #2421

panic when reporting shards.
I also changed the TestSingleServerDiags test to reproduce the error
Fixes #2421
@@ -3345,9 +3346,14 @@ func (s *Server) DiagnosticsAsRows() []*influxql.Row {

// Shard may not be local to this node.
if sh.store != nil {
shardsRow.Columns = append(shardsRow.Columns, "path")
shardsRow.Values[0] = append(shardsRow.Values[0], sh.store.Path())
if !hasPath {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary. If a sh.store is non-nil, then it must have a path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@otoolep but you iterate through each shard. The hasPath variable controls if if the path column has been added before or we need to add it as it's the first time it appears. Otherwise the path column get's appended multiple times unnecessarily

@otoolep
Copy link
Contributor

otoolep commented Apr 25, 2015

You can ignore the test failure for now, it's a known issue we need to look into.

@otoolep
Copy link
Contributor

otoolep commented Apr 25, 2015

OK, thanks @marcosnils -- I'll take a closer look at this diff shortly.

otoolep added a commit that referenced this pull request Apr 25, 2015
This code is clearer -- simply append an empty path if the shard is not
local.

Fixes issue #2430
otoolep added a commit that referenced this pull request Apr 25, 2015
This code is clearer -- simply append an empty path if the shard is not
local.

Fixes issue #2430
@otoolep
Copy link
Contributor

otoolep commented Apr 25, 2015

OK, thanks very much @marcosnils -- I see where you are going. In fact this code has caused multiple issues, so I've actually simplified it at #2431.

Your code showed me what was wrong, but I'd like to solve it slightly differently. Please take a look at PR 2431.

@otoolep otoolep closed this Apr 25, 2015
otoolep added a commit that referenced this pull request Apr 26, 2015
This code is clearer -- simply append an empty path if the shard is not
local.

Fixes issue #2430
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.

Self-monitoring panic after inserting data
2 participants