【重要更新】MAAT Redis事务增加预备主版本号机制,以改善多写入性能,提高配置超时淘汰速度。

This commit is contained in:
zhengchao
2018-05-23 21:37:35 +08:00
parent bc8d7df7e0
commit 1cef03375a
3 changed files with 3 additions and 4 deletions

View File

@@ -796,9 +796,7 @@ long long _exec_serial_rule_begin(redisContext* ctx)
{ {
long long maat_redis_version=0; long long maat_redis_version=0;
redisReply* data_reply=NULL; redisReply* data_reply=NULL;
data_reply=_wrap_redisCommand(ctx, "WATCH MAAT_VERSION"); data_reply=_wrap_redisCommand(ctx, "INCRBY MAAT_PRE_VER 1");
freeReplyObject(data_reply);
data_reply=_wrap_redisCommand(ctx, "GET MAAT_VERSION");
maat_redis_version=read_redis_integer(data_reply); maat_redis_version=read_redis_integer(data_reply);
maat_redis_version++; maat_redis_version++;
freeReplyObject(data_reply); freeReplyObject(data_reply);

View File

@@ -30,7 +30,7 @@
#include "stream_fuzzy_hash.h" #include "stream_fuzzy_hash.h"
#include "gram_index_engine.h" #include "gram_index_engine.h"
int MAAT_FRAME_VERSION_2_1_20180518=1; int MAAT_FRAME_VERSION_2_1_20180523=1;
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
"unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""}; "unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""};

View File

@@ -5,5 +5,6 @@ echo "Reseting Redis For Maat..."
redis-cli -h $host -p $port GET MAAT_VERSION redis-cli -h $host -p $port GET MAAT_VERSION
redis-cli -h $host -p $port FLUSHALL redis-cli -h $host -p $port FLUSHALL
redis-cli -h $host -p $port SET MAAT_VERSION "0" redis-cli -h $host -p $port SET MAAT_VERSION "0"
redis-cli -h $host -p $port SET MAAT_PRE_VER "0"
redis-cli -h $host -p $port SET SEQUENCE_REGION "1" redis-cli -h $host -p $port SET SEQUENCE_REGION "1"
redis-cli -h $host -p $port SET SEQUENCE_GROUP "1" redis-cli -h $host -p $port SET SEQUENCE_GROUP "1"