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

nsqd: "unhealthy mode" when diskqueue writes fail #422

Merged
merged 1 commit into from
Jul 28, 2014

Conversation

mreiferson
Copy link
Member

Hailo reported an issue where nsqd could not write to a failed ephemeral disk on EC2 but the node continued to accept PUB.

In this scenario, nsqd should enter an "unhealthy mode" where PUBs are rejected until the issue can be investigated.

This feedback mechanism to publishers is crucial for them to be able to attempt delivery to another (healthy) node in a cluster or react to this condition in some other way.

Initially, I don't think it's necessary for it to attempt to "heal" itself. I imagine that in most cases you would want to restart the node anyway, which would clear this state.

cc @boyand

@mreiferson
Copy link
Member Author

opening this up for discussion @jehiah, check out the commit

io.WriteString(w, "OK")
if s.context.nsqd.IsHealthy() {
w.Header().Set("Content-Length", "2")
io.WriteString(w, "OK")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think OK and UNHEALTHY don't really make sense here. They are not exactly opposites. How about either HEALTHY and UNHEALTHY or OK and NOK.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to preserve the existing OK response. I'm fine with NOK as an alternate.

@jehiah
Copy link
Member

jehiah commented Jul 28, 2014

LGTM. squash?

jehiah added a commit that referenced this pull request Jul 28, 2014
nsqd: "unhealthy mode" when diskqueue writes fail
@jehiah jehiah merged commit 79d12d4 into nsqio:master Jul 28, 2014
@mreiferson mreiferson deleted the unhealthy_422 branch July 28, 2014 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants