Skip to content

Commit f9b11c5

Browse files
authored
Merge branch 'master' into add-conn-pool-wait-stats
2 parents 8bd26c5 + 26e0c49 commit f9b11c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4146
-80
lines changed

.github/wordlist.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ url
5757
variadic
5858
RedisStack
5959
RedisGears
60-
RedisTimeseries
60+
RedisTimeseries
61+
RediSearch

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v4
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.36.0
11+
uses: rojopolis/spellcheck-github-actions@0.38.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## Unreleased
2+
3+
### Changed
4+
5+
* `go-redis` won't skip span creation if the parent spans is not recording. ([#2980](https://github.com/redis/go-redis/issues/2980))
6+
Users can use the OpenTelemetry sampler to control the sampling behavior.
7+
For instance, you can use the `ParentBased(NeverSample())` sampler from `go.opentelemetry.io/otel/sdk/trace` to keep
8+
a similar behavior (drop orphan spans) of `go-redis` as before.
9+
110
## [9.0.5](https://github.com/redis/go-redis/compare/v9.0.4...v9.0.5) (2023-05-29)
211

312

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ build:
3131

3232
testdata/redis:
3333
mkdir -p $@
34-
wget -qO- https://download.redis.io/releases/redis-7.2.1.tar.gz | tar xvz --strip-components=1 -C $@
34+
wget -qO- https://download.redis.io/releases/redis-7.4-rc1.tar.gz | tar xvz --strip-components=1 -C $@
3535

3636
testdata/redis/src/redis-server: testdata/redis
3737
cd $< && make all

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ to this specification.
143143

144144
```go
145145
import (
146-
"context"
147-
"fmt"
148-
149146
"github.com/redis/go-redis/v9"
150147
)
151148

bitmap_commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type BitMapCmdable interface {
1616
BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
1717
BitPosSpan(ctx context.Context, key string, bit int8, start, end int64, span string) *IntCmd
1818
BitField(ctx context.Context, key string, values ...interface{}) *IntSliceCmd
19+
BitFieldRO(ctx context.Context, key string, values ...interface{}) *IntSliceCmd
1920
}
2021

2122
func (c cmdable) GetBit(ctx context.Context, key string, offset int64) *IntCmd {

command.go

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ func (cmd *StatusCmd) Result() (string, error) {
573573
return cmd.val, cmd.err
574574
}
575575

576+
func (cmd *StatusCmd) Bytes() ([]byte, error) {
577+
return util.StringToBytes(cmd.val), cmd.err
578+
}
579+
576580
func (cmd *StatusCmd) String() string {
577581
return cmdString(cmd, cmd.val)
578582
}
@@ -3783,6 +3787,65 @@ func (cmd *MapStringStringSliceCmd) readReply(rd *proto.Reader) error {
37833787
return nil
37843788
}
37853789

3790+
// -----------------------------------------------------------------------
3791+
// MapStringInterfaceCmd represents a command that returns a map of strings to interface{}.
3792+
type MapMapStringInterfaceCmd struct {
3793+
baseCmd
3794+
val map[string]interface{}
3795+
}
3796+
3797+
func NewMapMapStringInterfaceCmd(ctx context.Context, args ...interface{}) *MapMapStringInterfaceCmd {
3798+
return &MapMapStringInterfaceCmd{
3799+
baseCmd: baseCmd{
3800+
ctx: ctx,
3801+
args: args,
3802+
},
3803+
}
3804+
}
3805+
3806+
func (cmd *MapMapStringInterfaceCmd) String() string {
3807+
return cmdString(cmd, cmd.val)
3808+
}
3809+
3810+
func (cmd *MapMapStringInterfaceCmd) SetVal(val map[string]interface{}) {
3811+
cmd.val = val
3812+
}
3813+
3814+
func (cmd *MapMapStringInterfaceCmd) Result() (map[string]interface{}, error) {
3815+
return cmd.val, cmd.err
3816+
}
3817+
3818+
func (cmd *MapMapStringInterfaceCmd) Val() map[string]interface{} {
3819+
return cmd.val
3820+
}
3821+
3822+
func (cmd *MapMapStringInterfaceCmd) readReply(rd *proto.Reader) (err error) {
3823+
n, err := rd.ReadArrayLen()
3824+
if err != nil {
3825+
return err
3826+
}
3827+
3828+
data := make(map[string]interface{}, n/2)
3829+
for i := 0; i < n; i += 2 {
3830+
_, err := rd.ReadArrayLen()
3831+
if err != nil {
3832+
cmd.err = err
3833+
}
3834+
key, err := rd.ReadString()
3835+
if err != nil {
3836+
cmd.err = err
3837+
}
3838+
value, err := rd.ReadString()
3839+
if err != nil {
3840+
cmd.err = err
3841+
}
3842+
data[key] = value
3843+
}
3844+
3845+
cmd.val = data
3846+
return nil
3847+
}
3848+
37863849
//-----------------------------------------------------------------------
37873850

37883851
type MapStringInterfaceSliceCmd struct {
@@ -4997,6 +5060,7 @@ type ClientInfo struct {
49975060
PSub int // number of pattern matching subscriptions
49985061
SSub int // redis version 7.0.3, number of shard channel subscriptions
49995062
Multi int // number of commands in a MULTI/EXEC context
5063+
Watch int // redis version 7.4 RC1, number of keys this client is currently watching.
50005064
QueryBuf int // qbuf, query buffer length (0 means no query pending)
50015065
QueryBufFree int // qbuf-free, free space of the query buffer (0 means the buffer is full)
50025066
ArgvMem int // incomplete arguments for the next command (already extracted from query buffer)
@@ -5149,6 +5213,8 @@ func parseClientInfo(txt string) (info *ClientInfo, err error) {
51495213
info.SSub, err = strconv.Atoi(val)
51505214
case "multi":
51515215
info.Multi, err = strconv.Atoi(val)
5216+
case "watch":
5217+
info.Watch, err = strconv.Atoi(val)
51525218
case "qbuf":
51535219
info.QueryBuf, err = strconv.Atoi(val)
51545220
case "qbuf-free":

commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ type Cmdable interface {
220220
ProbabilisticCmdable
221221
PubSubCmdable
222222
ScriptingFunctionsCmdable
223+
SearchCmdable
223224
SetCmdable
224225
SortedSetCmdable
225226
StringCmdable

0 commit comments

Comments
 (0)