Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature]support xpipe appiler crdt.zincrby and crdt.counter #168

Merged
merged 2 commits into from
Jun 24, 2024
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
5 changes: 4 additions & 1 deletion CRDT-RELEASENOTES
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ 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.21 Released Mon Apr 1 08:26:47 CST 2024

================================================================================
XRedis-CRDT 1.0.22 Released Sun Jun 23 10:32:40 AM CST 2024
* [feature] crdt.zincrby, crdt.counter add protocol attributes (data results) to support migration of crdt data to ordinary redis
================================================================================
* [hotfix] Fixed the problem of returning an error when the time is a negative number in the setex command
================================================================================
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.21"
#define XREDIS_CRDT_VERSION "1.0.22"
#define CONFIG_DEFAULT_SLAVE_REPLICATE_ALL 0

void xslaveofCommand(client *c);
Expand Down
Binary file modified tests/assets/linux/crdt.so
Binary file not shown.
41 changes: 41 additions & 0 deletions tests/ctrip/unit/xpipe_appiler.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

start_server { tags {"repl"} config {crdt.conf} overrides {crdt-gid 1} module {crdt.so}} {
set gid 1
test {test incr command} {
# set repl [attach_to_replication_stream]
set repl [attach_to_crdt_replication_stream $gid [srv 0 host] [srv 0 port]]
r incr foo
r incrby foo 2
r incrbyfloat foo 1.5
r incrbyfloat foo 2.5
r incrbyfloat foo 3.1415926
assert_replication_stream $repl {
{crdt.select 1 9}
{crdt.counter foo 1 * * * * 1}
{crdt.counter foo 1 * * * * 3}
{crdt.counter foo 1 * * * * 4.5}
{crdt.counter foo 1 * * * * 7}
{crdt.counter foo 1 * * * * 10.1415926}
}
close_replication_stream $repl
}

test {test zincr command} {
# set repl [attach_to_replication_stream]
set repl [attach_to_crdt_replication_stream $gid [srv 0 host] [srv 0 port]]
r zadd zset INCR 1 foo
r zincrby zset 2 foo
r zincrby zset 1.5 foo
r zadd zset INCR 2.5 foo
r zincrby zset 3.1415926 foo
assert_replication_stream $repl {
{crdt.select 1 9}
{crdt.zincrby zset 1 * * foo * 1}
{crdt.zincrby zset 1 * * foo * 3}
{crdt.zincrby zset 1 * * foo * 4.5}
{crdt.zincrby zset 1 * * foo * 7}
{crdt.zincrby zset 1 * * foo * 10.141592599999999}
}
close_replication_stream $repl
}
}
1 change: 1 addition & 0 deletions tests/test_crdt.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set ::ci_failed_tests {
ctrip/unit/merge_different_type
}
set ::all_tests {
ctrip/unit/xpipe_appiler
ctrip/integration/bug/hash-datamiss
ctrip/unit/delay_expire
ctrip/unit/offline_peer
Expand Down
Loading