Skip to content

Commit

Permalink
Merge pull request #66 from ctripcorp/update/version
Browse files Browse the repository at this point in the history
Update/version
  • Loading branch information
qiongtubao authored Jul 3, 2020
2 parents 16aefa7 + dcf78c1 commit 78f3b47
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 14 deletions.
10 changes: 10 additions & 0 deletions CRDT-RELEASENOTES
Original file line number Diff line number Diff line change
Expand Up @@ -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
================================================================================
Expand Down
2 changes: 1 addition & 1 deletion package.sh
Original file line number Diff line number Diff line change
@@ -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\"/" {} \;
Expand Down
2 changes: 1 addition & 1 deletion src/ctrip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
1 change: 1 addition & 0 deletions tests/ctrip/basic/basic_crdt_type.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down
2 changes: 1 addition & 1 deletion tests/ctrip/basic/basic_crdt_type_del.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/ctrip/basic/basic_type.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ctrip/master-not-crdt/crdt_replid_reuse.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions tests/ctrip/unit/crdt_command.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
} {}
Expand All @@ -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
} {}
Expand All @@ -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
} {}
Expand Down
3 changes: 3 additions & 0 deletions tests/ctrip/unit/module_memory.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 0 additions & 1 deletion tests/test_crdt.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 78f3b47

Please sign in to comment.