Skip to content

Commit

Permalink
roachtest: Cast snapshot-recd bytes to decimal in disagg-rebalance
Browse files Browse the repository at this point in the history
Previously we were reading a float value as an int, which
would trip up the Scan() method if the float value was
large enough to be wired over in scientified notation eg.
`2.3456E7`. This change ensures that Cockroach prints
out the value as a numeric/decimal to avoid the scan-time
error in the roachtest.

Fixes #109114.

Epic: none

Release note: None
  • Loading branch information
itsbilal committed Aug 21, 2023
1 parent 2ac44e6 commit 3eebffb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/tests/disagg_rebalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func registerDisaggRebalance(r registry.Registry) {
}
var bytesSnapshotted int64
if err := db.QueryRow(
"SELECT metrics['range.snapshots.rcvd-bytes'] FROM crdb_internal.kv_store_status WHERE node_id = $1 LIMIT 1",
"SELECT metrics['range.snapshots.rcvd-bytes']::DECIMAL FROM crdb_internal.kv_store_status WHERE node_id = $1 LIMIT 1",
4,
).Scan(&bytesSnapshotted); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 3eebffb

Please sign in to comment.