Skip to content

Commit e9264f0

Browse files
authored
use resolved address instead of address in conn/pool (#1874)
1 parent 2cc902e commit e9264f0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Fixed `conn/pool.Get()` behaviour for YDB databases with public IPs. Bug was introduced in v3.116.2
12
* Added helper methods `log.WithFields` and `log.FieldsFromContext` for working with structured logging fields via context.
23
These methods allow adding custom fields to the context, which are later extracted by the logger.
34

internal/conn/pool.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ func (p *Pool) Get(endpoint endpoint.Endpoint) Conn {
4646
has bool
4747
)
4848

49-
cc, has = p.conns.Get(endpoint.Key())
50-
if has && cc.Endpoint().NodeID() == endpoint.NodeID() && cc.Endpoint().OverrideHost() == endpoint.OverrideHost() {
49+
if cc, has = p.conns.Get(endpoint.Key()); has {
5150
return cc
5251
}
5352

internal/endpoint/endpoint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type endpoint struct {
5757

5858
func (e *endpoint) Key() Key {
5959
return Key{
60-
Address: e.address,
60+
Address: e.Address(),
6161
NodeID: e.id,
6262
HostOverride: e.sslNameOverride,
6363
}
@@ -87,7 +87,7 @@ func (e *endpoint) String() string {
8787

8888
return fmt.Sprintf(`{id:%d,address:%q,local:%t,location:%q,loadFactor:%f,lastUpdated:%q}`,
8989
e.id,
90-
e.address,
90+
e.Address(),
9191
e.local,
9292
e.location,
9393
e.loadFactor,

0 commit comments

Comments
 (0)