1
0
mirror of https://github.com/redis/go-redis.git synced 2025-09-11 18:10:43 +03:00
Commit Graph

2935 Commits

Author SHA1 Message Date
fukua95
062685de5c chore: set the default value for the options.protocol in the init() of options (#3387)
* chore: set the default value for the `options.protocol` in the `init()` of `options`

Signed-off-by: fukua95 <fukua95@gmail.com>

* add a test

Signed-off-by: fukua95 <fukua95@gmail.com>

---------

Signed-off-by: fukua95 <fukua95@gmail.com>
2025-08-11 01:42:55 +03:00
dependabot[bot]
6e822c0b40 chore(deps): bump rojopolis/spellcheck-github-actions (#3389)
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.48.0 to 0.49.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.48.0...0.49.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-version: 0.49.0
  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>
2025-08-11 01:42:55 +03:00
ofekshenawa
742335126d fix: prevent routing reads to loading slave nodes (#3370)
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-08-11 01:42:55 +03:00
ofekshenawa
27ab642091 xinfo-groups: support nil lag in XINFO GROUPS (#3369)
* xinfo-groups: support nil lag in XINFO GROUPS

* Add test

* docs: clarify XInfoGroup.Lag field behavior with Nil values

* docs: clarify XInfoGroup.Lag field behavior
2025-08-11 01:42:55 +03:00
fukua95
368a1c7739 chore: remove unused param (#3384)
Signed-off-by: fukua95 <fukua95@gmail.com>
2025-08-11 01:42:55 +03:00
LINKIWI
46da738279 Unit test for pool acquisition timeout (#3381)
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-08-11 01:42:55 +03:00
fukua95
27c6e8b290 perf: avoid unnecessary copy operation (#3376)
* optime: reduce unnecessary copy operations

* add a comment

* trigger CI without code changes, because the bug of docker

* add comments
2025-08-11 01:42:55 +03:00
LINKIWI
e25a391e9e Export pool errors for public consumption (#3380) 2025-08-11 01:42:55 +03:00
fukua95
81bd24deb0 chore: remove unused param (#3382)
* chore: remove unused param

Signed-off-by: fukua95 <fukua95@gmail.com>

* chore: rename a unused param to `_`

Signed-off-by: fukua95 <fukua95@gmail.com>

---------

Signed-off-by: fukua95 <fukua95@gmail.com>
2025-08-11 01:42:55 +03:00
fukua95
7265b22519 chore: optimize function ReplaceSpaces (#3383)
* chore: optimize function `ReplaceSpaces`

Signed-off-by: fukua95 <fukua95@gmail.com>

* trigger CI again because the bug of docker

Signed-off-by: fukua95 <fukua95@gmail.com>

* trigger CI again because the bug of docker

Signed-off-by: fukua95 <fukua95@gmail.com>

---------

Signed-off-by: fukua95 <fukua95@gmail.com>
2025-08-11 01:42:55 +03:00
Amir Salehi
f2818c7f70 test(util): add unit tests for Atoi, ParseInt, ParseUint, and ParseFloat (#3377) 2025-08-11 01:42:55 +03:00
fukua95
a2fc5599ca feat: add ParseFailoverURL (#3362)
* add ParseFailoverURL for FailoverOptions
* fix 2 warning

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-08-11 01:42:55 +03:00
ofekshenawa
a8e958b732 utils: export ParseFloat and MustParseFloat wrapping internal utils (#3371)
* utils: expose ParseFloat via new public utils package

* add tests for special float values in vector search
2025-08-11 01:42:55 +03:00
Nedyalko Dyakov
289744d38d ci(redis): update to 8.0.1 (#3372) 2025-08-11 01:42:55 +03:00
Lev Zakharov
9db5abe5be feat: add connection waiting statistics (#2804)
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2025-08-11 01:42:55 +03:00
Nedyalko Dyakov
8e010d037c chore(release): sync master after releasing V9.8.0 (#3365)
* Bump version to 9.8.0-beta1

Update README.md

* Feature more prominently how to enable OpenTelemetry instrumentation (#3316)

* Sync master with v9.8.0-beta.1 (#3322)

* DOC-4464 examples for llen, lpop, lpush, lrange, rpop, and rpush (#3234)

* DOC-4464 examples for llen, lpop, lpush, lrange, rpop, and rpush

* DOC-4464 improved variable names

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>

* update pubsub.go (#3329)

* use 8.0-RC1 (#3330)

* drop ft.profile that was never enabled (#3323)

* chore(deps): bump rojopolis/spellcheck-github-actions (#3336)

Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.47.0 to 0.48.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.47.0...0.48.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-version: 0.48.0
  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>

* Fix FT.Search Limit argument and add CountOnly argument for limit 0 0 (#3338)

* Fix Limit argument and add CountOnly argument

* Add test and Documentation

* Update search_commands.go

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>

* fix add missing command in interface (#3344)

* Use DB option in NewFailoverClusterClient (#3342)

* DOC-5102 added CountOnly search example for docs (#3345)

* Add  integration tests for Redis 8 behavior changes in Redis Search (#3337)

* Add  integration tests for Redis 8 behavior changes in Redis Search

* Undo changes in ft.search limit

* Fix BM25 as the default scorer test

* Add more tests and comments on deprecated params

* Update search_commands.go

* Remove deprication comment for nostopwords

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>

* Use correct slot for COUNTKEYSINSLOT command (#3327)

* Ensure context isn't exhausted via concurrent query as opposed to sentinel query (#3334)

* fix: better error handling when fetching the master node from the sentinels (#3349)

* Better error handling when fetching the master node from the sentinels

* fix error message generation

* close the errCh to not block

* use len over errCh

* docs: fix documentation comments (#3351)

* DOC-5111 added hash search examples (#3357)

* fix: Fix panic caused when arg is nil (#3353)

* Update README.md, use redis discord guild (#3331)

* use redis discord guild

* add line in CONTRIBUTING.md

* update with badges similar to rest of the libraries. update url

* updated with direct invite link

* fix discord link in CONTRIBUTING.md

* fix stackoverflow tag

---------

Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>

* update HExpire command documentation (#3355)

* update HExpire command documentation

* Apply suggestions from code review

Format the links in the documentation. Add missing documentation.

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>

* feat: func isEmptyValue support time.Time (#3273)

* fix:func isEmptyValue support time.Time

* fix: Improve HSet unit tests

* feat: Improve HSet unit tests

* fix: isEmptyValue Struct only support time.Time

* test(hset): add empty custom struct test

---------

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

* fix: `PubSub` isn't concurrency-safe (#3360)

* migrate golangci-lint config to v2 format (#3354)

* migrate golangci-lint config to v2 format

* chore: skip CI on migration [skip ci]

* Bump golangci version

* Address several golangci-lint/staticcheck warnings

* change staticchecks settings

* chore(ci): Use redis 8 rc2 image. (#3361)

* chore(ci): Use redis 8 rc2 image

* test(timeseries): fix duplicatePolicy check

* feat(options): panic when options are nil (#3363)

Client creation should panic when options are nil.

* chore(release): Update version to v9.8.0

- update version in relevant places
- add RELEASE-NOTES.md to keep track of release notes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Nikolay Dubina <nikolay.dubina.pub@gmail.com>
Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com>
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: Liu Shuang <liushuangbill@outlook.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
Co-authored-by: Bulat Khasanov <afti@yandex.ru>
Co-authored-by: Naveen Prashanth <78990165+gnpaone@users.noreply.github.com>
Co-authored-by: Glenn <alohaglenn@icloud.com>
Co-authored-by: frankj <frankxjkuang@gmail.com>
Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
Co-authored-by: Hui <gh73962@gmail.com>
Co-authored-by: Guo Hui <gh7396@gmail.com>
Co-authored-by: fukua95 <fukua95@gmail.com>
2025-08-11 01:42:55 +03:00
fengyun.rui
f1ca486062 feat: add more stats for otel (#2930)
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-08-11 01:42:55 +03:00
dependabot[bot]
050bc05ba0 chore(deps): bump golangci/golangci-lint-action from 7.0.0 to 8.0.0 (#3366)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v7.0.0...v8.0.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: 8.0.0
  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>
2025-08-11 01:42:55 +03:00
Nedyalko Dyakov
64390f210e feat(options): panic when options are nil (#3363)
Client creation should panic when options are nil.
2025-08-11 01:42:55 +03:00
Nedyalko Dyakov
b583d957f1 chore(ci): Use redis 8 rc2 image. (#3361)
* chore(ci): Use redis 8 rc2 image

* test(timeseries): fix duplicatePolicy check
2025-08-11 01:42:55 +03:00
ofekshenawa
55758375fc migrate golangci-lint config to v2 format (#3354)
* migrate golangci-lint config to v2 format

* chore: skip CI on migration [skip ci]

* Bump golangci version

* Address several golangci-lint/staticcheck warnings

* change staticchecks settings
2025-08-11 01:42:55 +03:00
fukua95
bfcf5171c1 fix: PubSub isn't concurrency-safe (#3360) 2025-08-11 01:42:55 +03:00
Hui
b1ba4f7b27 feat: func isEmptyValue support time.Time (#3273)
* fix:func isEmptyValue support time.Time

* fix: Improve HSet unit tests

* feat: Improve HSet unit tests

* fix: isEmptyValue Struct only support time.Time

* test(hset): add empty custom struct test

---------

Co-authored-by: Guo Hui <gh7396@gmail.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:55 +03:00
ofekshenawa
b3880883b4 update HExpire command documentation (#3355)
* update HExpire command documentation

* Apply suggestions from code review

Format the links in the documentation. Add missing documentation.

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-08-11 01:42:55 +03:00
Nedyalko Dyakov
462175e374 Update README.md, use redis discord guild (#3331)
* use redis discord guild

* add line in CONTRIBUTING.md

* update with badges similar to rest of the libraries. update url

* updated with direct invite link

* fix discord link in CONTRIBUTING.md

* fix stackoverflow tag

---------

Co-authored-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
2025-08-11 01:42:55 +03:00
frankj
4f43d86713 fix: Fix panic caused when arg is nil (#3353) 2025-08-11 01:42:55 +03:00
andy-stark-redis
2872e0d170 DOC-5111 added hash search examples (#3357) 2025-08-11 01:42:46 +03:00
Glenn
e2b230caeb docs: fix documentation comments (#3351) 2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
dbe3f50e65 fix: better error handling when fetching the master node from the sentinels (#3349)
* Better error handling when fetching the master node from the sentinels

* fix error message generation

* close the errCh to not block

* use len over errCh
2025-08-11 01:42:45 +03:00
Naveen Prashanth
053f2b270c Ensure context isn't exhausted via concurrent query as opposed to sentinel query (#3334) 2025-08-11 01:42:45 +03:00
Bulat Khasanov
1284ebd6d1 Use correct slot for COUNTKEYSINSLOT command (#3327) 2025-08-11 01:42:45 +03:00
ofekshenawa
e9570a3969 Add integration tests for Redis 8 behavior changes in Redis Search (#3337)
* Add  integration tests for Redis 8 behavior changes in Redis Search

* Undo changes in ft.search limit

* Fix BM25 as the default scorer test

* Add more tests and comments on deprecated params

* Update search_commands.go

* Remove deprication comment for nostopwords

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-08-11 01:42:45 +03:00
andy-stark-redis
7f9db6d9ba DOC-5102 added CountOnly search example for docs (#3345) 2025-08-11 01:42:45 +03:00
Bulat Khasanov
e2d1cd584d Use DB option in NewFailoverClusterClient (#3342) 2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
41b4985a57 fix add missing command in interface (#3344) 2025-08-11 01:42:45 +03:00
ofekshenawa
ab8deac84f Fix FT.Search Limit argument and add CountOnly argument for limit 0 0 (#3338)
* Fix Limit argument and add CountOnly argument

* Add test and Documentation

* Update search_commands.go

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-08-11 01:42:45 +03:00
dependabot[bot]
4e6dd15bd6 chore(deps): bump rojopolis/spellcheck-github-actions (#3336)
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.47.0 to 0.48.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.47.0...0.48.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-version: 0.48.0
  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>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
40e6c906f8 drop ft.profile that was never enabled (#3323) 2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
501d5354cc use 8.0-RC1 (#3330) 2025-08-11 01:42:45 +03:00
Liu Shuang
ef7f46a0db update pubsub.go (#3329) 2025-08-11 01:42:45 +03:00
andy-stark-redis
01b19ff284 DOC-4464 examples for llen, lpop, lpush, lrange, rpop, and rpush (#3234)
* DOC-4464 examples for llen, lpop, lpush, lrange, rpop, and rpush

* DOC-4464 improved variable names

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
593d874591 Sync master with v9.8.0-beta.1 (#3322) 2025-08-11 01:42:45 +03:00
Nikolay Dubina
0a226037ec Feature more prominently how to enable OpenTelemetry instrumentation (#3316) 2025-08-11 01:42:45 +03:00
Oleglacto
38ce817c85 added Do method for raw query by single conn from pool.Conn() (#3182)
* added `Do` method for raw query by single conn from `pool.Conn()`

* added test to cmdble Do method

* fixed test

* moved Do cmd to commands.go

---------

Co-authored-by: Oleg Laktyushkin <oglaktyushkin@avito.ru>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
9ef6db16bc Drop RedisGears (aka. Triggers and Functions) (#3321) 2025-08-11 01:42:45 +03:00
LINKIWI
de41868195 Bound connection pool background dials to configured dial timeout (#3089) 2025-08-11 01:42:45 +03:00
Justin
ad77123c9b Make MASTERDOWN a retriable error in RedisCluster client (#3164)
When clusters are running with `replica-server-stale-data no`, replicas
will return a MASTERDOWN error under two conditions:
  1. The primary has failed and we are not serving requests.
  2. A replica has just started and has not yet synced from the primary.

The former, primary has failed and we are not serving requests, is
similar to a CLUSTERDOWN error and should be similarly retriable.

When a replica has just started and has not yet synced from the primary
the request should be retried on other available nodes in the shard.
Otherwise a percentage of the read requests to the shard will fail.

Examples when `replica-server-stale-data no` is enabled:
  1. In a cluster using `ReadOnly` with a single read replica, every
     read request will return errors to the client because MASTERDOWN is
     not a retriable error.
  2. In a cluster using `RouteRandomly` a percentage of the requests
     will return errors to the client based on if this server was
     selected.

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
Nedyalko Dyakov
ba1f754a97 chore: disable verifying golangci configuration (#3319) 2025-08-11 01:42:45 +03:00
Alexander Menshchikov
2ad1eb1225 Add FailoverClusterClient support for Universal client (#2794)
* Add FailoverClusterClient support + fix example/hset-struct go.sum

* Improve NewUniversalClient comment

---------

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-08-11 01:42:45 +03:00
ofekshenawa
732a7b618c Support new hash commands: HGETDEL, HGETEX, HSETEX (#3305) 2025-08-11 01:42:45 +03:00