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

Fix cluster info sent stats for message with light header (#1563) #1571

Open
wants to merge 1 commit into
base: 8.0
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3773,7 +3773,7 @@ void clusterSendMessage(clusterLink *link, clusterMsgSendBlock *msgblock) {
server.stat_cluster_links_memory += sizeof(listNode);

/* Populate sent messages stats. */
uint16_t type = ntohs(msgblock->msg.type);
uint16_t type = ntohs(msgblock->msg.type) & ~CLUSTERMSG_MODIFIER_MASK;
if (type < CLUSTERMSG_TYPE_COUNT) server.cluster->stats_bus_messages_sent[type]++;
}

Expand Down
14 changes: 13 additions & 1 deletion tests/unit/cluster/pubsub.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,17 @@ test "Test publishing to master" {
test "Test publishing to slave" {
test_cluster_publish 5 10
}

} ;# start_cluster

start_cluster 3 0 {tags {external:skip cluster}} {
test "Test cluster info stats for publish" {
R 0 PUBLISH hello world
assert_equal 2 [CI 0 cluster_stats_messages_publish_sent]
wait_for_condition 50 100 {
[CI 1 cluster_stats_messages_publish_received] eq 1 &&
[CI 2 cluster_stats_messages_publish_received] eq 1
} else {
fail "node 2 or node 3 didn't receive clusterbus publish packet"
}
}
}
Loading