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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions protobuf/v1/nexus.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.

}

// State of the nexus (terminology inspired by ZFS).
Expand Down