-
Notifications
You must be signed in to change notification settings - Fork 301
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
DAOS-10028 control: Move core types into daos package #14174
Conversation
Ticket title is 'Update golang binding for the DAOS API' |
The lib/daos package should be the main repository for types (e.g. PoolInfo) used throughout the codebase. It should be possible to import these types without pulling in extra dependencies (e.g. gRPC, protobufs, etc). Also reverts an inadvertant change to the system database's serialization that resulted in 2.4/2.6 incompatibilities. Features: pool Required-githooks: true Change-Id: I152742e5d10e689da391fc941f7a9d1afa4e3874 Signed-off-by: Michael MacDonald <[email protected]>
f6d9d8d
to
d73d0dd
Compare
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.
ftest LGTM
Test stage Test RPMs on EL 8.6 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14174/2/execution/node/1143/log |
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.
Nothing I'd block on. Nice work!
src/control/lib/daos/pool.go
Outdated
if pss < PoolServiceStateCreating || pss > PoolServiceStateUnknown { | ||
return fmt.Sprintf("Invalid pool service state %d", pss) | ||
} |
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 would probably just call this unknown
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.
Yeah, I thought about that... Was thinking that this would make it a bit more obvious if someone added a new state and forgot to update the stringer, though.
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.
As I was looking at these stringers and marshallers, I realized that we were in an in-between state, where some of the types were backed by the protobuf values, and some were just using native values. I started to go down the road of getting rid of all of the protobuf stuff, with the thought that the lib/daos
package shouldn't depend on the protobufs. I backed away from that position though, because I realized that I was adding maintenance burden to keeping everything in sync.
I still think there's value in revisiting whether or not we should have protobuf dependencies in lib/daos
, but I don't think this PR is the place to do that.
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.
Thanks for taking the time to rework this!
"SvcReps": svcReps, | ||
"Disabled": fmt.Sprintf("%d/%d", pool.TargetsDisabled, pool.TargetsTotal), | ||
"Disabled": fmt.Sprintf("%d/%d", pool.DisabledTargets, pool.TotalTargets), |
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.
why the change from to the other way round? thought we tended to stay with the former?
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.
Had to choose one or the other when doing the merge, and the PoolInfo
names had been around longest.
src/control/lib/daos/pool.go
Outdated
if pss < PoolServiceStateCreating || pss > PoolServiceStateUnknown { | ||
return fmt.Sprintf("Invalid pool service state %d", pss) | ||
} | ||
return [...]string{ |
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.
just out of curiosity, why use an array literal rather than just a slice? is there a performance/storage benefit?
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 backed this out in the latest commit in favor of using the protobuf names as in the other stringer methods. As I indicated in my other comment to Kris, I had initially taken the position that we shouldn't have any protobuf dependencies in the lib/daos
package, but I'm not so sure now. It is certainly less of a maintenance headache to accept the dependency.
src/control/lib/daos/pool.go
Outdated
if !ok { | ||
// Try converting the string to an int32, to handle the | ||
// conversion from protobuf message using convert.Types(). | ||
si, err := strconv.ParseInt(stateStr, 0, 32) |
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.
nice, approve of using this method that we've used elsewhere, handles the multiple cases well
Move PoolQueryTarget and related types into lib/daos. Features: pool Required-githooks: true Change-Id: Ibb90c44d681402b699e023cc78adb4b7f21b0910 Signed-off-by: Michael MacDonald <[email protected]>
Test stage Test RPMs on EL 8.6 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14174/3/execution/node/1152/log |
} | ||
|
||
func (pss PoolServiceState) MarshalJSON() ([]byte, error) { | ||
return []byte(`"` + pss.String() + `"`), nil | ||
} | ||
|
||
func unmarshalStrVal(inStr string, name2Vals map[string]int32, val2Names map[int32]string) (int32, error) { |
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.
Given this is essentially the same approach we are using with NvmeDevState
and LedState
do we want to formalise it somehow with a helper so we can update any improvements to be approach in one place?
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.
Probably not a bad idea to create a helper in the common/proto
package. I'd like to do that as a follow-on, though.
Features: pool Change-Id: Ia619442c1624b10593155291df217d7151ec0fe5
Test stage Test RPMs on EL 8.6 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14174/4/execution/node/1152/log |
Test stage Test RPMs on EL 8.6 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14174/5/execution/node/412/log |
Some responses used "leader", and others used "svc_ldr". As we already have a "svc_reps" precedent, and much of the code was expecting "svc_ldr" from the old control.Pool type, just use that. Features: pool Required-githooks: true Change-Id: Iee8bda89de8be47a0c4884014de352340e5a032f Signed-off-by: Michael MacDonald <[email protected]>
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
Test stage Functional Hardware Medium completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14174/6/execution/node/1406/log |
Change-Id: I457c40d99bea78795dd63cd2ee25b5ea25302d38
Features: pool Required-githooks: true Change-Id: Iba398a2d986e4d6e668a9f6195698e4074eab402 Signed-off-by: Michael MacDonald <[email protected]>
Test stage Functional Hardware Medium Verbs Provider completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14174/7/testReport/ |
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.
It seems we need to update this test as well?
"leader": self.params.get("leader", path="/run/exp_vals/*"), |
And we should probably add a
pool
tag, which would have helped you catch this.These lines:
:avocado: tags=dmg,pool_query,basic,control |
:avocado: tags=dmg,pool_query,basic,control |
:avocado: tags=dmg,pool_query,basic,control |
Bah. Sigh, will do.
I'll add it. |
Required-githooks: true Change-Id: I380e559f6dd6e1ec52e59b141af45af447ddf445
Use svc_ldr instead of leader. Also adds pool tags so that it's included in Features: pool testing. Features: pool Required-githooks: true Change-Id: I66a146f748699e54e61b7f8e5c5e4aa44a2ace55 Signed-off-by: Michael MacDonald <[email protected]>
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.
ftest LGTM
piJSON[0] = ',' | ||
return append(auxJSON[:len(auxJSON)-1], piJSON...), nil |
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'm a little confused. If PoolInfo marshals cleanly, why is it necessary to separate it out and tack it on, rather than including it as part of the aux struct?
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.
It's due to one of the quirks of using embedded types. The MarshalJSON
method on daos.PoolInfo
is promoted, so the logic in PoolQueryResp
's MarshalJSON
is never used.
Test stage Functional Hardware Medium completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14174/15/execution/node/1408/log |
Required-githooks: true Change-Id: Ib692576b6ce1c79c26e3e289fabe5dfb7e32ff21
Features: pool Required-githooks: true Change-Id: Ia552ad8d2c10005ad607c03bd785d5cae4176de2 Signed-off-by: Michael MacDonald <[email protected]>
Test stage Unit Test on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14174/16/testReport/ |
Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14174/16/execution/node/1205/log |
Features: pool Required-githooks: true Change-Id: Ia76cdf30d8e1ad91677e0a00b0128e0e9648e969 Signed-off-by: Michael MacDonald <[email protected]>
Required-githooks: true Change-Id: I1ea908bb41fe71ec082fbf614549e3158db772e4
Test stage Functional Hardware Medium completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14174/17/testReport/ |
Required-githooks: true Change-Id: Icc08b67739586c328d944959991ddb564164a791 Signed-off-by: Michael MacDonald <[email protected]>
Change-Id: Id09db85bfe2f27ac91d2fdfd6f46935dc9011d47
The lib/daos package should be the main repository for types (e.g. PoolInfo) used throughout the codebase. It should be possible to import these types without pulling in extra dependencies (e.g. gRPC, protobufs, etc). Also reverts an inadvertent change to the system database's serialization that resulted in 2.4/2.6 incompatibilities. Required-githooks: true Change-Id: I2e198a57cc5ae7fe76875c59f2f21eda745ce3e7 Signed-off-by: Michael MacDonald <[email protected]>
The lib/daos package should be the main repository for types (e.g. PoolInfo) used throughout the codebase. It should be possible to import these types without pulling in extra dependencies (e.g. gRPC, protobufs, etc). Also reverts an inadvertent change to the system database's serialization that resulted in 2.4/2.6 incompatibilities. Required-githooks: true Change-Id: I2e198a57cc5ae7fe76875c59f2f21eda745ce3e7 Signed-off-by: Michael MacDonald <[email protected]>
…4414) As a convenience, provide a "streamlined" version of the pool query that only performs the minimum amount of work to query the pool's health. Practically speaking, this means that it will query for disabled ranks and omit the space query, which is expensive. Includes the following PR backports: DAOS-9953: Usability improvements to dmg pool list and query. (DAOS-9953: Usability improvements to dmg pool list and query. #12511) DAOS-14243 test: pool/list_verbose.py:test_fields_basic - missing rebuild_state (DAOS-14243 test: pool/list_verbose.py:test_fields_basic - missing rebuild_state #12983) DAOS-10028 control: Move core types into daos package (DAOS-10028 control: Move core types into daos package #14174) Signed-off-by: Michael MacDonald <[email protected]> Co-authored-by: Samir Raval <[email protected]> Co-authored-by: Ding Ho <[email protected]>
The lib/daos package should be the main repository for
types (e.g. PoolInfo) used throughout the codebase. It
should be possible to import these types without pulling
in extra dependencies (e.g. gRPC, protobufs, etc).
Also reverts an inadvertant change to the system
database's serialization that resulted in 2.4/2.6
incompatibilities.
Features: pool
Required-githooks: true
Change-Id: I152742e5d10e689da391fc941f7a9d1afa4e3874
Signed-off-by: Michael MacDonald [email protected]