Closed tomwolanski closed 6 months ago
The GT flag is redis 7 or above; what version is the server? If a command fails pre-validation on the server, then indeed: it would appear as an empty transaction and everything would be aborted
You are correct. I have been using v6, and the commands works correclty after update to v7.
I believe the ticket can be closed.
closing as 'resolved'
I am having some troubles understanding the behaviour of the transaction.
context I want to have a sorted set, where the score is a member expiration time, and the key also have the same expiration. Both expiration values needs to be in sync, to achieve this I am using transaction:
This scenario works perfectly and I have my member added to the set, and the whole set has an expiry added. using
redis-cli monitor
command I can see expected traffic:problem I'd like to make sure that my whole set does not expire prematurely if a member with ealier expiration time is added. I'd like to keep the larger expiration value, so I decided to use
ExpireWhen.GreaterThanCurrentExpiry
.however this operation throws
StackExchange.Redis.RedisServerException: EXECABORT Transaction discarded because of previous errors.
The
redis-cli monitor
shows an empty transaction was submitted:I do not understand why this code is failing to produce a proper sequence of commands. Is there a reason why this scenario is not supported, or I am doing something wrong here?
expected result I'd expect to have a valid transaction submitted but with extra flag 'GT' added to
PEXPIREAT
, since it seems to be supported by the command: https://redis.io/commands/pexpireat/