Bump redis-rs + Route Function Stats to all nodes#2117
Bump redis-rs + Route Function Stats to all nodes#2117shohamazon merged 9 commits intovalkey-io:mainfrom
Conversation
There was a problem hiding this comment.
First of all - why should we have different response policy between standalone and cluster mode?
Second - this whole change shouldn't be under value conversion, but under standalone_client.rs::send_request_to_all_nodes. We already have response policy that matches this case if we decide to aggregate the responses: FirstSucceededNonEmptyOrAllEmpty.
But we should decide whats our approach here and we probably would like to keep unified experience over standalone and cluster mode. Is it possible in standalone that a script will run both on the primary and on a replica? or on multiple replicas? seems to me like we're going to loose information if we'll do this aggregation
| Some(ResponsePolicy::Special) => { | ||
| // Await all futures and collect results | ||
| let results = future::try_join_all(requests).await?; | ||
| let map_entries = self |
There was a problem hiding this comment.
rename map_entries to a more informative name
ae4394b to
e9645bd
Compare
Yury-Fridlyand
left a comment
There was a problem hiding this comment.
Please update routing info for FUNCTION KILL in all clients
| @pytest.mark.parametrize("cluster_mode", [False, True]) | ||
| @pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3]) | ||
| async def test_function_stats_cluster(self, glide_client: GlideClusterClient): | ||
| async def test_function_stats_running_script( |
There was a problem hiding this comment.
<3
Is it possible to do the same test in node and java?
I can help you with java part if needed.
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Andrew Carbonetto <andrew.carbonetto@improving.com> Signed-off-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Signed-off-by: Shoham Elias <shohame@amazon.com>
Since we've modified the FUNCTION STATS command to return responses from all nodes (instead of only from primaries), the response structure for standalone setups will change. Instead of returning a single response from a random node, it will now return a map of responses, where each key is the node's address and the value is the same node's response. Even in standalone mode.
Reason for the Change:
The main reason for this change is that a function or script could be running on a replica, and the previous FUNCTION STATS command wouldn't detect it, resulting in an incomplete response.
amazon-contributing/redis-rs#181