Conversation
[ADD] logs
| % Redis explicitly say our slot mapping is incorrect, we need to refresh | ||
| % it | ||
| {error, <<"MOVED ", _/binary>>} -> | ||
| logger:error("eredis_cluster:handle_transaction_result <--> {error, MOVED} Result = ~",[Result]), |
There was a problem hiding this comment.
I think there is an issue here? ~p
Fixes adrienmo#28 and obsoletes PR adrienmo#29. Retry is implemented for query, but not for query_noreply. Perhaps it should.
Fixes adrienmo#28 and obsoletes PR adrienmo#29. Retry is implemented for query, but not for query_noreply. Perhaps it should.
Fixes adrienmo#28 and obsoletes PR adrienmo#29. Retry is implemented for query, but not for query_noreply. Perhaps it should.
Fixes adrienmo#28 and obsoletes PR adrienmo#29. Retry is implemented for query, but not for query_noreply. Perhaps it should.
| query(full, _Commands) -> | ||
| {error, retry}; |
There was a problem hiding this comment.
Actually, eredis_cluster is using poolboy:transaction/2 which is using poolboy:checkout/3 with Block = true. Checkout can only return full when Block =:= false. Therefore, if the pool is full, the transaction fun never gets called so this PR just adds dead code.
Instead, when the pool doesn't have workers available, we get an exit:{timeout, {gen_server, call, _}} exception from poolboy:transaction/2. This is turned into {error, no_connection} by the try-catch in eredis_cluster_pool and then it triggers a refesh mappings and then a retry in eredis_cluster.
Refresh mappings isn't necessary in this case. A retry without refresh mappings would suffice. We have done it in the Nordix fork.
FIX #28 and added logs