-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Batches are executed out of order when using DNS connections #2752
Comments
@mgravell Can you fix it ? |
This is ... odd; short term, switching up to transactions will enforce single connection, but... this is odd; I'd have to investigate, which I can add to the list, but I can't guarantee a "today" thing |
As both theses lines are not awaited
There is no garantee of order. Just probability that line 1 would be executed earlier, but not garantee. Right ? Edit: didn't see it is about batch. My bad, my remark is irrelevant |
It is reasonable to expect this to occur in order; what is described is definitely not "working as intended", but it doesn't sound trivial - it will need some investigation |
@mgravell I sent you the account and password of the test instance environment via google mail. |
Backgroud
Our user told us that when they use batch on our cloud (AlibabaCloud), their commands came out of order. code is below
Ideally, they would get the following sequence:
But sometimes, the following sequence is produced:
Going a step further, we found that
UNLINK
andEXPIRE
are sent over one TCP connection, butHMSET
uses another TCP connection.Why are there two links? We found that when connecting through a domain name, there will be two links in
ConnectionMultiplexer#ServerSnapshot
(one is the domain name, and the other is the IP resolved by the domain name (obtained through cluster nodes)). Therefore, two links will be returned randomly inAnyServer
, causing commands to be assigned to different connections.How to reproduction
How to fix
During the initialization process, Lettuce will generate the result of the domain name as a URI, but will change the domain name to an alias. Please refer to redis/lettuce@16f9e75
Version
The text was updated successfully, but these errors were encountered: