-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
raft: return non-nil Inflights in raft status #10903
Conversation
Recent refactoring to the String() method of `Progress` hit an NPE because we return nil Inflights as part of the Raft status. Just fix this at the source and properly populate the Raft status instead of teaching String() to ignore nil. A real Progress always has a non-nil Inflights.
This is useful for debug purposes, and more so once we support joint quorums.
Aren't we concerned about allocations on this code path? I think I'd rather make it nil-safe than add another copy if we don't need the data. |
Agreed. I think we should avoid making |
It turns out that there's a good reason. A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I added a commit that splits up |
Now that a Config is also added to the full status, the old name did not convey the intention, which was to get a Status without an associated allocation.
Recent refactoring to the String() method of
Progress
hit an NPEbecause we return nil Inflights as part of the Raft status. Just
fix this at the source and properly populate the Raft status instead
of teaching String() to ignore nil. A real Progress always has a
non-nil Inflights.