WIP - clean up gogo: POC - #21261
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liggitt The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @liggitt. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
Now I'm little scared to ask @liggitt for guidance. Really appreciate the help. |
Codecov Report❌ Patch coverage is Please upload reports for the commit d149059 to get more accurate results. Additional details and impacted files
... and 124 files with indirect coverage changes @@ Coverage Diff @@
## main #21261 +/- ##
===========================================
- Coverage 68.37% 53.50% -14.88%
===========================================
Files 429 429
Lines 35391 35355 -36
===========================================
- Hits 24200 18915 -5285
- Misses 9785 15133 +5348
+ Partials 1406 1307 -99 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
I think the PR clarifies a lot on the work that needs to be done, however it will take some time to fix tests and push it through review. @liggitt do you plan to finish it? I think the etcd community could do the heavy lifting if needed. Let me know if you need help with next steps. |
| type TxnResponseJSON struct { | ||
| Header *pb.ResponseHeader `json:"header,omitempty"` | ||
| Succeeded bool `json:"succeeded"` | ||
| Responses []ResponseOpJSON `json:"responses,omitempty"` | ||
| } | ||
| type ResponseOpJSON struct { | ||
| Response ResponseOpResponseJSON `json:"Response"` | ||
| } | ||
| type ResponseOpResponseJSON struct { | ||
| ResponseRange *pb.RangeResponse `json:"response_range,omitempty"` | ||
| ResponsePut *pb.PutResponse `json:"response_put,omitempty"` | ||
| ResponseDeleteRange *pb.DeleteRangeResponse `json:"response_delete_range,omitempty"` | ||
| ResponseTxn *pb.TxnResponse `json:"response_txn,omitempty"` | ||
| } |
There was a problem hiding this comment.
There was a problem hiding this comment.
The goal was to preserve the current user-visible json output of etcdctl for these types. I'm not 100% sure I accomplished that, or whether users have scripted against etcdctl json output (that seems likely)
There was a problem hiding this comment.
We just need to document the behaviour change for etcdctl
I wasn't sure changing that wire format was acceptable
There was a problem hiding this comment.
The goal was to preserve the current user-visible json output of etcdctl for these types
Yes, I understood that now. But as I mentioned above, the JSON output of TXN response of etcdctl won't be consistent with etcd client SDK anymore. Note that users may use etcd client SDK or etcdctl. I think the former (using sdk) should be more common if they want to programmatically parse the TXN json output.
There was a problem hiding this comment.
It depends on how many users are using etcdctl txn -w json in production.
Personally, I am ok with making this break change :)
There was a problem hiding this comment.
@fuweid yes, using protojson for all messages is a breaking change, we shouldn't do it.
Let's aim to keep etcdctl's fully compatible with etcd v3.6's behaviour.
There was a problem hiding this comment.
Hi @liggitt are you still working on this? I noticed you’ve been pushing commits to keep it up to date. If you’d like to get it ready for review, please let us know. Otherwise, I can split this into smaller changes and send them as a few separate pull requests. (commits are almost ready) Thanks.
There was a problem hiding this comment.
I'm not really working on advancing this, was mostly rebasing to try to play with the github feature around stacked PRs (https://github.github.com/gh-stack/) but it looks like that doesn't support personal-fork / upstream-PR yet (github/gh-stack#18)
Otherwise, I can split this into smaller changes and send them as a few separate pull requests. (commits are almost ready) Thanks.
Go ahead, thanks!
There was a problem hiding this comment.
Thanks! @liggitt :)
ping @serathius @ahrtr We can work (review) on RangeStream first and then I will send the changes after that.
There was a problem hiding this comment.
We can work (review) on RangeStream first and then I will send the changes after that.
Why should we wait if there isn’t a PR ready for review? While RangeStream is important, it’s a relatively simple change. In contrast, gogo/protobuf is more complex and will require significantly more effort.
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
This could be done more gradually, one proto API directory at a time, or one module at a time Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Signed-off-by: Jordan Liggitt <liggitt@google.com>
|
@liggitt: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
closing this since the work got picked up by other maintainers |
xref #14533 (comment)
Parts of this split out and merged as:
Other work: remove gogo use in https://github.com/etcd-io/raft
Remaining commit breakdown:
pre-work internal-only cleanup (can be pulled out to individual PRs to pass CI and merge)
cleanup: use nil-safe getterstest: use protocmp.Transformvet: fix error message constructioninternal: pass messages by pointerpre-work with potential performance implications (needs review for correctness and performance impact, can be pulled out to an individual PR to pass CI and merge)
internal: clone messages instead of shallow copypre-work with user-facing Go API implications (POC-only, there may be better ways to accomplish the same goal for each of these, these need review and agreement; can be pulled out to individual PRs to pass CI and merge)
client: stop wrapping mvccpb.Event typeclient: stop wrapping authpb.UserAddOptions typeclient: stop passing proto by valueclient: fix Cmp proto pass by valueserver: stop passing Snapshot by valueserver: stop passing mvccpb.KeyValue by valueetcdctl: stop passing proto by valuegenerator changes
Switch to standard protoc-gen-goDrop gogo referenceDrop grpc-gateway gogo message v2 hackregenerate / recover:
generate: scripts/genproto.shrecover: Use proto.Marshal/Unmarshal/Size/Clone, proto v2 interfacerecover: shim etcdctl JSON marshaling/unmarshaling of TxnResponse(needs review / agreement, json unmarshal of proto one-of field was a little weird before)generate: scripts/fix/mod-tidy.sh/hold POC only, not merge-ready