Skip to content

Commit 30e5c82

Browse files
committed
wip review
1 parent 02c2447 commit 30e5c82

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

internal/pool/pool.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,6 @@ func (p *ConnPool) popIdle() (*Conn, error) {
509509
p.idleConns = append(p.idleConns, cn)
510510
} else {
511511
// LIFO: put at beginning (will be picked up last since we pop from end)
512-
// currently isUsable is only set for hitless upgrades, so this is a no-op
513-
// but we may need it in the future, so leaving it here for now.
514512
p.idleConns = append([]*Conn{cn}, p.idleConns...)
515513
}
516514
}

options.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ type Options struct {
152152
// - true for FIFO pool
153153
// - false for LIFO pool.
154154
//
155-
// NOTE: If you are using HitlessUpgrades, this will be ignored and pool will always be FIFO.
156-
//
157155
// Note that FIFO has slightly higher overhead compared to LIFO,
158156
// but it helps closing idle connections faster reducing the pool size.
159157
// default: false
@@ -648,7 +646,7 @@ func newConnPool(
648646
Dialer: func(ctx context.Context) (net.Conn, error) {
649647
return dialer(ctx, opt.Network, opt.Addr)
650648
},
651-
PoolFIFO: opt.PoolFIFO || opt.HitlessUpgradeConfig.IsEnabled(), // Always FIFO with hitless upgrades
649+
PoolFIFO: opt.PoolFIFO,
652650
PoolSize: int32(opt.PoolSize),
653651
PoolTimeout: opt.PoolTimeout,
654652
DialTimeout: opt.DialTimeout,

redis.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,20 +448,15 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
448448
c.optLock.RLock()
449449
hitlessEnabled := c.opt.HitlessUpgradeConfig.IsEnabled()
450450
protocol := c.opt.Protocol
451-
//endpointType := c.opt.HitlessUpgradeConfig.EndpointType
451+
endpointType := c.opt.HitlessUpgradeConfig.EndpointType
452452
c.optLock.RUnlock()
453453
var hitlessHandshakeErr error
454454
if hitlessEnabled && protocol == 3 {
455-
/*
456-
pipe := conn.Pipeline()
457-
hitlessHandshakeErr = pipe.ClientMaintNotifications(
458-
ctx,
459-
true,
460-
endpointType.String(),
461-
).Err()
462-
pipe.Exec(ctx)
463-
464-
*/
455+
hitlessHandshakeErr = conn.ClientMaintNotifications(
456+
ctx,
457+
true,
458+
endpointType.String(),
459+
).Err()
465460
if hitlessHandshakeErr != nil {
466461
if !isRedisError(hitlessHandshakeErr) {
467462
// if not redis error, fail the connection

redis_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
. "github.com/bsm/gomega"
1515
"github.com/redis/go-redis/v9"
1616
"github.com/redis/go-redis/v9/auth"
17-
"github.com/redis/go-redis/v9/hitless"
1817
)
1918

2019
type redisHookError struct{}
@@ -627,10 +626,6 @@ var _ = Describe("Hook with MinIdleConns", func() {
627626
BeforeEach(func() {
628627
options := redisOptions()
629628
options.MinIdleConns = 1
630-
options.HitlessUpgradeConfig = &redis.HitlessUpgradeConfig{
631-
Enabled: hitless.MaintNotificationsDisabled,
632-
}
633-
options.HitlessUpgradeConfig = nil
634629
client = redis.NewClient(options)
635630
Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred())
636631
})
@@ -656,7 +651,6 @@ var _ = Describe("Hook with MinIdleConns", func() {
656651
processHook: func(hook redis.ProcessHook) redis.ProcessHook {
657652
return func(ctx context.Context, cmd redis.Cmder) error {
658653
res = append(res, "hook-2-process-start")
659-
res = append(res, cmd.String())
660654
err := hook(ctx, cmd)
661655
res = append(res, "hook-2-process-end")
662656
return err

0 commit comments

Comments
 (0)