diff --git a/CRDT-RELEASENOTES b/CRDT-RELEASENOTES index 77a37e15c..8cdc5cfbf 100644 --- a/CRDT-RELEASENOTES +++ b/CRDT-RELEASENOTES @@ -9,6 +9,16 @@ MODERATE: Program an upgrade of the server, but it's not urgent. HIGH: There is a critical bug that may affect a subset of users. Upgrade! CRITICAL: There is a critical bug affecting MOST USERS. Upgrade ASAP. -------------------------------------------------------------------------------- +================================================================================ +XRedis-CRDT 1.0.4 Released Tue Jun 9 15:58:31 CST 2020 +================================================================================ +Upgrade urgency LOW: Compared with the previous version, there are some improvements, mainly: +Major things: +* fix free crdtServer backlog bug when slave turning into master +* speed up set, mset and hset command +* added namespace attribute to limit the scope of peer replication +* add module memory statistics + ================================================================================ XRedis-CRDT 1.0.3 Released Tue Jun 9 15:58:31 CST 2020 ================================================================================ diff --git a/package.sh b/package.sh index 92dfc146b..dc8eb847e 100755 --- a/package.sh +++ b/package.sh @@ -1,5 +1,5 @@ APP=xredis-crdt -Version=1.0.3 +Version=1.0.4 Package=$APP-$Version find . -name ctrip.h -exec sed -i "s/XREDIS_CRDT_VERSION \"\(.*\)\"/XREDIS_CRDT_VERSION \"$Version\"/" {} \; diff --git a/src/ctrip.h b/src/ctrip.h index 0985c7414..d30baa92a 100644 --- a/src/ctrip.h +++ b/src/ctrip.h @@ -8,7 +8,7 @@ #ifndef SRC_CTRIP_H_ #define SRC_CTRIP_H_ -#define XREDIS_CRDT_VERSION "1.0.3" +#define XREDIS_CRDT_VERSION "1.0.4" #define CONFIG_DEFAULT_SLAVE_REPLICATE_ALL 0 void xslaveofCommand(client *c); diff --git a/src/server.c b/src/server.c index 5d7f3e10f..1ba49dbb0 100644 --- a/src/server.c +++ b/src/server.c @@ -294,7 +294,7 @@ struct redisCommand redisCommandTable[] = { // {"evalsha",evalShaCommand,-3,"s",0,evalGetKeys,0,0,0,0,0}, {"slowlog",slowlogCommand,-2,"a",0,NULL,0,0,0,0,0}, // {"script",scriptCommand,-2,"s",0,NULL,0,0,0,0,0}, -// {"time",timeCommand,1,"RF",0,NULL,0,0,0,0,0}, + {"time",timeCommand,1,"RF",0,NULL,0,0,0,0,0}, // {"bitop",bitopCommand,-4,"wm",0,NULL,2,-1,1,0,0}, // {"bitcount",bitcountCommand,-2,"r",0,NULL,1,1,1,0,0}, // {"bitpos",bitposCommand,-3,"r",0,NULL,1,1,1,0,0}, diff --git a/tests/ctrip/basic/basic_crdt_type.tcl b/tests/ctrip/basic/basic_crdt_type.tcl index 46280b001..4b7a1b8b1 100644 --- a/tests/ctrip/basic/basic_crdt_type.tcl +++ b/tests/ctrip/basic/basic_crdt_type.tcl @@ -778,6 +778,7 @@ proc basic_test { type create check delete} { wait [lindex $peers 1] 0 crdt.info [lindex $peer_stdouts 0] wait [lindex $peers 0] 0 crdt.info [lindex $peer_stdouts 1] + after 1000 run [replace [replace_client $check {[lindex $peers 2]}] $argv2] 1 } test [format "%s-before-del" $type] { diff --git a/tests/ctrip/basic/basic_crdt_type_del.tcl b/tests/ctrip/basic/basic_crdt_type_del.tcl index c9500b6a9..558bc69cf 100644 --- a/tests/ctrip/basic/basic_crdt_type_del.tcl +++ b/tests/ctrip/basic/basic_crdt_type_del.tcl @@ -88,7 +88,7 @@ proc basic_test { type create check delete} { run [replace [replace_client $check {[lindex $peers 0]}] $add1] 1 set delete1 {key field {} 1 100000 {"1:12;2:11"} } [lindex $peers 0] del key - after 500 + after 1000 run [replace [replace_client $check {[lindex $peers 1]}] $delete1] 1 run [replace [replace_client $create {[lindex $peers 1]}] $add1] 1 run [replace [replace_client $check {[lindex $peers 1]}] $delete1] 1 diff --git a/tests/ctrip/basic/basic_type.tcl b/tests/ctrip/basic/basic_type.tcl index 954a90ac3..fe9f0a80f 100644 --- a/tests/ctrip/basic/basic_type.tcl +++ b/tests/ctrip/basic/basic_type.tcl @@ -82,12 +82,12 @@ proc basic_test { type create check delete} { wait [lindex $peers 0] 0 crdt.info test [format "%s-peerof-create" $type] { run [replace [replace_client $create {[lindex $peers 0]}] $argv] 1 - after 500 + after 1000 run [replace [replace_client $check {[lindex $peers 1]}] $argv] 1 } test [format "%s-peerof-del" $type] { run [replace [replace_client $delete {[lindex $peers 0]}] $argv] 1 - after 500 + after 1000 set result {key, field, {}} run [replace [replace_client $check {[lindex $peers 1]}] $result] 1 } diff --git a/tests/ctrip/master-not-crdt/crdt_replid_reuse.tcl b/tests/ctrip/master-not-crdt/crdt_replid_reuse.tcl index 8a3d54b64..ac5b4506d 100644 --- a/tests/ctrip/master-not-crdt/crdt_replid_reuse.tcl +++ b/tests/ctrip/master-not-crdt/crdt_replid_reuse.tcl @@ -97,7 +97,7 @@ start_redis [list overrides [list repl-diskless-sync-delay 1 ]] { [lindex $slave 1] slaveof [lindex $slave_hosts 0] [lindex $slave_ports 0] wait [lindex $slave 0] 0 info [lindex $slave_stdouts 1] [lindex $slave 0] slaveof no one - after 1000 + after 2000 assert_equal [get_info_replication_attr_value [lindex $slave 0] crdt.info master_replid] [get_info_replication_attr_value [lindex $slave 1] crdt.info master_replid] assert_equal [get_info_replication_attr_value [lindex $slave 0] crdt.info master_replid2] [get_info_replication_attr_value [lindex $slave 1] crdt.info master_replid2] #print_log_file [lindex $slave_stdouts 1] diff --git a/tests/ctrip/unit/crdt_command.tcl b/tests/ctrip/unit/crdt_command.tcl index 41db923b2..c1e5b9ce9 100644 --- a/tests/ctrip/unit/crdt_command.tcl +++ b/tests/ctrip/unit/crdt_command.tcl @@ -124,8 +124,8 @@ start_server {tags {"crdt-command"} overrides {crdt-gid 1} config {crdt.conf} mo test "hgetall" { test "hgetall a" { r hset a b c d e - r hgetall a - } {b c d e} + lsort [r hgetall a] + } [lsort {b c d e}] test "hgetall b" { r hgetall b } {} @@ -139,8 +139,8 @@ start_server {tags {"crdt-command"} overrides {crdt-gid 1} config {crdt.conf} mo test "hkeys" { test "hkeys a" { r hset a b c d e - r hkeys a - } {b d} + lsort [r hkeys a] + } [lsort {b d}] test "hkeys b" { r hkeys b } {} @@ -154,8 +154,8 @@ start_server {tags {"crdt-command"} overrides {crdt-gid 1} config {crdt.conf} mo test "hvals" { test "hvals a" { r hset a b c d e - r hvals a - } {c e} + lsort [r hvals a] + } [lsort {c e}] test "hvals b" { r hvals b } {} diff --git a/tests/ctrip/unit/module_memory.tcl b/tests/ctrip/unit/module_memory.tcl index 2e979f194..665019eb3 100644 --- a/tests/ctrip/unit/module_memory.tcl +++ b/tests/ctrip/unit/module_memory.tcl @@ -88,9 +88,12 @@ start_server {tags {"repl"} config {crdt.conf} overrides {crdt-gid 1 repl-diskle [lindex $peers 0] config set repl-diskless-sync-delay 1 test "kv" { set m [get_module_all_memory [lindex $peers 0]] + set before_dataset [get_dataset [lindex $peers 0]] [lindex $peers 0] set k v set m1 [get_module_all_memory [lindex $peers 0]] assert {$m1 > 0} + puts [[lindex $peers 0] crdt.memory] + puts [expr [get_dataset [lindex $peers 0]] - $before_dataset] [lindex $peers 0] crdt.set k v1 2 [clock milliseconds] 2:1 set m2 [get_module_all_memory [lindex $peers 0]] assert {$m2 > $m1} diff --git a/tests/test_crdt.tcl b/tests/test_crdt.tcl index 5955c503b..67dbb0261 100644 --- a/tests/test_crdt.tcl +++ b/tests/test_crdt.tcl @@ -44,7 +44,6 @@ set ::all_tests { ctrip/unit/aof ctrip/unit/expire - ctrip/basic/basic_crdt_type_del ctrip/integration/composite/master-slave-failover ctrip/unit/crdt_publish ctrip/integration/master-slave/rdb3