Skip to content

Commit 44b4fa9

Browse files
committed
fix qa failures caused by libvalkey migration
1 parent 11f3fb0 commit 44b4fa9

25 files changed

+900
-789
lines changed

qa/1543.out

Lines changed: 551 additions & 551 deletions
Large diffs are not rendered by default.

qa/1602

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ _filter_key_server_err()
5959
{
6060
sed \
6161
-e 's;ERR syntax error;expected error;' \
62-
-e 's;Parse command error.*;expected error;'
62+
-e 's;Failed to find keys of command.*;expected error;' \
63+
-e 's;Unknown command.*;expected error;' \
64+
-e 's;Command parse error;expected error;'
6365
}
6466

6567
_stop_auto_restart pmproxy

qa/1727

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,35 @@ fi
9696

9797
echo; echo === /metrics webapi listing. The instname label should appear only once.
9898
curl -Gs 'http://localhost:44322/metrics?names=openmetrics.duplicate_instname_label.somemetric' \
99-
| _filter_openmetrics_labels
99+
| _filter_openmetrics_labels \
100+
| awk '{
101+
if (match($0, /\{[^}]+\}/)) {
102+
prefix = substr($0, 1, RSTART-1)
103+
labels_str = substr($0, RSTART+1, RLENGTH-2)
104+
suffix = substr($0, RSTART+RLENGTH)
105+
106+
split("", labels)
107+
n = split(labels_str, pairs, ",")
108+
for (i = 1; i <= n; i++) {
109+
split(pairs[i], kv, "=")
110+
labels[kv[1]] = kv[2]
111+
}
112+
113+
order = "script agent hostname instid instname domainname machineid source"
114+
split(order, keys, " ")
115+
result = ""
116+
for (i = 1; i <= 8; i++) {
117+
key = keys[i]
118+
if (key in labels) {
119+
if (result != "") result = result ","
120+
result = result key "=" labels[key]
121+
}
122+
}
123+
print prefix "{" result "}" suffix
124+
} else {
125+
print
126+
}
127+
}'
100128

101129
echo; echo === verify metric name validity using pminfo
102130
pminfo -v openmetrics

qa/1890

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,45 @@ _filter_opentelemetry_labels()
5656
# end
5757
}
5858

59+
_reorder_labels()
60+
{
61+
awk '
62+
/^[^#].*{.*=.*}/ {
63+
match($0, /^([^{]+){([^}]+)}(.*)$/, a)
64+
metric = a[1]
65+
labels_str = a[2]
66+
rest = a[3]
67+
68+
delete labels
69+
n = split(labels_str, pairs, ",")
70+
for (i = 1; i <= n; i++) {
71+
match(pairs[i], /^([^=]+)=(.+)$/, kv)
72+
key = kv[1]
73+
value = kv[2]
74+
labels[key] = value
75+
}
76+
77+
order = "url agent hostname domainname machineid source my_sum_attribute"
78+
split(order, order_arr, " ")
79+
80+
output = metric "{"
81+
first = 1
82+
for (i = 1; i <= length(order_arr); i++) {
83+
key = order_arr[i]
84+
if (key in labels) {
85+
if (!first) output = output ","
86+
output = output key "=" labels[key]
87+
first = 0
88+
}
89+
}
90+
output = output "}" rest
91+
print output
92+
next
93+
}
94+
{print}
95+
'
96+
}
97+
5998
need_restore=true
6099
_prepare_pmda opentelemetry
61100
trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -83,7 +122,7 @@ fi
83122

84123
echo; echo === /metrics webapi listing. The instname label should appear only once.
85124
curl -Gs 'http://localhost:44322/metrics?names=opentelemetry.duplicate.somemetric' \
86-
| _filter_opentelemetry_labels
125+
| _filter_opentelemetry_labels | _reorder_labels
87126

88127
echo; echo === verify metric name validity using pminfo
89128
pminfo -v opentelemetry

qa/1900.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Check bpf metrics have appeared ... X metrics and X values
1111
== Running pmdabpf with valgrind
1212
=== std out ===
1313

14-
bpf.disk.all.latency PMID: 157.1.0 [Disk latency]
15-
Data Type: 64-bit unsigned int InDom: 157.3 0x27400003
14+
bpf.disk.all.latency PMID: 157.0.0 [Disk latency]
15+
Data Type: 64-bit unsigned int InDom: 157.2 0x27400002
1616
Semantics: counter Units: microsec
1717
Help:
1818
Disk latency histogram across all disks, for both reads and writes.
1919

20-
bpf.runq.latency PMID: 157.0.0 [Run queue latency (ns)]
21-
Data Type: 64-bit unsigned int InDom: 157.2 0x27400002
20+
bpf.runq.latency PMID: 157.1.0 [Run queue latency (ns)]
21+
Data Type: 64-bit unsigned int InDom: 157.3 0x27400003
2222
Semantics: counter Units: nanosec
2323
Help:
2424
Run queue latency from task switches,

qa/662.out

Lines changed: 73 additions & 73 deletions
Large diffs are not rendered by default.

src/libpcp_web/src/exports.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,5 @@ PCP_WEB_1.23 {
300300
dictGetKey;
301301
dictInitIterator;
302302
dictSetVal;
303+
keySlotsContextFree;
303304
} PCP_WEB_1.22;

src/libpcp_web/src/keys.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include <valkey/valkey.h>
3434
#include <valkey/async.h>
35+
#include <valkey/cluster.h>
3536

3637
#define RESP_OK VALKEY_OK
3738
#define RESP_ERR VALKEY_ERR
@@ -91,6 +92,9 @@
9192
#define keyClusterAsyncFormattedCommand valkeyClusterAsyncFormattedCommand
9293
#define keyClusterAsyncFormattedCommandToNode valkeyClusterAsyncFormattedCommandToNode
9394

95+
/* valkey cluster options */
96+
#define KEYOPT_BLOCKING_INITIAL_UPDATE VALKEY_OPT_BLOCKING_INITIAL_UPDATE
97+
9498
extern const char *resp_reply_type(respReply *);
9599
extern int keysAsyncEnableKeepAlive(keysAsyncContext *);
96100

src/libpcp_web/src/schema.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ key_map_publish(keyMapBaton *baton)
133133
sdsfree(msg);
134134
sdsfree(key);
135135

136-
keySlotsRequest(baton->slots, cmd, key_map_publish_callback, baton);
136+
keySlotsRequestFirstNode(baton->slots, cmd, key_map_publish_callback, baton);
137137
sdsfree(cmd);
138138
}
139139

0 commit comments

Comments
 (0)