Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
66420: ui: disallow imports from cluster-ui sources r=koorosh a=koorosh

Db Console depends on local `cluster-ui` package that and it was possible to specify
imports to its modules as a paths to source modules or use exported `index` file which
is an entry point for bundled module.
`cluster-ui` package has to be built before imports in Db Console because it has its
own dependencies and build process which isn't compatible with build process of Db Console.
To prevent incorrect imports, this change adds es lint rule to prohibit any imports from
`@cockroachlabs/cluster-ui/src/*` path.

Release note: none

66539: roachprod: avoid extra dead event in roachprod monitor r=erikgrinaker a=tbg

Prior to this commit, we'd get an extra dead event when restarting a
node:

```
// initially running
1: 5762
// issue roachprod stop
1: dead (exit status 137)
// issue roachprod start
1: dead (exit status 0)
1: 6254
```

This would in turn upset roachtest's `monitor`, as it keeps track of
the number of expected death events, and cause bogus test failures.

This was introduced in #66414 and is fixed in this commit.

As a small extra fix, if we don't observe the exit status of the
stopped systemd unit (i.e. if the process cycles rapidly), we now
correctly print that we don't know the exit status, where previously
we would print the "exit" status of the new running incarnation, i.e.
likely zero.

I tested this manually by exacerbating the sleeps in the shell snippet:

```
1: 10885
1: dead (exit status unknown)
1: 11220
```

I also verfied that repeated restarts produce the expected events in
general, i.e. one dead event following one pid event.

Closes #66522
Closes #66528

Release note: None


66540: backupccl: add setting to write files in SQL r=dt a=dt

This adds a setting -- default off -- to force BACKUP to always ask
KV to return files to SQL to write instead of writing them directly.
This is currently what it does for tenants but not for the system
tenant due to the extra network hop, data copy, cpu and mem overhead.

Release note: none.

66542: build: set ROACHPROD_USER in weekly roachtest script r=tbg a=rickystewart

This was lost in 6651a08.

Release note: None

Co-authored-by: Andrii Vorobiov <[email protected]>
Co-authored-by: Tobias Grieger <[email protected]>
Co-authored-by: David Taylor <[email protected]>
Co-authored-by: Ricky Stewart <[email protected]>
  • Loading branch information
5 people committed Jun 16, 2021
5 parents 1b3b128 + 65d03ab + b0c459d + 8aae3c9 + 0e17774 commit 04e974c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
1 change: 1 addition & 0 deletions build/teamcity-weekly-roachtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set -euo pipefail
google_credentials="$GOOGLE_EPHEMERAL_CREDENTIALS"
source "$(dirname "${0}")/teamcity-support.sh"
log_into_gcloud
export ROACHPROD_USER=teamcity

set -x

Expand Down
8 changes: 7 additions & 1 deletion pkg/ccl/backupccl/backup_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ var (
time.Minute*5,
settings.NonNegativeDuration,
)
alwaysWriteInProc = settings.RegisterBoolSetting(
"bulkio.backup.proxy_file_writes.enabled",
"return files to the backup coordination processes to write to "+
"external storage instead of writing them directly from the storage layer",
false,
)
)

const backupProcessorName = "backupDataProcessor"
Expand Down Expand Up @@ -201,7 +207,7 @@ func runBackupProcessor(
exportRequestStoreByLocalityKV := storageConfByLocalityKV

// If this is a tenant backup, we need to write the file from the SQL layer.
writeSSTsInProcessor := !flowCtx.Cfg.Codec.ForSystemTenant()
writeSSTsInProcessor := !flowCtx.Cfg.Codec.ForSystemTenant() || alwaysWriteInProc.Get(&clusterSettings.SV)

var defaultStore cloud.ExternalStorage
if writeSSTsInProcessor {
Expand Down
27 changes: 22 additions & 5 deletions pkg/cmd/roachprod/install/cluster_synced.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,22 +366,39 @@ if [ ! -f "{{.Store}}/CURRENT" ]; then
fi
{{- end}}
lastpid=""
# Init with -1 so that when cockroach is initially dead, we print
# a dead event for it.
lastpid=-1
while :; do
{{ if .Local }}
pid=$(lsof -i :{{.Port}} -sTCP:LISTEN | awk '!/COMMAND/ {print $2}')
pid=${pid:-0} # default to 0
status=unknown
status="unknown"
{{- else }}
# When CRDB is not running, this is zero.
pid=$(systemctl show cockroach --property MainPID --value)
status=$(systemctl show cockroach --property ExecMainStatus --value)
{{- end }}
if [[ "${lastpid}" == -1 && "${pid}" != 0 ]]; then
# On the first iteration through the loop, if the process is running,
# don't register a PID change (which would trigger an erroneous dead
# event).
lastpid=0
fi
# Output a dead event whenever the PID changes from a nonzero value to
# any other value. In particular, we emit a dead event when the node stops
# (lastpid is nonzero, pid is zero), but not when the process then starts
# again (lastpid is zero, pid is nonzero).
if [ "${pid}" != "${lastpid}" ]; then
# Output a dead event on every PID change, except if initial PID is live.
if [[ ! ("${lastpid}" == "" && "${pid}" != 0) ]]; then
if [ "${lastpid}" != 0 ]; then
if [ "${pid}" != 0 ]; then
# If the PID changed but neither is zero, then the status refers to
# the new incarnation. We lost the actual exit status of the old PID.
status="unknown"
fi
echo "dead (exit status ${status})"
fi
fi
if [ "${pid}" != 0 ]; then
echo "${pid}"
fi
Expand Down
5 changes: 4 additions & 1 deletion pkg/ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"react/no-unescaped-entities": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-explicit-any": "off",
"no-restricted-imports": ["error", {
"patterns": ["@cockroachlabs/cluster-ui/src/*"]
}]
}
}

0 comments on commit 04e974c

Please sign in to comment.