redict/tests
Raghav Muddur 0367a80819
GETEX, GETDEL and SET PXAT/EXAT (#8327)
This commit introduces two new command and two options for an existing command

GETEX <key> [PERSIST][EX seconds][PX milliseconds] [EXAT seconds-timestamp]
[PXAT milliseconds-timestamp]

The getexCommand() function implements extended options and variants of the GET
command. Unlike GET command this command is not read-only. Only one of the options
can be used at a given time.

1. PERSIST removes any TTL associated with the key.
2. EX Set expiry TTL in seconds.
3. PX Set expiry TTL in milliseconds.
4. EXAT Same like EX instead of specifying the number of seconds representing the
    TTL (time to live), it takes an absolute Unix timestamp
5. PXAT Same like PX instead of specifying the number of milliseconds representing the
    TTL (time to live), it takes an absolute Unix timestamp

Command would return either the bulk string, error or nil.

GETDEL <key>
Would delete the key after getting.

SET key value [NX] [XX] [KEEPTTL] [GET] [EX <seconds>] [PX <milliseconds>]
[EXAT <seconds-timestamp>][PXAT <milliseconds-timestamp>]

Two new options added here are EXAT and PXAT

Key implementation notes
- `SET` with `PX/EX/EXAT/PXAT` is always translated to `PXAT` in `AOF`. When relative time is
  specified (`PX/EX`), replication will always use `PX`.
- `setexCommand` and `psetexCommand` would no longer need translation in `feedAppendOnlyFile`
  as they are modified to invoke `setGenericCommand ` with appropriate flags which will take care of
  correct AOF translation.
- `GETEX` without any optional argument behaves like `GET`.
- `GETEX` command is never propagated, It is either propagated as `PEXPIRE[AT], or PERSIST`.
- `GETDEL` command is propagated as `DEL`
- Combined the validation for `SET` and `GETEX` arguments. 
- Test cases to validate AOF/Replication propagation
2021-01-27 19:47:26 +02:00
..
assets Sanitize dump payload: ziplist, listpack, zipmap, intset, stream 2020-12-06 14:54:34 +02:00
cluster Optimize performance of clusterGenNodesDescription for large clusters (#8182) 2021-01-13 12:36:03 -08:00
helpers revert an accidental test code change done as part of the tls project 2019-12-01 16:10:09 +02:00
integration GETEX, GETDEL and SET PXAT/EXAT (#8327) 2021-01-27 19:47:26 +02:00
modules Fix recent test failures (#8386) 2021-01-23 21:53:58 +02:00
sentinel Sentinel: Fix Config Dependency and Rewrite Sequence (#8271) 2021-01-26 09:31:54 +02:00
support Add tests for RESP3 responce of ZINTER and ZRANGE (#8391) 2021-01-26 17:55:32 +02:00
tmp minor fixes to the new test suite, html doc updated 2010-05-14 18:48:33 +02:00
unit GETEX, GETDEL and SET PXAT/EXAT (#8327) 2021-01-27 19:47:26 +02:00
instances.tcl Sentinel: Fix Config Dependency and Rewrite Sequence (#8271) 2021-01-26 09:31:54 +02:00
test_helper.tcl Fix rare test failures due to repl-ping-replica-period (#8393) 2021-01-25 11:05:25 +02:00