forked from redis/go-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into struct-to-hashset
- Loading branch information
Showing
133 changed files
with
9,452 additions
and
4,087 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
custom: ['https://uptrace.dev'] | ||
custom: ['https://uptrace.dev/sponsor'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
*.rdb | ||
testdata/*/ | ||
testdata/* | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,149 +1,55 @@ | ||
## [8.11.4](https://github.com/go-redis/redis/compare/v8.11.3...v8.11.4) (2021-10-04) | ||
# [9.0.0-rc.2](https://github.com/go-redis/redis/compare/v9.0.0-rc.1...v9.0.0-rc.2) (2022-11-26) | ||
|
||
|
||
### Features | ||
|
||
* add acl auth support for sentinels ([f66582f](https://github.com/go-redis/redis/commit/f66582f44f3dc3a4705a5260f982043fde4aa634)) | ||
* add Cmd.{String,Int,Float,Bool}Slice helpers and an example ([5d3d293](https://github.com/go-redis/redis/commit/5d3d293cc9c60b90871e2420602001463708ce24)) | ||
* add SetVal method for each command ([168981d](https://github.com/go-redis/redis/commit/168981da2d84ee9e07d15d3e74d738c162e264c4)) | ||
|
||
|
||
|
||
## v8.11 | ||
|
||
- Remove OpenTelemetry metrics. | ||
- Supports more redis commands and options. | ||
|
||
## v8.10 | ||
|
||
- Removed extra OpenTelemetry spans from go-redis core. Now go-redis instrumentation only adds a | ||
single span with a Redis command (instead of 4 spans). There are multiple reasons behind this | ||
decision: | ||
|
||
- Traces become smaller and less noisy. | ||
- It may be costly to process those 3 extra spans for each query. | ||
- go-redis no longer depends on OpenTelemetry. | ||
|
||
Eventually we hope to replace the information that we no longer collect with OpenTelemetry | ||
Metrics. | ||
|
||
## v8.9 | ||
|
||
- Changed `PubSub.Channel` to only rely on `Ping` result. You can now use `WithChannelSize`, | ||
`WithChannelHealthCheckInterval`, and `WithChannelSendTimeout` to override default settings. | ||
|
||
## v8.8 | ||
|
||
- To make updating easier, extra modules now have the same version as go-redis does. That means that | ||
you need to update your imports: | ||
|
||
``` | ||
github.com/go-redis/redis/extra/redisotel -> github.com/go-redis/redis/extra/redisotel/v8 | ||
github.com/go-redis/redis/extra/rediscensus -> github.com/go-redis/redis/extra/rediscensus/v8 | ||
``` | ||
|
||
## v8.5 | ||
|
||
- [knadh](https://github.com/knadh) contributed long-awaited ability to scan Redis Hash into a | ||
struct: | ||
|
||
```go | ||
err := rdb.HGetAll(ctx, "hash").Scan(&data) | ||
### Bug Fixes | ||
|
||
err := rdb.MGet(ctx, "key1", "key2").Scan(&data) | ||
``` | ||
* capture error correctly in withConn ([d1bfaba](https://github.com/go-redis/redis/commit/d1bfaba549fe380d269c26cea0a0183ed1520a85)) | ||
* fixes ring.SetAddrs and rebalance race ([#2283](https://github.com/go-redis/redis/issues/2283)) ([d83436b](https://github.com/go-redis/redis/commit/d83436b321cd9ed52ba33c3edbe8f63bb0444c59)) | ||
* read in route_randomly query param correctly ([f236053](https://github.com/go-redis/redis/commit/f236053735d10aec5e6e31fc3ced1b2e53292554)) | ||
* reduce `SetAddrs` shards lock contention ([6c05a9f](https://github.com/go-redis/redis/commit/6c05a9f6b17f8e32593d3f7d594f82ba3dbcafb1)), closes [/github.com/go-redis/redis/pull/2190#discussion_r953040289](https://github.com//github.com/go-redis/redis/pull/2190/issues/discussion_r953040289) [#2077](https://github.com/go-redis/redis/issues/2077) | ||
* wrap cmds in Conn.TxPipeline ([5053db2](https://github.com/go-redis/redis/commit/5053db2f9c8b3ca25f497a75f70012c7ad6cd775)) | ||
|
||
- Please check [redismock](https://github.com/go-redis/redismock) by | ||
[monkey92t](https://github.com/monkey92t) if you are looking for mocking Redis Client. | ||
|
||
## v8 | ||
|
||
- All commands require `context.Context` as a first argument, e.g. `rdb.Ping(ctx)`. If you are not | ||
using `context.Context` yet, the simplest option is to define global package variable | ||
`var ctx = context.TODO()` and use it when `ctx` is required. | ||
|
||
- Full support for `context.Context` canceling. | ||
|
||
- Added `redis.NewFailoverClusterClient` that supports routing read-only commands to a slave node. | ||
|
||
- Added `redisext.OpenTemetryHook` that adds | ||
[Redis OpenTelemetry instrumentation](https://redis.uptrace.dev/tracing/). | ||
|
||
- Redis slow log support. | ||
|
||
- Ring uses Rendezvous Hashing by default which provides better distribution. You need to move | ||
existing keys to a new location or keys will be inaccessible / lost. To use old hashing scheme: | ||
|
||
```go | ||
import "github.com/golang/groupcache/consistenthash" | ||
|
||
ring := redis.NewRing(&redis.RingOptions{ | ||
NewConsistentHash: func() { | ||
return consistenthash.New(100, crc32.ChecksumIEEE) | ||
}, | ||
}) | ||
``` | ||
|
||
- `ClusterOptions.MaxRedirects` default value is changed from 8 to 3. | ||
- `Options.MaxRetries` default value is changed from 0 to 3. | ||
|
||
- `Cluster.ForEachNode` is renamed to `ForEachShard` for consistency with `Ring`. | ||
|
||
## v7.3 | ||
|
||
- New option `Options.Username` which causes client to use `AuthACL`. Be aware if your connection | ||
URL contains username. | ||
|
||
## v7.2 | ||
|
||
- Existing `HMSet` is renamed to `HSet` and old deprecated `HMSet` is restored for Redis 3 users. | ||
|
||
## v7.1 | ||
|
||
- Existing `Cmd.String` is renamed to `Cmd.Text`. New `Cmd.String` implements `fmt.Stringer` | ||
interface. | ||
### Features | ||
|
||
## v7 | ||
* add HasErrorPrefix ([d3d8002](https://github.com/go-redis/redis/commit/d3d8002e894a1eab5bab2c9fff13439527e330d8)) | ||
* add support for SINTERCARD command ([bc51c61](https://github.com/go-redis/redis/commit/bc51c61a458d1bc4fb4424c7c3e912325ef980cc)) | ||
|
||
- _Important_. Tx.Pipeline now returns a non-transactional pipeline. Use Tx.TxPipeline for a | ||
transactional pipeline. | ||
- WrapProcess is replaced with more convenient AddHook that has access to context.Context. | ||
- WithContext now can not be used to create a shallow copy of the client. | ||
- New methods ProcessContext, DoContext, and ExecContext. | ||
- Client respects Context.Deadline when setting net.Conn deadline. | ||
- Client listens on Context.Done while waiting for a connection from the pool and returns an error | ||
when context context is cancelled. | ||
- Add PubSub.ChannelWithSubscriptions that sends `*Subscription` in addition to `*Message` to allow | ||
detecting reconnections. | ||
- `time.Time` is now marshalled in RFC3339 format. `rdb.Get("foo").Time()` helper is added to parse | ||
the time. | ||
- `SetLimiter` is removed and added `Options.Limiter` instead. | ||
- `HMSet` is deprecated as of Redis v4. | ||
|
||
## v6.15 | ||
|
||
- Cluster and Ring pipelines process commands for each node in its own goroutine. | ||
## v9 UNRELEASED | ||
|
||
## 6.14 | ||
### Added | ||
|
||
- Added Options.MinIdleConns. | ||
- Added Options.MaxConnAge. | ||
- PoolStats.FreeConns is renamed to PoolStats.IdleConns. | ||
- Add Client.Do to simplify creating custom commands. | ||
- Add Cmd.String, Cmd.Int, Cmd.Int64, Cmd.Uint64, Cmd.Float64, and Cmd.Bool helpers. | ||
- Lower memory usage. | ||
- Added support for [RESP3](https://github.com/antirez/RESP3/blob/master/spec.md) protocol. | ||
Contributed by @monkey92t who has done a lot of work recently. | ||
- Added `ContextTimeoutEnabled` option that controls whether the client respects context timeouts | ||
and deadlines. See | ||
[Redis Timeouts](https://redis.uptrace.dev/guide/go-redis-debugging.html#timeouts) for details. | ||
- Added `ParseClusterURL` to parse URLs into `ClusterOptions`, for example, | ||
`redis://user:password@localhost:6789?dial_timeout=3&read_timeout=6s&addr=localhost:6790&addr=localhost:6791`. | ||
- Added metrics instrumentation using `redisotel.IstrumentMetrics`. See | ||
[documentation](https://redis.uptrace.dev/guide/go-redis-monitoring.html) | ||
|
||
## v6.13 | ||
### Changed | ||
|
||
- Ring got new options called `HashReplicas` and `Hash`. It is recommended to set | ||
`HashReplicas = 1000` for better keys distribution between shards. | ||
- Cluster client was optimized to use much less memory when reloading cluster state. | ||
- PubSub.ReceiveMessage is re-worked to not use ReceiveTimeout so it does not lose data when timeout | ||
occurres. In most cases it is recommended to use PubSub.Channel instead. | ||
- Dialer.KeepAlive is set to 5 minutes by default. | ||
- Removed asynchronous cancellation based on the context timeout. It was racy in v8 and is | ||
completely gone in v9. | ||
- Reworked hook interface and added `DialHook`. | ||
- Replaced `redisotel.NewTracingHook` with `redisotel.InstrumentTracing`. See | ||
[example](example/otel) and | ||
[documentation](https://redis.uptrace.dev/guide/go-redis-monitoring.html). | ||
- Replaced `*redis.Z` with `redis.Z` since it is small enough to be passed as value without making | ||
an allocation. | ||
- Renamed the option `MaxConnAge` to `ConnMaxLifetime`. | ||
- Renamed the option `IdleTimeout` to `ConnMaxIdleTime`. | ||
- Removed connection reaper in favor of `MaxIdleConns`. | ||
- Removed `WithContext` since `context.Context` can be passed directly as an arg. | ||
- Removed `Pipeline.Close` since there is no real need to explicitly manage pipeline resources and | ||
it can be safely reused via `sync.Pool` etc. `Pipeline.Discard` is still available if you want to | ||
reset commands for some reason. | ||
|
||
## v6.12 | ||
### Fixed | ||
|
||
- ClusterClient got new option called `ClusterSlots` which allows to build cluster of normal Redis | ||
Servers that don't have cluster mode enabled. See | ||
https://godoc.org/github.com/go-redis/redis#example-NewClusterClient--ManualSetup | ||
- Improved and fixed pipeline retries. | ||
- As usual, added more commands and fixed some bugs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.