Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
87267: sql_test: skip TestInvertedIndexMergeEveryStateWrite under race r=ajwerner a=ajwerner

It takes over 5 minutes.
`--- PASS: TestInvertedIndexMergeEveryStateWrite (335.71s)`

Release justification: testing-only change

Epic: None

Release note: None

89232: acceptance: support running acceptance tests on ARM64 r=otan,rafiss a=healthy-pod

This code change makes it possible to run acceptance tests
on ARM64.

Release note: None
Epic: [CRDB-1463](https://cockroachlabs.atlassian.net/browse/CRDB-1463)

89557: sql,cli: add SHOW FUNCTIONS command and \df metacommand r=chengxiong-ruan a=rafiss

fixes #88597

Release note (sql change): Added the SHOW FUNCTIONS command, which lists
user-defined functions. The SHOW FUNCTIONS FROM <schema> syntax is
supported too.

Release note (cli change): The \df metacommand was added to the SQL
shell, which will list all user-defined functions in the current
database.

89623: kvserver/rangelog: extract a package, use KVs r=ajwerner a=ajwerner

This sequence of commits extracts the rangelog logic to a subpackage, refactors the ID generation logic for more
control, adds some testing data and infrastructure, and, finally, swaps out the underlying implementation to use
raw KVs.

Fixes #89164
Fixes #35293

Release note: None

89723: licenses: update licenses for 22.2 r=rail,jlinder a=celiala

This PR updates license files for the 22.2 release, which will be backported to release-22.2.0 and release.22.2.x.

This commit adds licenses for any new packages used in 22.2, using the following rules:
- For BSD licenses: the name of the copyright holder appears in the text of the license itself, so we've copied their BSD license into the `license/` folder
- For all other licenses: we are using the generic license text.

Notes:
- The update to the BSL license, which should not be backported to 22.2, will happen in a separate commit.

Epic: RE-237

Release justification: non-production code change (add licenses for 22.2).
Release note: None.

Co-authored-by: Andrew Werner <[email protected]>
Co-authored-by: healthy-pod <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Celia La <[email protected]>
  • Loading branch information
5 people committed Oct 11, 2022
6 parents 61e3d60 + 56907a8 + 60a19e4 + 0f1d2aa + 285e414 + 869f081 commit 2a9f158
Show file tree
Hide file tree
Showing 57 changed files with 1,799 additions and 129 deletions.
1 change: 1 addition & 0 deletions docs/generated/sql/bnf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ FILES = [
"show_default_privileges_stmt",
"show_enums",
"show_full_scans",
"show_functions_stmt",
"show_grants_stmt",
"show_indexes_stmt",
"show_jobs",
Expand Down
4 changes: 4 additions & 0 deletions docs/generated/sql/bnf/show_functions_stmt.bnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
show_functions_stmt ::=
'SHOW' 'FUNCTIONS' 'FROM' name '.' name
| 'SHOW' 'FUNCTIONS' 'FROM' name
| 'SHOW' 'FUNCTIONS'
1 change: 1 addition & 0 deletions docs/generated/sql/bnf/show_var.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ show_stmt ::=
| show_databases_stmt
| show_enums_stmt
| show_types_stmt
| show_functions_stmt
| show_grants_stmt
| show_indexes_stmt
| show_partitions_stmt
Expand Down
6 changes: 6 additions & 0 deletions docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ show_stmt ::=
| show_databases_stmt
| show_enums_stmt
| show_types_stmt
| show_functions_stmt
| show_grants_stmt
| show_indexes_stmt
| show_partitions_stmt
Expand Down Expand Up @@ -809,6 +810,11 @@ show_enums_stmt ::=
show_types_stmt ::=
'SHOW' 'TYPES'

show_functions_stmt ::=
'SHOW' 'FUNCTIONS' 'FROM' name '.' name
| 'SHOW' 'FUNCTIONS' 'FROM' name
| 'SHOW' 'FUNCTIONS'

show_grants_stmt ::=
'SHOW' 'GRANTS' opt_on_targets_roles for_grantee_clause
| 'SHOW' 'SYSTEM' 'GRANTS' for_grantee_clause
Expand Down
27 changes: 27 additions & 0 deletions licenses/BSD3-golang.org.x.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2009 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ ALL_TESTS = [
"//pkg/kv/kvserver/raftentry:raftentry_test",
"//pkg/kv/kvserver/raftutil:raftutil_test",
"//pkg/kv/kvserver/rangefeed:rangefeed_test",
"//pkg/kv/kvserver/rangelog:rangelog_test",
"//pkg/kv/kvserver/rditer:rditer_test",
"//pkg/kv/kvserver/replicastats:replicastats_test",
"//pkg/kv/kvserver/reports:reports_test",
Expand Down Expand Up @@ -1182,6 +1183,11 @@ GO_TARGETS = [
"//pkg/kv/kvserver/raftutil:raftutil_test",
"//pkg/kv/kvserver/rangefeed:rangefeed",
"//pkg/kv/kvserver/rangefeed:rangefeed_test",
"//pkg/kv/kvserver/rangelog/internal/genrangelogdatapb:genrangelogdatapb",
"//pkg/kv/kvserver/rangelog/internal/genrangelogdatapb:genrangelogdatapb_lib",
"//pkg/kv/kvserver/rangelog/internal/rangelogtestpb:rangelogtestpb",
"//pkg/kv/kvserver/rangelog:rangelog",
"//pkg/kv/kvserver/rangelog:rangelog_test",
"//pkg/kv/kvserver/rditer:rditer",
"//pkg/kv/kvserver/rditer:rditer_test",
"//pkg/kv/kvserver/readsummary/rspb:rspb",
Expand Down Expand Up @@ -2470,6 +2476,9 @@ GET_X_DATA_TARGETS = [
"//pkg/kv/kvserver/raftentry:get_x_data",
"//pkg/kv/kvserver/raftutil:get_x_data",
"//pkg/kv/kvserver/rangefeed:get_x_data",
"//pkg/kv/kvserver/rangelog:get_x_data",
"//pkg/kv/kvserver/rangelog/internal/genrangelogdatapb:get_x_data",
"//pkg/kv/kvserver/rangelog/internal/rangelogtestpb:get_x_data",
"//pkg/kv/kvserver/rditer:get_x_data",
"//pkg/kv/kvserver/readsummary:get_x_data",
"//pkg/kv/kvserver/readsummary/rspb:get_x_data",
Expand Down
4 changes: 2 additions & 2 deletions pkg/acceptance/compose/flyway/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: '3'
services:
cockroach:
image: ubuntu:xenial-20170214
image: ubuntu:xenial-20210804
command: /cockroach/cockroach start-single-node --insecure --listen-addr cockroach
volumes:
- ${COCKROACH_BINARY:-../../../../cockroach-linux-2.6.32-gnu-amd64}:/cockroach/cockroach
flyway:
depends_on:
- cockroach
image: flyway/flyway:6
image: flyway/flyway:9.3
volumes:
- ./sql:/sql
command: migrate -user=root -url=jdbc:postgresql://cockroach:26257/defaultdb -locations=filesystem:/sql
2 changes: 1 addition & 1 deletion pkg/acceptance/compose/gss/docker-compose-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
- ./kdc/start.sh:/start.sh
- keytab:/keytab
cockroach:
image: ubuntu:xenial-20170214
image: ubuntu:xenial-20210804
depends_on:
- kdc
command: /cockroach/cockroach --certs-dir=/certs start-single-node --listen-addr cockroach
Expand Down
2 changes: 1 addition & 1 deletion pkg/acceptance/compose/gss/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
- ./kdc/start.sh:/start.sh
- keytab:/keytab
cockroach:
image: ubuntu:xenial-20170214
image: ubuntu:xenial-20210804
depends_on:
- kdc
command: /cockroach/cockroach --certs-dir=/certs start-single-node --listen-addr cockroach
Expand Down
17 changes: 13 additions & 4 deletions pkg/acceptance/compose/gss/psql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ RUN apt-get update && \

COPY --from=builder /workspace/gss.test .

RUN curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-amd64.tar.gz" -o autouseradd.tar.gz \
&& echo "442dae58b727a79f81368127fac141d7f95501ffa05f8c48943d27c4e807deb7 autouseradd.tar.gz" | sha256sum -c - \
&& tar xzf autouseradd.tar.gz --strip-components 1 \
&& rm autouseradd.tar.gz
# This Dockerfile is only used by docker-compose and built on-demand on the same architecture so it is safe
# to assume the target arch based on the host arch.
RUN ARCH=`uname -m`; \
if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then \
curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-arm64.tar.gz" -o autouseradd.tar.gz && \
SHASUM=b216bebfbe30c3c156144cff07233654e23025e26ab5827058c9b284e130599e; \
else \
curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-amd64.tar.gz" -o autouseradd.tar.gz && \
SHASUM=442dae58b727a79f81368127fac141d7f95501ffa05f8c48943d27c4e807deb7; \
fi; \
echo "$SHASUM autouseradd.tar.gz" | sha256sum -c -; \
tar xzf autouseradd.tar.gz --strip-components 1; \
rm autouseradd.tar.gz;

ENTRYPOINT ["autouseradd", "--user", "roach", "--no-create-home", "/start.sh"]
17 changes: 13 additions & 4 deletions pkg/acceptance/compose/gss/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-k
krb5-user \
postgresql-client-11

RUN curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-amd64.tar.gz" -o autouseradd.tar.gz \
&& echo "442dae58b727a79f81368127fac141d7f95501ffa05f8c48943d27c4e807deb7 autouseradd.tar.gz" | sha256sum -c - \
&& tar xzf autouseradd.tar.gz --strip-components 1 \
&& rm autouseradd.tar.gz
# This Dockerfile is only used by docker-compose and built on-demand on the same architecture so it is safe
# to assume the target arch based on the host arch.
RUN ARCH=`uname -m`; \
if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then \
curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-arm64.tar.gz" -o autouseradd.tar.gz && \
SHASUM=b216bebfbe30c3c156144cff07233654e23025e26ab5827058c9b284e130599e; \
else \
curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-amd64.tar.gz" -o autouseradd.tar.gz && \
SHASUM=442dae58b727a79f81368127fac141d7f95501ffa05f8c48943d27c4e807deb7; \
fi; \
echo "$SHASUM autouseradd.tar.gz" | sha256sum -c -; \
tar xzf autouseradd.tar.gz --strip-components 1; \
rm autouseradd.tar.gz;

RUN mkdir /code
WORKDIR /code
Expand Down
39 changes: 17 additions & 22 deletions pkg/acceptance/testdata/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:18.04
ARG TARGETPLATFORM

# This Dockerfile bundles several language runtimes and test frameworks into one
# container for our acceptance tests.
Expand Down Expand Up @@ -28,23 +29,14 @@ FROM ubuntu:18.04
RUN apt-get update \
&& apt-get install --yes --no-install-recommends ca-certificates curl

# The forward reference version is the oldest version from which we support
# upgrading. The bidirectional reference version is the oldest version that we
# support upgrading from and downgrading to.
ENV FORWARD_REFERENCE_VERSION="v2.0.0"
ENV BIDIRECTIONAL_REFERENCE_VERSION="v2.0.0"
RUN mkdir /opt/forward-reference-version /opt/bidirectional-reference-version \
&& curl -fsSL https://binaries.cockroachdb.com/cockroach-${FORWARD_REFERENCE_VERSION}.linux-amd64.tgz \
| tar xz -C /opt/forward-reference-version --strip-components=1 \
&& curl -fsSL https://binaries.cockroachdb.com/cockroach-${BIDIRECTIONAL_REFERENCE_VERSION}.linux-amd64.tgz \
| tar xz -C /opt/bidirectional-reference-version --strip-components=1

RUN apt-get install --yes --no-install-recommends openjdk-8-jdk \
&& curl -fsSL https://github.com/cockroachdb/finagle-postgres/archive/94b1325270.tar.gz | tar xz \
&& cd finagle-postgres-* \
&& ./sbt assembly \
&& mv target/scala-2.11/finagle-postgres-tests.jar /opt/finagle-postgres-tests.jar \
&& rm -rf /finagle-postgres-* ~/.ivy2
RUN case ${TARGETPLATFORM} in \
"linux/amd64") URL=https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-6.0.401-linux-x64.tar.gz ;; \
"linux/arm64") URL=https://download.visualstudio.microsoft.com/download/pr/a567a07f-af9d-451a-834c-a746ac299e6b/1d9d74b54cf580f93cad71a6bf7b32be/dotnet-sdk-6.0.401-linux-arm64.tar.gz ;; \
esac \
&& curl -sL -o dotnet.tar.gz $URL \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet

RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg > /etc/apt/trusted.gpg.d/yarn.asc \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
Expand All @@ -54,10 +46,7 @@ RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg > /etc/apt/trusted.gpg.d
&& curl https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb > erlang-solutions_2.0_all.deb && dpkg -i erlang-solutions_2.0_all.deb \
&& apt-get update \
&& apt-get install --yes --no-install-recommends \
dotnet-sdk-2.1 \
dotnet-runtime-2.1 \
expect \
elixir \
esl-erlang \
libc6-dev \
libcurl4 \
Expand All @@ -78,8 +67,14 @@ RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg > /etc/apt/trusted.gpg.d
xmlstarlet \
yarn

RUN curl -fsSL https://github.com/benesch/autouseradd/releases/download/1.0.0/autouseradd-1.0.0-amd64.tar.gz \
| tar xz -C /usr --strip-components 1
RUN case ${TARGETPLATFORM} in \
"linux/amd64") ARCH=amd64; SHASUM=442dae58b727a79f81368127fac141d7f95501ffa05f8c48943d27c4e807deb7 ;; \
"linux/arm64") ARCH=arm64; SHASUM=b216bebfbe30c3c156144cff07233654e23025e26ab5827058c9b284e130599e ;; \
esac \
&& curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-$ARCH.tar.gz" -o autouseradd.tar.gz \
&& echo "$SHASUM autouseradd.tar.gz" | sha256sum -c - \
&& tar xzf autouseradd.tar.gz --strip-components 1 \
&& rm autouseradd.tar.gz

# When system packages are not available for a language's PostgreSQL driver,
# fall back to using that language's package manager. The high-level process
Expand Down
2 changes: 1 addition & 1 deletion pkg/acceptance/util_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func testDockerSuccess(ctx context.Context, t *testing.T, name string, cmd []str
const (
// Iterating against a locally built version of the docker image can be done
// by changing acceptanceImage to the hash of the container.
acceptanceImage = "docker.io/cockroachdb/acceptance:20200303-091324"
acceptanceImage = "docker.io/cockroachdb/acceptance:20221005-223354"
)

func testDocker(
Expand Down
6 changes: 3 additions & 3 deletions pkg/bench/rttanalysis/testdata/benchmark_expectations
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ exp,benchmark
12,AlterTableDropConstraint/alter_table_drop_1_check_constraint
12,AlterTableDropConstraint/alter_table_drop_2_check_constraints
12,AlterTableDropConstraint/alter_table_drop_3_check_constraints
10,AlterTableSplit/alter_table_split_at_1_value
15,AlterTableSplit/alter_table_split_at_2_values
20,AlterTableSplit/alter_table_split_at_3_values
9,AlterTableSplit/alter_table_split_at_1_value
13,AlterTableSplit/alter_table_split_at_2_values
17,AlterTableSplit/alter_table_split_at_3_values
7,AlterTableUnsplit/alter_table_unsplit_at_1_value
9,AlterTableUnsplit/alter_table_unsplit_at_2_values
11,AlterTableUnsplit/alter_table_unsplit_at_3_values
Expand Down
3 changes: 2 additions & 1 deletion pkg/ccl/backupccl/file_sst_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,5 +376,6 @@ func (s *fileSSTSink) copyRangeKeys(dataSST []byte) error {
func generateUniqueSSTName(nodeID base.SQLInstanceID) string {
// The data/ prefix, including a /, is intended to group SSTs in most of the
// common file/bucket browse UIs.
return fmt.Sprintf("data/%d.sst", builtins.GenerateUniqueInt(nodeID))
return fmt.Sprintf("data/%d.sst",
builtins.GenerateUniqueInt(builtins.ProcessUniqueID(nodeID)))
}
3 changes: 1 addition & 2 deletions pkg/ccl/changefeedccl/sink_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"hash/fnv"
"strings"

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeedbase"
"github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/kvevent"
"github.com/cockroachdb/cockroach/pkg/sql/sem/builtins"
Expand Down Expand Up @@ -182,7 +181,7 @@ func (s *sqlSink) emit(
// Generate the message id on the client to match the guaranttees of kafka
// (two messages are only guaranteed to keep their order if emitted from the
// same producer to the same partition).
messageID := builtins.GenerateUniqueInt(base.SQLInstanceID(partition))
messageID := builtins.GenerateUniqueInt(builtins.ProcessUniqueID(partition))
s.rowBuf = append(s.rowBuf, topic, partition, messageID, key, value, resolved)
if len(s.rowBuf)/sqlSinkEmitCols >= sqlSinkRowBatchSize {
return s.Flush(ctx)
Expand Down
5 changes: 5 additions & 0 deletions pkg/cli/clisqlshell/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Informational
\du [USER] list the specified user, or list the users for all databases if no user is specified.
\d [TABLE] show details about columns in the specified table, or alias for '\dt' if no table is specified.
\dd TABLE show details about constraints on the specified table.
\df show the functions that are defined in the current database.
Formatting
\x [on|off] toggle records display format.
Expand Down Expand Up @@ -1293,6 +1294,10 @@ func (c *cliState) doHandleCliCmd(loopState, nextState cliStateEnum) cliStateEnu
c.concatLines = `SHOW TABLES`
return cliRunStatement

case `\df`:
c.concatLines = `SHOW FUNCTIONS`
return cliRunStatement

case `\copy`:
c.exitErr = c.runWithInterruptableCtx(func(ctx context.Context) error {
// Strip out the starting \ in \copy.
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/clisqlshell/sql_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func TestHandleCliCmdSqlAlias(t *testing.T) {
{`\du myuser`, `SELECT * FROM [SHOW USERS] WHERE username = 'myuser'`},
{`\d mytable`, `SHOW COLUMNS FROM mytable`},
{`\d`, `SHOW TABLES`},
{`\df`, `SHOW FUNCTIONS`},
}

for _, tt := range clientSideCommandTestsTable {
Expand Down
1 change: 1 addition & 0 deletions pkg/gen/bnf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ BNF_SRCS = [
"//docs/generated/sql/bnf:show_default_privileges_stmt.bnf",
"//docs/generated/sql/bnf:show_enums.bnf",
"//docs/generated/sql/bnf:show_full_scans.bnf",
"//docs/generated/sql/bnf:show_functions_stmt.bnf",
"//docs/generated/sql/bnf:show_grants_stmt.bnf",
"//docs/generated/sql/bnf:show_indexes_stmt.bnf",
"//docs/generated/sql/bnf:show_jobs.bnf",
Expand Down
1 change: 1 addition & 0 deletions pkg/gen/diagrams.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ DIAGRAMS_SRCS = [
"//docs/generated/sql/bnf:show_default_privileges.html",
"//docs/generated/sql/bnf:show_enums.html",
"//docs/generated/sql/bnf:show_full_scans.html",
"//docs/generated/sql/bnf:show_functions.html",
"//docs/generated/sql/bnf:show_grants.html",
"//docs/generated/sql/bnf:show_indexes.html",
"//docs/generated/sql/bnf:show_jobs.html",
Expand Down
1 change: 1 addition & 0 deletions pkg/gen/docs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ DOCS_SRCS = [
"//docs/generated/sql/bnf:show_default_privileges_stmt.bnf",
"//docs/generated/sql/bnf:show_enums.bnf",
"//docs/generated/sql/bnf:show_full_scans.bnf",
"//docs/generated/sql/bnf:show_functions_stmt.bnf",
"//docs/generated/sql/bnf:show_grants_stmt.bnf",
"//docs/generated/sql/bnf:show_indexes_stmt.bnf",
"//docs/generated/sql/bnf:show_jobs.bnf",
Expand Down
1 change: 1 addition & 0 deletions pkg/gen/protobuf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ PROTOBUF_SRCS = [
"//pkg/kv/kvserver/loqrecovery/loqrecoverypb:loqrecoverypb_go_proto",
"//pkg/kv/kvserver/protectedts/ptpb:ptpb_go_proto",
"//pkg/kv/kvserver/protectedts/ptstorage:ptstorage_go_proto",
"//pkg/kv/kvserver/rangelog/internal/rangelogtestpb:rangelogtestpb_go_proto",
"//pkg/kv/kvserver/readsummary/rspb:rspb_go_proto",
"//pkg/kv/kvserver:kvserver_go_proto",
"//pkg/obsservice/obspb/opentelemetry-proto/common/v1:v1_go_proto",
Expand Down
4 changes: 3 additions & 1 deletion pkg/jobs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ func (r *Registry) makeCtx() (context.Context, func()) {

// MakeJobID generates a new job ID.
func (r *Registry) MakeJobID() jobspb.JobID {
return jobspb.JobID(builtins.GenerateUniqueInt(r.nodeID.SQLInstanceID()))
return jobspb.JobID(builtins.GenerateUniqueInt(
builtins.ProcessUniqueID(r.nodeID.SQLInstanceID()),
))
}

// newJob creates a new Job.
Expand Down
Loading

0 comments on commit 2a9f158

Please sign in to comment.