Commits (4)
  • Rohan Yadav's avatar
    sql: fix bug where show create could show partitions of dropped indexes · 6c883091
    Rohan Yadav authored
    Release note (bug fix): Fix a bug where the `SHOW CREATE` statement
    would sometimes show a partitioning step for an index that has been
  • Bob Vawter's avatar
    build/packer: Update TeamCity agent disk image · bdce5731
    Bob Vawter authored
    Several of the upstream packages that our TeamCity builder image depends on
    have been removed or obsoleted. Specifically, Oracle Java 8 is no longer
    available to download and has been replaced by OpenJDK 11. The golang backport
    has been upgraded to a modern version as well.
    The golang update necessitates changing a few invocation of the go tool to
    unset the GOFLAGS environment variable provided by TeamCity that globally
    enables json output.
    I have verified that this new image passes the tests on a fork of the "GitHub
    CI" suite.
    The base disk image size has been increased to 256Gb.  A subsequent change will
    be made to the image to enable LRU deletion of Docker images, which have been
    contributing to disk-space exhaustion.
    Release note: None
  • Rohan Yadav's avatar
    Merge pull request #48767 from rohany/backport19.2-48624 · 4939b7aa
    Rohan Yadav authored
    release-19.2: sql: fix bug where show create could show partitions of dropped indexes
  • Bob Vawter's avatar
    Merge pull request #48793 from bobvawter/backport19.2-48542 · 7e0730cd
    Bob Vawter authored
    release-19.2: build/packer: Update TeamCity agent disk image
......@@ -42,7 +42,8 @@ if [ "$(uname)" = "Darwin" ]; then
# We don't want this to emit -json output.
......@@ -8,11 +8,11 @@
"project_id": "cockroach-teamcity",
"source_image_family": "ubuntu-1804-lts",
"zone": "us-east1-b",
"machine_type": "n1-highcpu-32",
"machine_type": "n1-standard-32",
"image_name": "{{user `image_id`}}",
"image_description": "{{user `image_id`}}",
"ssh_username": "packer",
"disk_size": 50,
"disk_size": 256,
"disk_type": "pd-ssd"
......@@ -15,17 +15,13 @@ EOF
# Avoid saving any Bash history.
# At the time of writing we really want 1.11, but that doesn't
# exist in the PPA yet.
# Add third-party APT repositories.
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0EBFCD88
cat > /etc/apt/sources.list.d/docker.list <<EOF
deb https://download.docker.com/linux/ubuntu xenial stable
deb https://download.docker.com/linux/ubuntu bionic stable
apt-add-repository ppa:webupd8team/java
add-apt-repository ppa:gophers/archive
# Per https://github.com/golang/go/wiki/Ubuntu
add-apt-repository ppa:longsleep/golang-backports
# Git 2.7, which ships with Xenial, has a bug where submodule metadata sometimes
# uses absolute paths instead of relative paths, which means the affected
# submodules cannot be mounted in Docker containers. Use the latest version of
......@@ -33,27 +29,20 @@ add-apt-repository ppa:gophers/archive
add-apt-repository ppa:git-core/ppa
apt-get update --yes
# Auto-accept the Oracle Java license agreement.
debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true"
# Install the necessary dependencies. Keep this list small!
apt-get install --yes \
docker-ce \
docker-compose \
gnome-keyring \
git \
golang-${GOVERS} \
oracle-java8-installer \
golang-go \
openjdk-11-jre-headless \
# Installing gnome-keyring prevents the error described in
# https://github.com/moby/moby/issues/34048
# Link Go into the PATH; the PPA installs it into /usr/lib/go-1.x/bin.
ln -s /usr/lib/go-${GOVERS}/bin/go /usr/bin/go
# Add a user for the TeamCity agent with Docker rights.
adduser agent --disabled-password
adduser agent docker
# Give the user for the TeamCity agent Docker rights.
usermod -a -G docker agent
# Download the TeamCity agent code and install its configuration.
# N.B.: This must be done as the agent user.
......@@ -12,7 +12,8 @@ tc_start_block "Prepare environment for acceptance tests"
# that it exists before running the test.
export TMPDIR=$PWD/artifacts/acceptance
mkdir -p "$TMPDIR"
type=$(go env GOOS)
# Disable global -json flag.
type=$(GOFLAGS=; go env GOOS)
tc_end_block "Prepare environment for acceptance tests"
tc_start_block "Compile CockroachDB"
......@@ -2238,12 +2238,12 @@ CREATE TABLE crdb_internal.zones (
return err
for i, s := range subzones {
index, err := table.FindIndexByID(sqlbase.IndexID(s.IndexID))
if err != nil {
if err == sqlbase.ErrIndexGCMutationsList {
return err
index := table.FindActiveIndexByID(sqlbase.IndexID(s.IndexID))
if index == nil {
// If we can't find an active index that corresponds to this index
// ID then continue, as the index is being dropped, or is already
// dropped and in the GC queue.
if zoneSpecifier != nil {
zs := zs
......@@ -2761,6 +2761,21 @@ func (desc *TableDescriptor) FindIndexByID(id IndexID) (*IndexDescriptor, error)
return nil, fmt.Errorf("index-id \"%d\" does not exist", id)
// FindActiveIndexByID returns the index with the specified ID, or nil if it
// does not exist. It only searches active indexes.
func (desc *TableDescriptor) FindActiveIndexByID(id IndexID) *IndexDescriptor {
if desc.PrimaryIndex.ID == id {
return &desc.PrimaryIndex
for i := range desc.Indexes {
idx := &desc.Indexes[i]
if idx.ID == id {
return idx
return nil
// FindIndexByIndexIdx returns an active index with the specified
// index's index which has a domain of [0, # of secondary indexes] and whether
// the index is a secondary index.