redict/tests/unit
Oran Agra 411c18bbce
Remove read-only flag from non-keyspace cmds, different approach for EXEC to propagate MULTI (#8216)
In the distant history there was only the read flag for commands, and whatever
command that didn't have the read flag was a write one.
Then we added the write flag, but some portions of the code still used !read
Also some commands that don't work on the keyspace at all, still have the read
flag.

Changes in this commit:
1. remove the read-only flag from TIME, ECHO, ROLE and LASTSAVE

2. EXEC command used to decides if it should propagate a MULTI by looking at
   the command flags (!read & !admin).
   When i was about to change it to look at the write flag instead, i realized
   that this would cause it not to propagate a MULTI for PUBLISH, EVAL, and
   SCRIPT, all 3 are not marked as either a read command or a write one (as
   they should), but all 3 are calling forceCommandPropagation.

   So instead of introducing a new flag to denote a command that "writes" but
   not into the keyspace, and still needs propagation, i decided to rely on
   the forceCommandPropagation, and just fix the code to propagate MULTI when
   needed rather than depending on the command flags at all.

   The implication of my change then is that now it won't decide to propagate
   MULTI when it sees one of these: SELECT, PING, INFO, COMMAND, TIME and
   other commands which are neither read nor write.

3. Changing getNodeByQuery and clusterRedirectBlockedClientIfNeeded in
   cluster.c to look at !write rather than read flag.
   This should have no implications, since these code paths are only reachable
   for commands which access keys, and these are always marked as either read
   or write.

This commit improve MULTI propagation tests, for modules and a bunch of
other special cases, all of which used to pass already before that commit.
the only one that test change that uncovered a change of behavior is the
one that DELs a non-existing key, it used to propagate an empty
multi-exec block, and no longer does.
2020-12-22 12:03:49 +02:00
..
moduleapi Remove read-only flag from non-keyspace cmds, different approach for EXEC to propagate MULTI (#8216) 2020-12-22 12:03:49 +02:00
type Minor improvements for list-2 test (#8156) 2020-12-08 16:26:38 +02:00
acl.tcl Fix ACL Pub/Sub test timings (#8122) 2020-12-02 17:24:27 +02:00
aofrw.tcl AOF: run tests with preamble off when it makes sense. 2018-03-25 13:03:38 +02:00
auth.tcl Handle binary safe string for REQUIREPASS and MASTERAUTH directives (#8200) 2020-12-17 09:26:33 -08:00
bitfield.tcl Fix BITFIELD_RO test. 2020-03-23 12:02:12 +01:00
bitops.tcl Regression test for #3282. 2016-06-15 11:49:49 +02:00
dump.tcl Test:Fix invalid cases in hash.tcl and dump.tcl (#4611) 2020-08-12 10:25:24 +08:00
expire.tcl fix broken PEXPIREAT test (#7791) 2020-09-13 13:50:23 +03:00
geo.tcl GEOSEARCH: change 'FROMLOC' to 'FROMLONLAT' (#8190) 2020-12-14 17:15:12 +02:00
hyperloglog.tcl Squash merging 125 typo/grammar/comment/doc PRs (#7773) 2020-09-10 13:43:38 +03:00
introspection-2.tcl EXISTS should not alter LRU, OBJECT should not reveal expired keys on replica (#8016) 2020-11-18 11:16:21 +02:00
introspection.tcl TLS: Add different client cert support. (#8076) 2020-12-11 18:31:40 +02:00
keyspace.tcl Improve dbid range check for SELECT, MOVE, COPY (#8085) 2020-12-01 21:41:26 +02:00
latency-monitor.tcl Add a --no-latency tests flag. (#7939) 2020-10-22 11:10:53 +03:00
lazyfree.tcl Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
limits.tcl TLS: Connections refactoring and TLS support. 2019-10-07 21:06:13 +03:00
maxmemory.tcl Improve stability of new CSC eviction test (#8160) 2020-12-08 16:33:09 +02:00
memefficiency.tcl Tests: fix new defrag test to be skipped when not supported (#8185) 2020-12-14 11:13:46 +02:00
multi.tcl Remove read-only flag from non-keyspace cmds, different approach for EXEC to propagate MULTI (#8216) 2020-12-22 12:03:49 +02:00
obuf-limits.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
oom-score-adj.tcl Tests: fix oom-score-adj false positives. (#7772) 2020-09-09 18:58:06 +03:00
other.tcl Limit the main db and expires dictionaries to expand (#7954) 2020-12-06 11:53:04 +02:00
pendingquerybuf.tcl Slave removal: remove slave from top-level tests descriptions. 2018-09-11 15:32:28 +02:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl TLS: Connections refactoring and TLS support. 2019-10-07 21:06:13 +03:00
pubsub.tcl pubsub: Return integers for NUMSUB, not strings 2014-08-08 11:19:37 +02:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
scan.tcl Implement SCAN cursor [TYPE type] modifier suggested in issue #6107. 2019-05-22 16:39:04 +01:00
scripting.tcl Unified MULTI, LUA, and RM_Call with respect to blocking commands (#8025) 2020-11-17 18:58:55 +02:00
shutdown.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
slowlog.tcl Rewritten commands are logged as their original command (#8006) 2020-11-10 13:50:03 -08:00
sort.tcl Config: Add quicklist, remove old list options 2015-01-02 11:16:10 -05:00
tls.tcl TLS: Add different client cert support. (#8076) 2020-12-11 18:31:40 +02:00
tracking.tcl Extend client tracking tests (#7998) 2020-11-09 22:54:47 +02:00
wait.tcl Tests: fix redis-cli with remote hosts. (#7693) 2020-08-23 10:17:43 +03:00