Skip to content

Conversation

@deepakverma
Copy link
Owner

No description provided.

NickCraver and others added 30 commits April 21, 2022 14:45
See dotnet/runtime#47935 for details, basically enables color output even though console output is redirected for a better time in GitHub actions.

Co-authored-by: Oleksii Holub <1935960+Tyrrrz@users.noreply.github.com>
* fix #2117

for pub/sub, treak length-one arrays comparably to simple values

* update release notes

* actually check whether we're meant to be allowing arrays
I missed an overload case being an idiot - adding the missing source break for the case in #2071.

...also fixing KeyTouch ordering while in here.

Note that adding `CommandFlags` back optional seems like a quick fix and I did try that route, but in a full test suite here it became apparent that created other ambiguous overload cases, so went this route.
The new features were added to Redis 7: now the indexes of both commands ([BITCOUNT](https://redis.io/commands/bitcount/) and [BITPOS](https://redis.io/commands/bitpos/)) can be specified in BITs instead of BYTEs.

(Also added tests for BitPosition since it was missing)

Co-authored-by: Nick Craver <nrcraver@gmail.com>
Continue #2083 
Now when we can overload function - we can do it also to `KeyExpire` and `KeyExpireAsync`
In the Sentinel Connection Multiplexer, since `OnManagedConnectionRestored` can be executed on a different thread, it's possible for it to dispose the timer just before `OnManagedConnectionFailed` calls `.Change()` on the timer, which leads to an `ObjectDisposedException` being thrown in `OnManagedConnectionFailed`. Since the connection was restored, it seems safe to suppress these exceptions, instead of requiring locking around the reference to `connection.sentinelPrimaryReconnectTimer`.
Adds support for https://redis.io/commands/lcs/ (#2055)

Co-authored-by: slorello89 <42971704+slorello89@users.noreply.github.com>
Co-authored-by: Nick Craver <nrcraver@gmail.com>
Add support for `COMMAND` commands (part of #2055):
COMMAND COUNT - https://redis.io/commands/command-count/
COMMAND GETKEYS - https://redis.io/commands/command-getkeys/
COMMAND LIST - https://redis.io/commands/command-list/


Co-authored-by: Nick Craver <nrcraver@gmail.com>
Co-authored-by: Oleksii Holub <1935960+Tyrrrz@users.noreply.github.com>
[SortedSetAdd](https://redis.io/commands/zadd/) currently not supporting GT and LT features.

Co-authored-by: Nick Craver <nrcraver@gmail.com>
…2093)

I have created a fix for the incorrect HashSlot calculation for the XREAD and XREADGROUP commands (#2086) Since these differ a lot from other messages I have created some new CommandMessage classes:
- SingleStreamReadGroupCommandMessage 
- MultiStreamReadGroupCommandMessage
- SingleStreamReadCommandMessage 
- MultiStreamReadCommandMessage 

The single CommandMessage classes could be removed by only using the multi command messages, but then we have to create a new StreamPostion array and a new StreamPostion object. I wasn't sure which option too choose, so feel free to give input on this (GC vs duplicate code).

There is also some code duplication between the Read and ReadGroup Command messages as the ReadGroup command is very similar to the XREAD but has some additional values in the front of the command (group, consumer, noack). A base class could be created as well to reduce some of the duplication (calculating the hashslot in case of multiple streams and writing the streams part of the commands).

The method CommandAndKey is also not overriden for these Messages as I wasn't which argument of the command to include in the string.

Co-authored-by: Niels Derdaele <niels.derdaele@alsic.be>
Co-authored-by: Nick Craver <nrcraver@gmail.com>
* PrepareScript should work for parameterless scripts; fix #2164

* update link in release notes

* tyop
* PrepareScript should work for parameterless scripts; fix #2164

* update link in release notes

* tyop

* Batch/Transaction need to override new ExecuteAsync API; fix #2167 fix #2176

* Maintain correctness on NRTs and asyncState

Previously the F+F case was getting a null default rather than the pass default value - this corrects that as well. It is not DRY across classes, but let's get this fix in ASAP then address that.

* test both batch and transaction

* bump

Co-authored-by: Nick Craver <nrcraver@gmail.com>
…primary-only out of primary-only (#2183)

Fixes #2182 

@NickCraver for background in #2101, we changed some of the logic around primary-only to require all commands to be explicitly stated as primary-only or not. During this effort, I went through the command list and checked to see which were considered write commands (which would be rejected by a replica) so that there would be consistency in behavior when stumbling on commands that would ordinarily be rejected by a replica. This made a slightly more restrictive list of commands. 

Enter #2182, where this inconsistency had evidently become load-bearing. The user has evidently designated their replicas as writeable (I think I was subconsciously aware of this capability but have never actually seen anyone use it). As it turns out By resolving this inconsistency in #2101 and the follow-on issue when I introduced `SORT_RO` in #2111 I apparently introduced a break.

This PR reverts all the pre-2.6.45 commands' primary vs replica disposition back to their previous state which will remove the break. Any command that was introduced in 2.6.45 is correctly dispositioned.

Co-authored-by: Nick Craver <nrcraver@gmail.com>
Fixes #2160.

We may want to implement `IAsyncDisposable` in more public `IDisposable` classes which can dispose their resources asynchronously.

Co-authored-by: Nick Craver <nrcraver@gmail.com>
@NickCraver - This will fix #2016 

The issue is that when `GetFeatures` does the server selection, it uses `PING` as the command it's asking about, so when the multiplexer responds with a server, it responds with any server. Of course, then when it goes to execute the command, it's been explicitly handed a server, so it honors that choice but checks it to make sure it's a valid server to send the command to, so if you're executing a write command and `GetFeatuers` just so happened to output a read-only replica, when the multiplexer does the 'is this a valid server?' check, it determines it is not and propagates the error. that's what causes the blowup. By passing in the RedisCommand to `GetFeatures`, we allow it to make an informed choice of server for that Redis Command.

The other option is to simply not pass the server on down the line when we we've done a feature check, and allow the muxer to make it's own decision, this would cause an extra run of `Select` which the current pattern e.g. see [sort](https://github.com/StackExchange/StackExchange.Redis/blob/main/src/StackExchange.Redis/RedisDatabase.cs#L1816) tries to avoid

One weird case, with SORT/SORT_RO, if the RO command is what we prefer to run (because we don't have a destination key to output it to), and `SORT_RO` is not available (because they aren't on Redis 7+), we cannot trust the output of GetFeatures, so I just set the selected server back to null and let the muxer figure it out down the line.

Co-authored-by: Nick Craver <nrcraver@gmail.com>
Making things a bit easier for when you need to iterate over servers for a multiplexer
…eligible for timeout (#2217)

Since we're in a head-of-queue style situation here, the first non-timeout we hit means we're done - hop out and release the lock. Small docs fix tucked in here because reasons.
This adds a bit of info on required command permissions to connect.
…er (#2229)

* add test to investigate #2223

* add connect test

* assert zeros in SyncConfigure

* add missing ForAwait uses

* investigate rantocompletion fault

* fix brittle test

* stabilize tests

* release notes
…ed (#2170)

**Motivation**

We want to take advantage of sending just hashed `LoadedLuaScript` to a server, but still, be able automatically failover and reconstruct the hash in case the Redis instance restarts.

The goal was not to change the public API surface.

Addresses #1968

Unit tests are still missing, first I want to check with you guys whether this is the right approach. 

Co-authored-by: Nick Craver <nrcraver@gmail.com>
Henr1k80 and others added 30 commits September 9, 2025 15:48
…lues (#2950)

* RedisValue/RedisResult: cast to double should respect NaN/[+/-]Inf from raw/string

* release notes
…2954)

* Convert to Hex only on Encoding.UTF8.GetString possible exception
Has OutOfMemory exceptions can occure in native Encoding.UTF8.GetString, we should not convert result to hex values

* Fix other cases where we return an Hex string on all kind of exceptions
…into routed (#2958)

* mitigate #2955

- by default: use round-robin (not channel-routing) for "non-sharded" pub/sub
- add new API for channel-routed literals/wildcards
- when publishing, if we're also subscribed: use that connection
- randomize where the round-robin starts, to better randomize startup behaviour

* release notes

* prefer a single WithKeyRouting API
* remove PublicSign windows-only restriction

* release notes
* Actions: support publishing to MyGet off main branch

This is on the way to removing AppVeyor (currently broken) from our environment. Publishes to MyGet when building from a push to main, _not_ on pull requests.

* Only package on main as well
* add failing test and mitigation for OSS sharded sunbscribe behavior

* fix unsolicited SUNSUBSCRIBE

* remove redundant code

* ssh test

* SUNSUBSCRIBE handling; if possible, use the active connection to find where we should be subscribing

* PR nits

* more PR nits
* docker image: use client-libs-test (which has better preview support)

* Update Dockerfile
* Support MSETEX

* release notes

* prefer WriteBulkString("WHATEVER"u8) over WriteBulkString(RedisLiterals.WHATEVER)

* create Expiration as top-level concept

* The method is no longer ambiguous, yay (also: typos)

* Mark the MSETEX API as [Experimental], with docs

* actually, we can't make that [SER002] because of overload resolution
* propose support for XREADGROUP CLAIM

* release notes

* comma nit

* add integration tests for `claimMinIdleTime`

* support claimMinIdleTime on single-stream read API

* u8-ify the stream messages

* Update src/StackExchange.Redis/APITypes/StreamEntry.cs

Co-authored-by: Philo <philon@microsoft.com>

---------

Co-authored-by: Philo <philon@microsoft.com>
* Completely untested start for CAD/CAD

* unit tests

* propose the actual API

* DIGEST integration tests

* compensate for leading-zero oddness

* apply fixes for server hash format changes

* use CAS/CAD in locking operations

* release notes

* remove mitigations for receiving under-length digests from the server (now fixed at server)

* add zero-length digest test

* Update src/StackExchange.Redis/Interfaces/IDatabaseAsync.cs

Co-authored-by: Philo <philon@microsoft.com>

---------

Co-authored-by: Philo <philon@microsoft.com>
* limit [SER002] to the digest-related features, to prevent warnings on overload resolution

* use `Expiration` (from MSETEX) in new `SET` API (combined with `ValueCondition`)

* fix defaults to minimize build-time impact

* chmod +x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.