1
0
mirror of https://github.com/redis/go-redis.git synced 2025-09-07 07:47:24 +03:00
Commit Graph

2585 Commits

Author SHA1 Message Date
fengyun.rui
4f9550fd99 fix: race slice for list function of ring client (#2931)
* fix: race slice for list of ring client

Signed-off-by: rfyiamcool <rfyiamcool@163.com>

* fix: copy wrong list

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>

---------

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Ali Error
26e2430865 fix: nil pointer dereferencing in writeArg (#3271)
* fixed bug with nil dereferencing in writeArg, added hset struct example, added tests

* removed password from example

* added omitempty

* reverted xxhash versioning

* reverted xxhash versioning

* removed password

* removed password

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
e010f2e2ff DOC-4329 added range query examples (#3252)
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
alingse
926d6f1677 move regexp.MustCompile close to call (#3280)
* move regexp.MustCompile out of func

* move moduleRe close to call

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
herodot
1814bae1fd fix(search&aggregate):fix error overwrite and typo #3220 (#3224)
* fix (#3220)

* LOAD has NO AS param(https://redis.io/docs/latest/commands/ft.aggregate/)

* fix typo: WITHCOUT -> WITHCOUNT

* fix (#3220):

    * Compatible with known RediSearch issue in test

* fix (#3220)

    * fixed the calculation bug of the count of load params

* test should not include special condition

* return errors when they occur

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2025-08-11 01:42:45 +03:00
dependabot[bot]
82be3f4cbe chore(deps): bump rojopolis/spellcheck-github-actions (#3276)
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.46.0 to 0.47.0.
- [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases)
- [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.46.0...0.47.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
61391aac2d fix: linter configuration (#3279) 2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
7b400169e3 use limit when limitoffset is zero (#3275) 2025-08-11 01:42:45 +03:00
LINKIWI
18bc8edbcf Reinstate read-only lock on hooks access in dialHook (#3225) 2025-08-11 01:42:45 +03:00
Flc゛
f83f92242b chore(deps): update github.com/cespare/xxhash/v2 to v2.3.0 (#3265)
* chore(deps): update github.com/cespare/xxhash/v2 to v2.3.0

* chore(deps): update github.com/cespare/xxhash/v2 to v2.3.0
2025-08-11 01:42:45 +03:00
Flc゛
9a37279edf test(redisotel): rename redisotel_test.go to tracing_test.go and add tracing hook tests (#3270)
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
e59b1856eb test: add test for info in RCE 8 (#3269) 2025-08-11 01:42:45 +03:00
andy-stark-redis
5fdab23102 DOC-4335 added aggregate query examples (#3259)
* DOC-4335 added aggregate query examples (demonstrating errors)

* DOC-4335 remove incomplete examples

* DOC-4335 added missing examples using latest client updates

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
01fd453dd0 fix: flaky ClientKillByFilter test (#3268) 2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
162b52675a fix: add unstableresp3 to cluster client (#3266)
* fix: add unstableresp3 to cluster client

* propagate unstableresp3

* proper test that will ignore error, but fail if client panics

* add separate test for clusterclient constructor
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
7816fdda4b fix(aggregate, search): ft.aggregate bugfixes (#3263)
* fix: rearange args for ft.aggregate

apply should be before any groupby or sortby

* improve test

* wip: add scorer and addscores

* enable all tests

* fix ftsearch with count test

* make linter happy

* Addscores is available in later redisearch releases.

For safety state it is available in redis ce 8

* load an apply seem to break scorer and addscores
2025-08-11 01:42:45 +03:00
dependabot[bot]
e4173a4783 chore(deps): bump rojopolis/spellcheck-github-actions (#3227)
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.45.0 to 0.46.0.
- [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases)
- [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.45.0...0.46.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
c42db42f15 DOC-4300 added exact match examples (#3251)
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
3c78310e83 DOC-4332 added geo query examples (#3257)
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
85bccdcf25 DOC-4331 added full text query examples (#3256)
* DOC-4331 added full text query examples

* DOC-4331 made tests deterministic with sort

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
52672e50af DOC-4799 fixed capped list example (#3260)
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
ed8b629586 DOC-4734 added geo indexing examples (#3240)
* DOC-4734 added geo indexing examples

* DOC-4734 delete keys before starting tests

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
d4ddfe9c89 feat(command): add ACL commands, validate module categories exist (#3262)
* add ACL{SetUser,DelUser,List} commands

* test presence of categories in acl cat

* code cleanup

* add basic acl tests

* add acl modules tests

* reset acl log before test

* refactor acl tests

* fix clientkillbyage test
2025-08-11 01:42:45 +03:00
Julien Riou
40ed9dc54f feat(options): add skip_verify param (#3216)
* feat(options): Add skip_verify param

When parsing a URL, add a "skip_verify" query param to disable TLS certificate
verification.

Inspired by various Go drivers:

* ClickHouse: https://github.com/ClickHouse/clickhouse-go/blob/v2.30.0/clickhouse_options.go#L259
* MongoDB: https://github.com/mongodb/mongo-go-driver/blob/v2.0.0/x/mongo/driver/connstring/connstring.go#L609
* MySQL: https://github.com/go-sql-driver/mysql/blob/v1.8.1/dsn.go#L175

Signed-off-by: Julien Riou <julien@riou.xyz>

* docs(options): Add skip_verify to ParseURL

Signed-off-by: Julien Riou <julien@riou.xyz>

---------

Signed-off-by: Julien Riou <julien@riou.xyz>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
dependabot[bot]
07548a6d51 chore(deps): bump github.com/cespare/xxhash/v2 from 2.2.0 to 2.3.0 (#2964)
Bumps [github.com/cespare/xxhash/v2](https://github.com/cespare/xxhash) from 2.2.0 to 2.3.0.
- [Commits](https://github.com/cespare/xxhash/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/cespare/xxhash/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
ZhuHaiCheng
b83216f26a chore: fix some comments (#3226)
Signed-off-by: zhuhaicity <zhuhai@52it.net>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
c0235ccb9d feat(tests): validate that ConfigSet and ConfigGet work with Modules (#3258)
* Add tests for unified config in Redis 8

* WIP: fix reading FT.CONFIG with RESP3

* add more tests

* use search-timeout

* move deprecated warnings on the bottom
2025-08-11 01:42:45 +03:00
Shawn Wang
12b012255e Fix race condition in clusterNodes.Addrs() (#3219)
Resolve a race condition in the clusterNodes.Addrs() method.
Previously, the method returned a reference to a string slice, creating
the potential for concurrent reads by the caller while the slice was
being modified by the garbage collection process.

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
cab668d936 fix(tests): enable testing with Redis CE 8.0-M4 in CI (#3247)
* introduce github workflow for ci similar to the one in redis-py

use prerelease for 8.0-M4

* Enable osscluster tests in CI

* Add redis major version env

Enable filtering test per redis major version
Fix test for FT.SEARCH WITHSCORE, the default scorer
has changed.

fix Makefile syntax

remove filter from github action

fix makefile

use the container name in Makefile

* remove 1.20 from doctests

* self review, cleanup, add comments

* add comments, reorder prints, add default value for REDIS_MAJOR_VERSION
2025-08-11 01:42:45 +03:00
andy-stark-redis
e45406f07e DOC-4444 server management command examples (#3235) 2025-08-11 01:42:45 +03:00
dependabot[bot]
7fd6c5be59 chore(deps): bump golang.org/x/net in /example/otel (#3243)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.33.0.
- [Commits](https://github.com/golang/net/compare/v0.23.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
7f5c356371 fix(command): add missing io-thread key in client info (#3244)
* Add 8.0m3 image in docker compose

* Add new key `io-thread` in client info

Redis 8.0 introduces new key `io-thread` in the response
for client info. The key needs to be parsed. If an unknown key
is observed, the client will return an error.

* improve readibility

* Revert "Add 8.0m3 image in docker compose"

This reverts commit 787c41f429.

* add dockers directory to gitignore
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
8863e40aea Order slices of strings to be sure what the output of Println in doctests will be. (#3241)
* Sort the slices of strings in doctest to make the output deterministic

* fix wording
2025-08-11 01:42:45 +03:00
andy-stark-redis
e6e323fe1a DOC-4449 hash command examples (#3229)
* DOC-4450 added hgetall and hvals doc examples

* DOC-4449 added hgetall and hvals doc examples

* DOC-4449 rewrote to avoid Collect and Keys functions (not available in test version of Go)

* DOC-4449 replaced slices.Sort function with older alternative

* DOC-4449 removed another instance of slices.Sort

* DOC-4449 fixed bugs in tests

* DOC-4449 try sort.Strings() for sorting key lists

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
b167cb19fb DOC-4560 pipelines/transactions example (#3202)
* DOC-4560 basic transaction example

* DOC-4560 added pipe/transaction examples
2025-08-11 01:42:45 +03:00
ofekshenawa
085338ffb8 Fix Redis CE tests (#3233)
* Fix Redis CE tests

* Remove manually modules installation
2025-08-11 01:42:45 +03:00
ofekshenawa
450b268785 Test against Redis CE (#3191)
* Create workflow that tests go-redis against docker

* Add docker compose file

* Add docker compose file

* Change command in docker compose

* Load modules locally

* test varios redis versions

* add env var to test-redis-enterprise action

* cleaning code

* cleaning code
2025-08-11 01:42:45 +03:00
dependabot[bot]
cc152fabc5 chore(deps): bump codecov/codecov-action from 4 to 5 (#3196)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2025-08-11 01:42:45 +03:00
Cgol9
cfbb6f5a03 SortByWithCount FTSearchOptions fix (#3201)
* SortByWithCount FTSearchOptions fix

* FTSearch test fix

* Another FTSearch test fix

* Another FTSearch test fix

---------

Co-authored-by: Christopher Golling <Chris.Golling@aexp.com>
2025-08-11 01:42:45 +03:00
dependabot[bot]
dec9e1e73f chore(deps): bump rojopolis/spellcheck-github-actions (#3188)
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.40.0 to 0.45.0.
- [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases)
- [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.40.0...0.45.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2025-08-11 01:42:45 +03:00
LINKIWI
f2fa1ce477 Recognize byte slice for key argument in cluster client hash slot computation (#3049)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2025-08-11 01:42:44 +03:00
Justin
7cf9f53eb2 Only check latencies once every 10 seconds with routeByLatency (#2795)
* Only check latencies once every 10 seconds with `routeByLatency`

`routeByLatency` currently checks latencies any time a server returns
a MOVED or READONLY reply. When a shard is down, the ClusterClient
chooses to issue the request to a random server, which returns a MOVED
reply. This causes a state refresh and a latency update on all servers.
This can lead to significant ping load to clusters with a large number
of clients.

This introduces logic to ping only once every 10 seconds, only
performing a latency update on a node during the `GC` function if the
latency was set later than 10 seconds ago.

Fixes https://github.com/redis/go-redis/issues/2782

* use UnixNano instead of Unix for better precision

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2025-08-11 01:42:44 +03:00
LINKIWI
4f48200a0a Eliminate redundant dial mutex causing unbounded connection queue contention (#3088)
* Eliminate redundant dial mutex causing unbounded connection queue contention

* Dialer connection timeouts unit test

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2025-08-11 01:42:44 +03:00
ofekshenawa
92634e1c1a Add guidance on unstable RESP3 support for RediSearch commands to README (#3177)
* Add UnstableResp3 to docs

* Add RawVal and RawResult to wordlist

* Explain more about SetVal

* Add UnstableResp to wordlist
2025-08-11 01:42:44 +03:00
ofekshenawa
92b675f721 Support Probabilistic commands with RESP 2 protocol (#3176)
* Support bloom resp 2

* Support Resp2 for BF.Info

* simplify BFInfoCmd field assignment using map-based key-to-field references
2025-08-11 01:42:44 +03:00
ofekshenawa
73b4f38fb4 Support TimeSeries commands with RESP 2 protocol (#3184)
* Support Timeseries resp 2

* Change to resp 2

* Support Resp2 for TimeSeries commands
2025-08-11 01:42:44 +03:00
andy-stark-redis
1260350692 DOC-4345 added JSON samples for home page (#3183) 2025-08-11 01:42:44 +03:00
andy-stark-redis
d0bd7390f2 DOC-4232 stream code examples (#3128)
* DOC-4232 added first stream example

* DOC-4232 examples up to xadd_7

* DOC-4232 examples up to xread

* DOC-4232 examples up to xclaim

* DOC-4232 added remaining examples

* DOC-4232 more fixes

* DOC-4232 fix for test fail on CI build

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2025-08-11 01:42:44 +03:00
Vladyslav Vildanov
53102b69cd Updated package version (#3158) 2025-08-11 01:42:44 +03:00
andy-stark-redis
d592eedde6 Fix field name spellings (#3132)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2025-08-11 01:42:44 +03:00