StackExchange / StackExchange/StackExchange.Redis

[Question] Roll back transaction if sorted set is modified in any way

Open
#2,880 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Hey there. We're in the process of migrating from ServiceStack.Redis to this library. Previously we were able to WATCH keys and I've been converting all them to transactions with conditions, per this documentation.

We're stuck on how to handle sorted sets though. It was our belief/understanding that if we set a watch on the key of a sorted set, it would fail the transaction if anything about that key or the members within it were modified. When looking at the available sorted set conditions, I don't see a way to recreate that watch that wouldn't involve getting every member of the set and ensuring each individual one was equal to its previous value. That seems so inefficient that I feel like I must be overthinking it and there must be a simpler way. Or perhaps that old watch wasn't doing what we thought it was doing?

Any thoughts would be appreciated! Thank you

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackExchange.Redis transactions documentation and the available sorted set conditions. Verify whether WATCH observes changes to sorted-set members and whether the library exposes an equivalent condition; done means providing a definitive behavior explanation or documenting the supported approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
databases
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.