Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/commands/append.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/blmove.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"LIST"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/blmpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"get_keys_function": "blmpopGetKeys",
"command_flags": [
"WRITE",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"LIST"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/blpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
],
"command_flags": [
"WRITE",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"LIST"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/brpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
],
"command_flags": [
"WRITE",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"LIST"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/brpoplpush.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"LIST"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/bzmpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"get_keys_function": "blmpopGetKeys",
"command_flags": [
"WRITE",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"SORTEDSET"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/bzpopmax.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"command_flags": [
"WRITE",
"FAST",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"SORTEDSET"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/bzpopmin.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"command_flags": [
"WRITE",
"FAST",
"BLOCKING"
"BLOCKING",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"SORTEDSET"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/expire.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"KEYSPACE"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/expireat.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"KEYSPACE"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/getdel.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"function": "getdelCommand",
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/getex.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"function": "getexCommand",
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/getset.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/hexpire.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"history": [],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"HASH"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/hgetdel.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"history": [],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"HASH"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/hgetex.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"history": [],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"HASH"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/hincrby.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"HASH"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/hincrbyfloat.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"HASH"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/hpexpire.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"history": [],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"HASH"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/hsetex.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"HASH"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/incrbyfloat.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"command_flags": [
"WRITE",
"DENYOOM",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/pexpire.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"KEYSPACE"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/psetex.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"command_flags": [
"WRITE",
"DENYOOM"
"DENYOOM",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/setex.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"command_flags": [
"WRITE",
"DENYOOM"
"DENYOOM",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/setrange.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"function": "setrangeCommand",
"command_flags": [
"WRITE",
"DENYOOM"
"DENYOOM",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"STRING"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/spop.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
],
"command_flags": [
"WRITE",
"FAST"
"FAST",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"SET"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/zmpop.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"function": "zmpopCommand",
"get_keys_function": "zmpopGetKeys",
"command_flags": [
"WRITE"
"WRITE",
"GTID_NON_DETERMINISM"
],
"acl_categories": [
"SORTEDSET"
Expand Down
8 changes: 7 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,12 @@ static int updateMaxmemory(const char **err) {
return 1;
}

static int updateGtidXsyncMaxGap(const char **err) {;
UNUSED(err);
gtidGaplogResetDataSize(server.gtid_gap_log, server.gtid_xsync_max_gap);
return 1;
}

#ifdef ENABLE_SWAP
static int updateSwapAbsentCacheCapacity(const char **err) {
if (server.swap_absent_cache_capacity) {
Expand Down Expand Up @@ -3819,7 +3825,7 @@ standardConfig static_configs[] = {
createULongLongConfig("swap-swap-info-slave-period", NULL, MODIFIABLE_CONFIG, 1, 3600*24, server.swap_swap_info_slave_period, 60, INTEGER_CONFIG, NULL, NULL),
#endif

createULongLongConfig("gtid-xsync-max-gap", NULL, MODIFIABLE_CONFIG, 0, ULLONG_MAX, server.gtid_xsync_max_gap, 10000, INTEGER_CONFIG, NULL, NULL),
createULongLongConfig("gtid-xsync-max-gap", NULL, MODIFIABLE_CONFIG, 0, ULLONG_MAX, server.gtid_xsync_max_gap, 10000, INTEGER_CONFIG, NULL, updateGtidXsyncMaxGap),

/* Size_t configs */
createSizeTConfig("hash-max-listpack-entries", "hash-max-ziplist-entries", MODIFIABLE_CONFIG, 0, LONG_MAX, server.hash_max_listpack_entries, 512, INTEGER_CONFIG, NULL, NULL),
Expand Down
3 changes: 3 additions & 0 deletions src/ctrip_swap_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,9 @@ int getKeyRequestsGtid(int dbid, struct redisCommand *cmd, robj **argv,
orig_num = result->num;

exec_cmd = lookupCommandByCString(argv[start_index]->ptr);
if (exec_cmd == NULL) return C_ERR;

if (!commandCheckArity(exec_cmd, argc - start_index, NULL)) return C_ERR;
if (_getSingleCmdKeyRequests(exec_dbid,exec_cmd,argv+start_index,
argc-start_index,result)) return C_ERR;

Expand Down
14 changes: 7 additions & 7 deletions src/ctrip_swap_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
#include <stdlib.h>

/* swap datatype flags*/
#define CMD_SWAP_DATATYPE_KEYSPACE (1ULL<<40)
#define CMD_SWAP_DATATYPE_STRING (1ULL<<41)
#define CMD_SWAP_DATATYPE_HASH (1ULL<<42)
#define CMD_SWAP_DATATYPE_SET (1ULL<<43)
#define CMD_SWAP_DATATYPE_ZSET (1ULL<<44)
#define CMD_SWAP_DATATYPE_LIST (1ULL<<45)
#define CMD_SWAP_DATATYPE_BITMAP (1ULL<<46)
#define CMD_SWAP_DATATYPE_KEYSPACE (1ULL<<31)
#define CMD_SWAP_DATATYPE_STRING (1ULL<<32)
#define CMD_SWAP_DATATYPE_HASH (1ULL<<33)
#define CMD_SWAP_DATATYPE_SET (1ULL<<34)
#define CMD_SWAP_DATATYPE_ZSET (1ULL<<35)
#define CMD_SWAP_DATATYPE_LIST (1ULL<<36)
#define CMD_SWAP_DATATYPE_BITMAP (1ULL<<37)

/* CHECK: CLIENT_REPL_RDBONLY is the last CLIENT_xx flag */
#define CLIENT_SWAPPING (1ULL<<53) /* The client is waiting swap. */
Expand Down
1 change: 1 addition & 0 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ int64_t commandFlagsFromString(char *s) {
else if (!strcasecmp(t,"no-mandatory-keys")) flags |= CMD_NO_MANDATORY_KEYS;
else if (!strcasecmp(t,"allow-busy")) flags |= CMD_ALLOW_BUSY;
else if (!strcasecmp(t, "internal")) flags |= (CMD_INTERNAL|CMD_NOSCRIPT); /* We also disallow internal commands in scripts. */
else if (!strcasecmp(t,"rewrite-command")) flags |= CMD_GTID_NON_DETERMINISM;
else break;
}
sdsfreesplitres(tokens,count);
Expand Down
3 changes: 2 additions & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -3014,7 +3014,7 @@ void initServer(void) {
server.gtid_lost = gtidSetNew();
xsyncUuidInterestedInit();
gtidInitialInfoInit(server.gtid_initial);
server.gtid_gap_log = gtidGaplogNew();
server.gtid_gap_log = gtidGaplogNew(server.gtid_xsync_max_gap);
server.gtid_xsync_fullresync_indicator = 0;
server.gtid_executed_cmd_count = 0;
server.gtid_ignored_cmd_count = 0;
Expand Down Expand Up @@ -5297,6 +5297,7 @@ void addReplyFlagsForCommand(client *c, struct redisCommand *cmd) {
{CMD_MOVABLE_KEYS, "movablekeys"},
{CMD_ALLOW_BUSY, "allow_busy"},
/* {CMD_TOUCHES_ARBITRARY_KEYS, "TOUCHES_ARBITRARY_KEYS"}, Hidden on purpose */
{CMD_GTID_NON_DETERMINISM, "rewrite_command"},
{0,NULL}
};
addReplyCommandFlags(c, cmd->flags, flagNames);
Expand Down
1 change: 1 addition & 0 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ extern int configOOMScoreAdjValuesDefaults[CONFIG_OOM_COUNT];
#define CMD_MODULE_GETCHANNELS (1ULL<<27) /* Use the modules getchannels interface. */
#define CMD_TOUCHES_ARBITRARY_KEYS (1ULL<<28)
#define CMD_INTERNAL (1ULL<<29) /* Internal command. */
#define CMD_GTID_NON_DETERMINISM (1ULL<<30)

/* Command flags that describe ACLs categories. */
#define ACL_CATEGORY_KEYSPACE (1ULL<<0)
Expand Down
4 changes: 2 additions & 2 deletions tests/gtid/aof.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ test "aof" {
r expire k2 1000
r set k3 y ex 1000
r set k4 y
r gtid A:1 9 expire k4 200000000000
r gtid A:1 9 PEXPIREAT k4 200000000000
r set k5 y
set config [srv 0 config]
set dir [dict get $config dir]
Expand All @@ -155,7 +155,7 @@ test "aof" {
{gtid * 9 PEXPIREAT k2 *}
{gtid * 9 SET k3 y PXAT *}
{gtid * 9 set k4 y}
{gtid A:1 9 PEXPIREAT k4 *}
{gtid * 9 PEXPIREAT k4 *}
{gtid * 9 set k5 y}
}
}
Expand Down
Loading
Loading