summaryrefslogtreecommitdiff
path: root/tests/instances.tcl
diff options
context:
space:
mode:
authorEran Liberty <eran.liberty@gmail.com>2020-09-09 09:35:42 +0300
committerGitHub <noreply@github.com>2020-09-09 09:35:42 +0300
commitb120366d48d9e488a406965773e64f29ba2946f7 (patch)
tree0a116b2fa63f6637a244ec7e7c5c16db18e9cfdf /tests/instances.tcl
parent340963b2d7f5bd5fc999e3a8e6311c51420ba76c (diff)
downloadredis-b120366d48d9e488a406965773e64f29ba2946f7.tar.gz
Allow exec with read commands on readonly replica in cluster (#7766)
There was a bug. Although cluster replicas would allow read commands, they would not allow a MULTI-EXEC that's composed solely of read commands. Adds tests for coverage. Co-authored-by: Oran Agra <oran@redislabs.com> Co-authored-by: Eran Liberty <eranl@amazon.com>
Diffstat (limited to 'tests/instances.tcl')
-rw-r--r--tests/instances.tcl10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/instances.tcl b/tests/instances.tcl
index 82c35854b..2199cfcd4 100644
--- a/tests/instances.tcl
+++ b/tests/instances.tcl
@@ -422,10 +422,16 @@ proc S {n args} {
[dict get $s link] {*}$args
}
+# Returns a Redis instance by index.
+# Example:
+# [Rn 0] info
+proc Rn {n} {
+ return [dict get [lindex $::redis_instances $n] link]
+}
+
# Like R but to chat with Redis instances.
proc R {n args} {
- set r [lindex $::redis_instances $n]
- [dict get $r link] {*}$args
+ [Rn $n] {*}$args
}
proc get_info_field {info field} {