Skip to content

Migrate to valkey-go#184

Open
majst01 wants to merge 28 commits into
masterfrom
migrate-to-valkey-go
Open

Migrate to valkey-go#184
majst01 wants to merge 28 commits into
masterfrom
migrate-to-valkey-go

Conversation

@majst01
Copy link
Copy Markdown
Contributor

@majst01 majst01 commented Mar 10, 2026

Description

redis-go does not really support timeout for calls, but valkey-go does.

There are some redis related tests, but sadly based on mocks, should be migrated to in-process miniredis to get a better test coverage.

@Gerrit91 Gerrit91 moved this to In Progress in Development Apr 20, 2026
Comment thread cmd/internal/switcher/sonic/db/test/valkey.go Outdated
@iljarotar iljarotar marked this pull request as ready for review May 5, 2026 08:26
@iljarotar iljarotar requested a review from a team as a code owner May 5, 2026 08:26
Comment thread cmd/internal/switcher/sonic/db/db.go Outdated
Comment thread cmd/internal/switcher/sonic/db/db.go Outdated
iljarotar and others added 6 commits May 19, 2026 12:58
Co-authored-by: Sven-Ric <sven.richter@x-cellent.com>
Co-authored-by: Sven-Ric <sven.richter@x-cellent.com>
valkey does not autodect a "/" prefix as a unix socket and expects
"unix://".

Observed Error: unable to create valkey client: dial tcp: address
/var/run/redis/redis.sock: missing port in address"}
Replaced the compat HSET with native one. Original behaviour from
compat.HSet

  func (c *Compat) HSet(ctx context.Context, key string, values ...any)
*IntCmd {
      partial := c.client.B().Hset().Key(key).FieldValue()
      args := argsToSlice(values)
      for i := 0; i < len(args); i += 2 {
          partial = partial.FieldValue(args[i], args[i+1])
      }
      cmd := partial.Build()
      resp := c.client.Do(ctx, cmd)
      return newIntCmd(resp)
  }

Original does not guard against nil val.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants