Skip to content

Commit 5669040

Browse files
craig[bot]annrpomrafissrail
committed
156970: ui: add store disk write bytes to storage dashboard r=annrpom a=annrpom This patch adds a metric for store disk write bytes in the Storage dashboard. Epic: none Informs: https://github.com/cockroachlabs/support/issues/3470 Release note: None <img width="720" height="308" alt="image" src="https://github.com/user-attachments/assets/94629b53-2dc7-4a42-8b68-85ddbd93d006" /> <img width="968" height="411" alt="image" src="https://github.com/user-attachments/assets/e7136191-8df7-4dcf-8150-815661395af1" /> <img width="968" height="407" alt="image" src="https://github.com/user-attachments/assets/3add06df-0f76-48c5-b467-aca2f9742869" /> <img width="975" height="414" alt="image" src="https://github.com/user-attachments/assets/0b6b5812-be09-4def-83e4-96ce57dd36de" /> 157072: sql: avoid buffering notice for upgrading to SERIALIZABLE r=rafiss a=rafiss This avoids flakiness in a test which expects the notice, but would sometimes not see it. informs #157069 informs #157068 informs #153543 informs #156686 informs #156638 informs #156513 Release note: None 157076: gceworker: use who instead of w, remove unison bootstrap r=rickystewart a=rail Previously, we used the w command to check for active sessions, but it stopped reporting TTYs in the output in Ubuntu 24.04. This change switches to the combination of who and ps to achieve the same goal. Upstream report: https://bugs.launchpad.net/ubuntu/+source/procps/+bug/2092307 Additionally, we no longer need to bootstrap Unison, because this workflow has been unreliable. Remove duplicated `gcloud` subcommand. Release note: none Epic: none Co-authored-by: Annie Pompa <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Rail Aliiev <[email protected]>
4 parents 4ed46b5 + 8971cd2 + 6a4f183 + 4897b8d commit 5669040

File tree

6 files changed

+76
-81
lines changed

6 files changed

+76
-81
lines changed

build/bootstrap/autoshutdown.cron.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,19 @@ active_exists() {
4949
[[ $age -lt $AUTO_SHUTDOWN_DURATION ]]
5050
}
5151

52-
if active_exists || w -hs | grep pts | grep -vq "pts/[0-9]* *tmux" || pgrep unison || pgrep -f remote-dev-server.sh; then
52+
active_session(){
53+
# Check for active sessions that are not tmux/screen/zellij sessions.
54+
# Example of who output:
55+
# rail_cockroachlabs_com pts/0 2025-11-07 18:10 (179.78.23.130)
56+
# rail_cockroachlabs_com pts/1 2025-11-07 18:13 (tmux(2747).%0)
57+
# rail_cockroachlabs_com pts/2 2025-11-07 18:13 (tmux(2747).%0)
58+
if who | grep "pts/" | grep -vqE '\((tmux|screen|zellij)\('; then
59+
return 0
60+
fi
61+
return 1
62+
}
63+
64+
if active_exists || active_session || pgrep -f remote-dev-server.sh; then
5365
# Auto-shutdown is disabled (via /.active) or there is a remote session.
5466
echo 0 > $FILE
5567
exit 0

build/bootstrap/bootstrap-debian.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ echo '4cb534c52cdd47a6223d4596d530e7c9c785438ab3b0a49ff347e991c210b2cd /tmp/baze
7070
chmod +x /tmp/bazelisk
7171
sudo mv /tmp/bazelisk /usr/bin/bazel
7272

73-
# Install the Unison file-syncer.
74-
. bootstrap/bootstrap-unison.sh
75-
7673
# Configure environment variables for CockroachDB
7774
echo 'export PATH="${PATH}:${HOME}/go/src/github.com/cockroachdb/cockroach/bin:/usr/local/go/bin"' >> ~/.bashrc_bootstrap
7875
echo >> ~/.bashrc

build/bootstrap/bootstrap-unison.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

pkg/sql/conn_executor_ddl.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ func (ex *connExecutor) maybeAdjustTxnForDDL(ctx context.Context, stmt Statement
8282
return err
8383
}
8484
ex.extraTxnState.upgradedToSerializable = true
85-
p.BufferClientNotice(ctx, pgnotice.Newf("setting transaction isolation level to SERIALIZABLE due to schema change"))
85+
if err := p.SendClientNotice(
86+
ctx,
87+
pgnotice.Newf("setting transaction isolation level to SERIALIZABLE due to schema change"),
88+
false, /* immediateFlush */
89+
); err != nil {
90+
return err
91+
}
8692
} else {
8793
return txnSchemaChangeErr
8894
}

pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,5 +466,55 @@ export default function (props: GraphDashboardProps) {
466466
)}
467467
</Axis>
468468
</LineGraph>,
469+
470+
<LineGraph
471+
title="Store Disk Write Bytes/s"
472+
sources={storeSources}
473+
isKvGraph={true}
474+
tenantSource={tenantSource}
475+
tooltip={
476+
<div>
477+
The number of bytes written to the store's disk per second{" "}
478+
{tooltipSelection} (as reported by the OS).
479+
</div>
480+
}
481+
showMetricsInTooltip={true}
482+
>
483+
<Axis units={AxisUnits.Bytes} label="bytes">
484+
{storeMetrics(
485+
{
486+
name: "cr.store.storage.disk.write.bytes",
487+
nonNegativeRate: true,
488+
},
489+
nodeIDs,
490+
storeIDsByNodeID,
491+
)}
492+
</Axis>
493+
</LineGraph>,
494+
495+
<LineGraph
496+
title="Store Disk Read Bytes/s"
497+
sources={storeSources}
498+
isKvGraph={true}
499+
tenantSource={tenantSource}
500+
tooltip={
501+
<div>
502+
The number of bytes read from the store's disk per second{" "}
503+
{tooltipSelection} (as reported by the OS).
504+
</div>
505+
}
506+
showMetricsInTooltip={true}
507+
>
508+
<Axis units={AxisUnits.Bytes} label="bytes">
509+
{storeMetrics(
510+
{
511+
name: "cr.store.storage.disk.read.bytes",
512+
nonNegativeRate: true,
513+
},
514+
nodeIDs,
515+
storeIDsByNodeID,
516+
)}
517+
</Axis>
518+
</LineGraph>,
469519
];
470520
}

scripts/gceworker.sh

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ create)
9898
echo "Using dev license key from \$COCKROACH_DEV_LICENSE"
9999
else
100100
echo -n "Enter your dev license key (if any): "
101-
read COCKROACH_DEV_LICENSE
101+
read -r COCKROACH_DEV_LICENSE
102102
fi
103103

104104
gsuite_account_for_label="$(
@@ -163,7 +163,7 @@ start)
163163
echo "Set GCEWORKER_START_SSH_COMMAND=mosh to use mosh instead"
164164
fi
165165
echo "****************************************"
166-
$0 ${GCEWORKER_START_SSH_COMMAND-ssh}
166+
$0 "${GCEWORKER_START_SSH_COMMAND-ssh}"
167167
;;
168168
stop)
169169
read -r -p "This will stop the VM. Are you sure? [yes] " response
@@ -221,9 +221,6 @@ ssh)
221221
mosh)
222222
mosh --ssh "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" "$(user_domain_suffix)@${FQNAME}"
223223
;;
224-
gcloud)
225-
gcloud "$@"
226-
;;
227224
get)
228225
rpath="${1}"
229226
# Check whether we have an absolute path like /foo, ~foo, or ~/foo.
@@ -253,56 +250,15 @@ put)
253250
gcloud compute scp --recurse "${lpaths[@]}" "${to}"
254251
;;
255252
ip)
256-
echo "$(get_ip)"
257-
;;
258-
sync)
259-
if ! hash unison 2>/dev/null; then
260-
echo 'unison not found (on macOS, run `brew install unison`)' >&2
261-
exit 1
262-
fi
263-
if ! hash unison-fsmonitor 2>/dev/null; then
264-
echo 'unison-fsmonitor not installed (on macOS, run `brew install eugenmayer/dockersync/unox`)'
265-
exit 1
266-
fi
267-
if (($# == 0)); then
268-
host=. # Sync the Cockroach repo by default.
269-
worker=go/src/github.com/cockroachdb/cockroach
270-
elif (($# == 2)); then
271-
host=$1
272-
worker=$2
273-
else
274-
echo "usage: $0 mount [HOST-PATH WORKER-PATH]" >&2
275-
exit 1
276-
fi
277-
read -p "Warning: sync will overwrite files on the GCE worker with your local copy. Continue? (Y/n) "
278-
if [[ "$REPLY" && "$REPLY" != [Yy] ]]; then
279-
exit 1
280-
fi
281-
tmpfile=$(mktemp)
282-
trap 'rm -f ${tmpfile}' EXIT
283-
unison "$host" "ssh://${NAME}.${CLOUDSDK_COMPUTE_ZONE}.${CLOUDSDK_CORE_PROJECT}/$worker" \
284-
-sshargs "-F ${tmpfile}" -auto -prefer "$host" -repeat watch \
285-
-ignore 'Path .localcluster.certs*' \
286-
-ignore 'Path .git' \
287-
-ignore 'Path _bazel*' \
288-
-ignore 'Path bazel-out*' \
289-
-ignore 'Path bin*' \
290-
-ignore 'Path build/builder_home' \
291-
-ignore 'Path pkg/sql/parser/gen' \
292-
-ignore 'Path pkg/ui/node_modules' \
293-
-ignore 'Path pkg/ui/.cache-loader' \
294-
-ignore 'Path cockroach-data' \
295-
-ignore 'Name *.d' \
296-
-ignore 'Name *.o' \
297-
-ignore 'Name zcgo_flags*.go'
253+
get_ip
298254
;;
299255
vscode)
300256
start_and_wait "${NAME}"
301-
HOST=$(gcloud_compute_ssh --dry-run ${NAME} | awk '{print $NF}')
302-
code --wait --remote ssh-remote+$HOST "$@"
257+
HOST="$(gcloud_compute_ssh --dry-run "$NAME" | awk '{print $NF}')"
258+
code --wait --remote ssh-remote+"$HOST" "$@"
303259
;;
304260
status)
305-
gcloud compute instances describe ${NAME} --format="table(name,status,lastStartTimestamp,lastStopTimestamp)"
261+
gcloud compute instances describe "$NAME" --format="table(name,status,lastStartTimestamp,lastStopTimestamp)"
306262
;;
307263
update-hosts)
308264
NEW_IP="$(get_ip)"

0 commit comments

Comments
 (0)