valkey/tests/modules
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
..
auth.c Fixed some documentation 2019-12-17 07:49:21 +00:00
blockedclient.c Handle output buffer limits for Module blocked clients (#8141) 2020-12-08 16:41:20 +02:00
blockonkeys.c Fix memory corruption in moduleHandleBlockedClients 2020-04-01 12:53:26 +03:00
commandfilter.c Make module tests pass with valgrind, and fix a leak in diskless load 2019-10-24 09:45:25 +03:00
datatype.c Add module data-type support for COPY. (#8112) 2020-12-09 20:22:45 +02:00
defragtest.c Modules: add defrag API support. (#8149) 2020-12-13 09:56:01 +02:00
fork.c Moved RMAPI_FUNC_SUPPORTED location such that it will be visible to modules (#8037) 2020-11-09 10:46:23 +02:00
getkeys.c Modules: fix RM_GetCommandKeys API. (#7901) 2020-10-11 18:10:55 +03:00
hooks.c Add Module API for version and compatibility checks (#7865) 2020-10-11 17:21:58 +03:00
infotest.c Add RM_ServerInfoGetFieldUnsigned 2019-11-04 08:50:29 +02:00
keyspace_events.c Make sure we do not propagate nested MULTI/EXEC (#8097) 2020-12-06 13:14:18 +02:00
Makefile Several (mostly Solaris-related) cleanups (#8171) 2020-12-13 17:09:54 +02:00
misc.c Add Module API for version and compatibility checks (#7865) 2020-10-11 17:21:58 +03:00
propagate.c Remove read-only flag from non-keyspace cmds, different approach for EXEC to propagate MULTI (#8216) 2020-12-22 12:03:49 +02:00
scan.c Fix RM_ScanKey module api not to return int encoded strings 2020-06-14 11:20:15 +03:00
test_lazyfree.c Modules callbacks for lazy free effort, and unlink (#7912) 2020-11-16 10:34:04 +02:00
testrdb.c Add module event for repl-diskless-load swapdb (#8153) 2020-12-13 14:36:06 +02:00
timer.c Add timer module API tests. (#8041) 2020-11-11 22:57:33 +02:00