Fix timing issue in shards test and fix displayed TLS port (#10450)
This commit is contained in:
parent
fae5b1a19d
commit
557222d1e0
@ -4972,14 +4972,16 @@ void addNodeDetailsToShardReply(client *c, clusterNode *node) {
|
|||||||
addReplyBulkCBuffer(c, node->name, CLUSTER_NAMELEN);
|
addReplyBulkCBuffer(c, node->name, CLUSTER_NAMELEN);
|
||||||
reply_count++;
|
reply_count++;
|
||||||
|
|
||||||
int port = server.cluster_announce_port ? server.cluster_announce_port : server.port;
|
/* We use server.tls_cluster as a proxy for whether or not
|
||||||
if (port) {
|
* the remote port is the tls port or not */
|
||||||
|
int plaintext_port = server.tls_cluster ? node->pport : node->port;
|
||||||
|
int tls_port = server.tls_cluster ? node->port : 0;
|
||||||
|
if (plaintext_port) {
|
||||||
addReplyBulkCString(c, "port");
|
addReplyBulkCString(c, "port");
|
||||||
addReplyLongLong(c, node->port);
|
addReplyLongLong(c, plaintext_port);
|
||||||
reply_count++;
|
reply_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_port = server.cluster_announce_tls_port ? server.cluster_announce_tls_port : server.tls_port;
|
|
||||||
if (tls_port) {
|
if (tls_port) {
|
||||||
addReplyBulkCString(c, "tls-port");
|
addReplyBulkCString(c, "tls-port");
|
||||||
addReplyLongLong(c, tls_port);
|
addReplyLongLong(c, tls_port);
|
||||||
|
@ -131,7 +131,7 @@ test "Instance #0 gets converted into a replica" {
|
|||||||
test "Test the replica reports a loading state while it's loading" {
|
test "Test the replica reports a loading state while it's loading" {
|
||||||
# Test the command is good for verifying everything moves to a happy state
|
# Test the command is good for verifying everything moves to a happy state
|
||||||
set replica_cluster_id [R $replica_id CLUSTER MYID]
|
set replica_cluster_id [R $replica_id CLUSTER MYID]
|
||||||
wait_for_condition 50 100 {
|
wait_for_condition 50 1000 {
|
||||||
[dict get [get_node_info_from_shard $replica_cluster_id $primary_id "node"] health] eq "online"
|
[dict get [get_node_info_from_shard $replica_cluster_id $primary_id "node"] health] eq "online"
|
||||||
} else {
|
} else {
|
||||||
fail "Replica never transitioned to online"
|
fail "Replica never transitioned to online"
|
||||||
@ -165,7 +165,7 @@ test "Test the replica reports a loading state while it's loading" {
|
|||||||
R $primary_id exec
|
R $primary_id exec
|
||||||
|
|
||||||
# The replica should reconnect and start a full sync, it will gossip about it's health to the primary.
|
# The replica should reconnect and start a full sync, it will gossip about it's health to the primary.
|
||||||
wait_for_condition 50 100 {
|
wait_for_condition 50 1000 {
|
||||||
"loading" eq [dict get [get_node_info_from_shard $replica_cluster_id $primary_id "node"] health]
|
"loading" eq [dict get [get_node_info_from_shard $replica_cluster_id $primary_id "node"] health]
|
||||||
} else {
|
} else {
|
||||||
fail "Replica never transitioned to loading"
|
fail "Replica never transitioned to loading"
|
||||||
@ -174,7 +174,7 @@ test "Test the replica reports a loading state while it's loading" {
|
|||||||
# Speed up the key loading and verify everything resumes
|
# Speed up the key loading and verify everything resumes
|
||||||
R $replica_id config set key-load-delay 0
|
R $replica_id config set key-load-delay 0
|
||||||
|
|
||||||
wait_for_condition 50 100 {
|
wait_for_condition 50 1000 {
|
||||||
"online" eq [dict get [get_node_info_from_shard $replica_cluster_id $primary_id "node"] health]
|
"online" eq [dict get [get_node_info_from_shard $replica_cluster_id $primary_id "node"] health]
|
||||||
} else {
|
} else {
|
||||||
fail "Replica never transitioned to online"
|
fail "Replica never transitioned to online"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user