-
Notifications
You must be signed in to change notification settings - Fork 15
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
chore(nexus_child/fault): add fault timestamp for nexus child #47
Conversation
Adds a timestamp when the child goes to faulted state. If child has never faulted, this will be blank. Signed-off-by: Diwakar Sharma <[email protected]>
@@ -112,6 +112,7 @@ message Child { | |||
ChildStateReason state_reason = 3; // child state reason | |||
int32 rebuild_progress = 4; // rebuild progress | |||
optional string device_name = 5; // child device name | |||
google.protobuf.Timestamp fault_timestamp = 6; // timestamp(UTC) when child went faulted |
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.
Should it not be optional as we saw in confluence?
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.
Yes, it is an Option in the data-plane code. Here in the API, the autogenerated code corresponding to this is an Option as well. I'm not sure if we need optional
keyword in protobuf file.
pub fault_timestamp: ::core::option::Option<::prost_wkt_types::Timestamp>
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.
I tried putting optional
keyword. Though it compiles, I also stumbled upon this link where proto3 claims to have done away with required
and optional
field support.
protocolbuffers/protobuf#2497 (comment)
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.
Ohh. I see. Thanks for explaining.
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.
Actually that's not true anymore, optional is back with different semantics IIRC related to using the default value of a field when not set.
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
Adds a timestamp when the child goes to faulted state. If child has never faulted, this will be blank.