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

chore(nexus_child/fault): add fault timestamp for nexus child #47

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

dsharma-dc
Copy link
Contributor

Adds a timestamp when the child goes to faulted state. If child has never faulted, this will be blank.

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
Copy link
Contributor

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?

Copy link
Contributor Author

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>

Copy link
Contributor Author

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)

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

@Abhinandan-Purkait Abhinandan-Purkait left a comment

Choose a reason for hiding this comment

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

LGTM

@dsharma-dc dsharma-dc merged commit 0e4aba0 into openebs-archive:master Mar 6, 2023
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.

4 participants