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

Update grpc to v1.66.0 and switch to CodecV2 #5900

Merged

Conversation

renovate-bot
Copy link
Contributor

@renovate-bot renovate-bot commented Aug 28, 2024

gRPC v1.66.0 introduced CodecV2 that supports buffer pooling. The old V1 codecs no longer work (just the upgrade itself was causing panic, see grpc/grpc-go@cfd14ba#r145974307)

This PR contains the following updates:

  • Upgrade pkg/gogocodec/codec.go to implement CodecV2 API.
  • Translate mem.BufferSlice into []byte as needed (introduces a very small performance hit and increase in allocations)
Package Change Age Adoption Passing Confidence
google.golang.org/grpc v1.65.0 -> v1.66.0 age adoption passing confidence

Performance differences

Before

$ go test -benchmem -run=^$ -bench ^BenchmarkCodec github.com/jaegertracing/jaeger/pkg/gogocodec
goos: darwin
goarch: arm64
pkg: github.com/jaegertracing/jaeger/pkg/gogocodec
cpu: Apple M1 Pro
BenchmarkCodecUnmarshal25Spans-10    	   30015	     39020 ns/op	  108616 B/op	    1082 allocs/op

After

goos: darwin
goarch: arm64
pkg: github.com/jaegertracing/jaeger/pkg/gogocodec
cpu: Apple M1 Pro
BenchmarkCodecUnmarshal25Spans-10    	   29352	     39752 ns/op	  119496 B/op	    1083 allocs/op

Release Notes

grpc/grpc-go (google.golang.org/grpc)

v1.66.0: Release 1.66.0

Compare Source

New Features

Bug Fixes

  • grpc: Clients now return status code INTERNAL instead of UNIMPLEMENTED when the server uses an unsupported compressor. This is consistent with the gRPC compression spec. (#​7461)
  • transport: Fix a bug which could result in writes busy looping when the underlying conn.Write returns errors (#​7394)
  • client: fix race that could lead to orphaned connections and associated resources. (#​7390)
  • xds: use locality from the connected address for load reporting with pick_first (#​7378)
    • without this fix, if a priority contains multiple localities with pick_first, load was reported for the wrong locality
  • client: prevent hanging during ClientConn.Close() when the network is unreachable (#​7540)

Performance Improvements

  • transport: double buffering is avoided when using an http connect proxy and the target server waits for client to send the first message. (#​7424)
  • codec: Implement a new Codec which uses buffer recycling for encoded message (#​7356)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate-bot renovate-bot requested a review from a team as a code owner August 28, 2024 10:46
@forking-renovate forking-renovate bot added the changelog:dependencies Update to dependencies label Aug 28, 2024
@renovate-bot renovate-bot requested a review from jkowall August 28, 2024 10:46
@dosubot dosubot bot added the go label Aug 28, 2024
@yurishkuro yurishkuro changed the title Update module google.golang.org/grpc to v1.66.0 Update grpc to v1.66.0 and switch to CodecV2 Aug 29, 2024
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.81%. Comparing base (d520c41) to head (99fccbe).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5900   +/-   ##
=======================================
  Coverage   96.81%   96.81%           
=======================================
  Files         342      342           
  Lines       16523    16524    +1     
=======================================
+ Hits        15996    15997    +1     
  Misses        340      340           
  Partials      187      187           
Flag Coverage Δ
badger_v1 8.05% <28.57%> (-0.01%) ⬇️
badger_v2 1.82% <100.00%> (+0.01%) ⬆️
cassandra-3.x-v1 16.62% <28.57%> (-0.01%) ⬇️
cassandra-3.x-v2 1.75% <100.00%> (+0.01%) ⬆️
cassandra-4.x-v1 16.62% <28.57%> (-0.01%) ⬇️
cassandra-4.x-v2 1.75% <100.00%> (+0.01%) ⬆️
elasticsearch-6.x-v1 18.79% <28.57%> (-0.01%) ⬇️
elasticsearch-7.x-v1 18.85% <28.57%> (-0.01%) ⬇️
elasticsearch-8.x-v1 19.03% <28.57%> (-0.02%) ⬇️
elasticsearch-8.x-v2 1.82% <100.00%> (+0.01%) ⬆️
grpc_v1 9.48% <100.00%> (-0.01%) ⬇️
grpc_v2 7.16% <100.00%> (+0.01%) ⬆️
kafka-v1 9.74% <28.57%> (-0.01%) ⬇️
kafka-v2 1.82% <100.00%> (+0.01%) ⬆️
memory_v2 1.82% <100.00%> (+0.01%) ⬆️
opensearch-1.x-v1 18.90% <28.57%> (-0.01%) ⬇️
opensearch-2.x-v1 18.90% <28.57%> (+<0.01%) ⬆️
opensearch-2.x-v2 1.82% <100.00%> (+0.02%) ⬆️
unittests 95.29% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro enabled auto-merge (squash) August 29, 2024 06:19
@yurishkuro yurishkuro merged commit c0449f4 into jaegertracing:main Aug 29, 2024
45 checks passed
mahadzaryab1 pushed a commit to mahadzaryab1/jaeger that referenced this pull request Aug 31, 2024
gRPC v1.66.0 introduced CodecV2 that supports buffer pooling. The old V1
codecs no longer work (just the upgrade itself was causing panic, see
grpc/grpc-go@cfd14ba#r145974307)

This PR contains the following updates:

* Upgrade `pkg/gogocodec/codec.go` to implement CodecV2 API.
* Translate `mem.BufferSlice` into `[]byte` as needed (introduces a very
small performance hit and increase in allocations)

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [google.golang.org/grpc](https://togithub.com/grpc/grpc-go) |
`v1.65.0` -> `v1.66.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/google.golang.org%2fgrpc/v1.66.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/google.golang.org%2fgrpc/v1.66.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/google.golang.org%2fgrpc/v1.65.0/v1.66.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/google.golang.org%2fgrpc/v1.65.0/v1.66.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

## Performance differences
Before
```
$ go test -benchmem -run=^$ -bench ^BenchmarkCodec github.com/jaegertracing/jaeger/pkg/gogocodec
goos: darwin
goarch: arm64
pkg: github.com/jaegertracing/jaeger/pkg/gogocodec
cpu: Apple M1 Pro
BenchmarkCodecUnmarshal25Spans-10    	   30015	     39020 ns/op	  108616 B/op	    1082 allocs/op
```
After
```
goos: darwin
goarch: arm64
pkg: github.com/jaegertracing/jaeger/pkg/gogocodec
cpu: Apple M1 Pro
BenchmarkCodecUnmarshal25Spans-10    	   29352	     39752 ns/op	  119496 B/op	    1083 allocs/op
```
---

### Release Notes

<details>
<summary>grpc/grpc-go (google.golang.org/grpc)</summary>

### [`v1.66.0`](https://togithub.com/grpc/grpc-go/releases/tag/v1.66.0):
Release 1.66.0

[Compare
Source](https://togithub.com/grpc/grpc-go/compare/v1.65.0...v1.66.0)

### New Features

- metadata: stabilize `ValueFromIncomingContext`
([#&#8203;7368](https://togithub.com/grpc/grpc-go/issues/7368))
- Special Thanks:
[@&#8203;KarthikReddyPuli](https://togithub.com/KarthikReddyPuli)
- client: stabilize the `WaitForStateChange` and `GetState` methods,
which were previously experimental.
([#&#8203;7425](https://togithub.com/grpc/grpc-go/issues/7425))
- xds: Implement ADS flow control mechanism
([#&#8203;7458](https://togithub.com/grpc/grpc-go/issues/7458))
- See
[https://github.com/grpc/grpc/issues/34099](https://togithub.com/grpc/grpc/issues/34099)
for context.
- balancer/rls: Add metrics for data cache and picker internals
([#&#8203;7484](https://togithub.com/grpc/grpc-go/issues/7484),
[#&#8203;7495](https://togithub.com/grpc/grpc-go/issues/7495))
- xds: LRS load reports now include the `total_issued_requests` field.
([#&#8203;7544](https://togithub.com/grpc/grpc-go/issues/7544))

### Bug Fixes

- grpc: Clients now return status code INTERNAL instead of UNIMPLEMENTED
when the server uses an unsupported compressor. This is consistent with
the [gRPC compression
spec](https://togithub.com/grpc/grpc/blob/master/doc/compression.md#compression-method-asymmetry-between-peers).
([#&#8203;7461](https://togithub.com/grpc/grpc-go/issues/7461))
- Special Thanks:
[@&#8203;Gayathri625](https://togithub.com/Gayathri625)
- transport: Fix a bug which could result in writes busy looping when
the underlying `conn.Write` returns errors
([#&#8203;7394](https://togithub.com/grpc/grpc-go/issues/7394))
    -   Special Thanks: [@&#8203;veshij](https://togithub.com/veshij)
- client: fix race that could lead to orphaned connections and
associated resources.
([#&#8203;7390](https://togithub.com/grpc/grpc-go/issues/7390))
- xds: use locality from the connected address for load reporting with
pick_first
([#&#8203;7378](https://togithub.com/grpc/grpc-go/issues/7378))
- without this fix, if a priority contains multiple localities with
pick_first, load was reported for the wrong locality
- client: prevent hanging during ClientConn.Close() when the network is
unreachable
([#&#8203;7540](https://togithub.com/grpc/grpc-go/issues/7540))

### Performance Improvements

- transport: double buffering is avoided when using an http connect
proxy and the target server waits for client to send the first message.
([#&#8203;7424](https://togithub.com/grpc/grpc-go/issues/7424))
- codec: Implement a new `Codec` which uses buffer recycling for encoded
message ([#&#8203;7356](https://togithub.com/grpc/grpc-go/issues/7356))
- introduce a `mem` package to facilitate buffer reuse
([#&#8203;7432](https://togithub.com/grpc/grpc-go/issues/7432))
- Special Thanks:
[@&#8203;PapaCharlie](https://togithub.com/PapaCharlie)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/jaegertracing/jaeger).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41Ni4wIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiY2hhbmdlbG9nOmRlcGVuZGVuY2llcyJdfQ==-->

---------

Signed-off-by: Mend Renovate <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:dependencies Update to dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants