Open sergeyshaykhullin opened 7 months ago
Hello, I am Blathers. I am here to help you get the issue triaged.
Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.
I was unable to automatically find someone to ping.
If we have not gotten back to your issue within a few business days, you can try the following:
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.
cc: @stevendanna
23.2.8 still has this problem
My suspicion is the problem is when we sum the disk stats for the ranges. These could easily verflow when the default int size is 4:
const rangesQuery = `
SELECT node_id AS id,
sum((metrics->>'replicas.leaders')::DECIMAL)::INT AS replicas_leaders,
sum((metrics->>'replicas.leaseholders')::DECIMAL)::INT AS replicas_leaseholders,
sum((metrics->>'replicas')::DECIMAL)::INT AS ranges,
sum((metrics->>'ranges.unavailable')::DECIMAL)::INT AS ranges_unavailable,
sum((metrics->>'ranges.underreplicated')::DECIMAL)::INT AS ranges_underreplicated
FROM crdb_internal.kv_store_status
GROUP BY node_id`
const statsQuery = `
SELECT node_id AS id,
sum((metrics->>'livebytes')::DECIMAL)::INT AS live_bytes,
sum((metrics->>'keybytes')::DECIMAL)::INT AS key_bytes,
sum((metrics->>'valbytes')::DECIMAL)::INT AS value_bytes,
sum(coalesce((metrics->>'rangekeybytes')::DECIMAL, 0))::INT AS range_key_bytes,
sum(coalesce((metrics->>'rangevalbytes')::DECIMAL, 0))::INT AS range_value_bytes,
sum((metrics->>'intentbytes')::DECIMAL)::INT AS intent_bytes,
sum((metrics->>'sysbytes')::DECIMAL)::INT AS system_bytes
FROM crdb_internal.kv_store_status
GROUP BY node_id`
We should probably explicitly casting these to larger types.
Describe the problem
cockroach node status reports integer out of range
To Reproduce
sql.defaults.default_int_size = 4
cockroach node status --all --insecure
Expected behavior Returns output
Additional data / screenshots
Environment:
cockroach sql
, JDBC, ...] cockroach CLIAdditional context What was the impact?
Add any other context about the problem here.
Jira issue: CRDB-35992