Skip to content

Commit 18ddc73

Browse files
build: downgrade to Go 1.13
Reverts most of cockroachdb#50671. We upgraded from Go1.13.9 to Go1.14.4 on June 29th in cockroachdb#50671. Since then we've seen a fair amount of fallout in our testing and build system. Most of this has been reasonable to manage. However, we recently stumbled upon a concerning regression in the Go runtime that doesn't look easy to work around. Go1.14 included a full rewrite of the runtime timer implementation. This was mostly a positive change, but shortly after the 1.14 release, reports started coming in of multi-millisecond timer starvation. This is tracked in this upstream issue: golang/go#38860. A few months later, when we upgraded Cockroach to use 1.14, some of our tests started hitting the same issue, but in our tests, the starvation was much more severe. In cockroachdb#50865, we saw instances of multi-second timer starvation, which wreaked havoc on the cluster's liveness mechanisms. A partial fix to this runtime issue has landed for Go 1.15 (https://go-review.googlesource.com/c/go/+/232199/) and may be backported to 1.14, but there is currently no ETA on the backport and no guarantee that it will even happen. A more robust fix is scheduled for 1.16 and the PR is still open in the Go repo (https://go-review.googlesource.com/c/go/+/232298/). As we approach the CockroachDB 20.2 stability period, it seems prudent to avoid the risk of downgrading our Go runtime version too late. For that reason, Alex, Andy K, Peter, and I recommend the following course of actions: * Downgrade 20.2 to 1.13 immediately, so we go into the stability period with the right version of Go. * Schedule the subsequent improvements to non-preemptable loops in CockroachDB itself in 21.1. * At the beginning of the 21.1 cycle upgrade CRDB to 1.15 and effectively skip 1.14 all together. This PR addresses the first of these steps. While here, it also picks up the latest patch release of Go 1.13, moving from 1.13.9 to 1.13.14. Checklist: * [X] Adjust version in Docker image ([source](./builder/Dockerfile#L199-L200)). * [X] Rebuild and push the Docker image (following [Basic Process](#basic-process)) * [X] Bump the version in `builder.sh` accordingly ([source](./builder.sh#L6)). * [X] Bump the version in `go-version-check.sh` ([source](./go-version-check.sh)), unless bumping to a new patch release. * [X] Bump the go version in `go.mod`. You may also need to rerun `make vendor_rebuild` if vendoring has changed. * [X] Bump the default installed version of Go in `bootstrap-debian.sh` ([source](./bootstrap/bootstrap-debian.sh#L40-42)). * [X] Replace other mentions of the older version of go (grep for `golang:<old_version>` and `go<old_version>`). * [ ] Update the `builder.dockerImage` parameter in the TeamCity [`Cockroach`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Cockroach&tab=projectParams) and [`Internal`](https://teamcity.cockroachdb.com/admin/editProject.html?projectId=Internal&tab=projectParams) projects. (I will do the last step after this has merged) Release note (general change): Revert the Go version back to 1.13.
1 parent 729d683 commit 18ddc73

File tree

14 files changed

+18
-23
lines changed

14 files changed

+18
-23
lines changed

Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,7 @@ endif
319319
# Force vendor directory to rebuild.
320320
.PHONY: vendor_rebuild
321321
vendor_rebuild: bin/.submodules-initialized
322-
# Use -mod=mod, as -mod=vendor will try install from the vendor directory
323-
# which may be mismatching upon rebuild.
324-
$(GO_INSTALL) -v -mod=mod github.com/goware/modvendor
322+
$(GO_INSTALL) -v github.com/goware/modvendor
325323
./build/vendor_rebuild.sh
326324

327325
# Tell Make to delete the target if its recipe fails. Otherwise, if a recipe

build/bootstrap/bootstrap-debian.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ sudo tar -C /usr -zxf /tmp/cmake.tgz && rm /tmp/cmake.tgz
4646

4747
# Install Go.
4848
trap 'rm -f /tmp/go.tgz' EXIT
49-
curl -fsSL https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz > /tmp/go.tgz
49+
curl -fsSL https://dl.google.com/go/go1.13.14.linux-amd64.tar.gz > /tmp/go.tgz
5050
sha256sum -c - <<EOF
51-
7011af3bbc2ac108d1b82ea8abb87b2e63f78844f0259be20cde4d42c5c40584 /tmp/go.tgz
51+
32617db984b18308f2b00279c763bff060d2739229cb8037217a49c9e691b46a /tmp/go.tgz
5252
EOF
5353
sudo tar -C /usr/local -zxf /tmp/go.tgz && rm /tmp/go.tgz
5454

build/builder.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euo pipefail
44

55
image=cockroachdb/builder
6-
version=20200625-145628
6+
version=20200804-160354
77

88
function init() {
99
docker build --tag="${image}" "$(dirname "${0}")/builder"

build/builder/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ RUN curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-
197197
# releases of Go will no longer be run in CI once it is changed. Consider
198198
# bumping the minimum allowed version of Go in /build/go-version-chech.sh.
199199
RUN apt-get install -y --no-install-recommends golang \
200-
&& curl -fsSL https://storage.googleapis.com/golang/go1.14.4.src.tar.gz -o golang.tar.gz \
201-
&& echo '7011af3bbc2ac108d1b82ea8abb87b2e63f78844f0259be20cde4d42c5c40584 golang.tar.gz' | sha256sum -c - \
200+
&& curl -fsSL https://storage.googleapis.com/golang/go1.13.14.src.tar.gz -o golang.tar.gz \
201+
&& echo '197333e97290e9ea8796f738d61019dcba1c377c2f3961fd6a114918ecc7ab06 golang.tar.gz' | sha256sum -c - \
202202
&& tar -C /usr/local -xzf golang.tar.gz \
203203
&& rm golang.tar.gz \
204204
&& cd /usr/local/go/src \

build/go-version-check.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# To bump the required version of Go, edit the appropriate variables:
77

88
required_version_major=1
9-
minimum_version_minor=14
9+
minimum_version_minor=13
10+
minimum_version_13_patch=4
1011

1112
go=${1-go}
1213

build/teamcity-verify-archive.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ run docker run \
3232
--rm \
3333
--volume="$(cd "$(dirname "$0")" && pwd):/work:ro" \
3434
--workdir="/work" \
35-
golang:1.14-buster ./verify-archive.sh
35+
golang:1.13-buster ./verify-archive.sh
3636
tc_end_block "Test archive"
3737

3838
tc_start_block "Clean up"

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/cockroachdb/cockroach
22

3-
go 1.14
3+
go 1.13
44

55
require (
66
cloud.google.com/go v0.34.0

pkg/acceptance/compose/gss/psql/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the test binary in a multistage build.
2-
FROM golang:1.14 AS builder
2+
FROM golang:1.13 AS builder
33
WORKDIR /workspace
44
COPY . .
55
RUN go get -d -t -tags gss_compose

pkg/ccl/storageccl/engineccl/rocksdb.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func cStringToGoString(s C.DBString) string {
130130
return ""
131131
}
132132
// Reinterpret the string as a slice, then cast to string which does a copy.
133-
result := string(cSliceToUnsafeGoBytes(C.DBSlice(s)))
133+
result := string(cSliceToUnsafeGoBytes(C.DBSlice{s.data, s.len}))
134134
C.free(unsafe.Pointer(s.data))
135135
return result
136136
}

pkg/cmd/roachprod/docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.14
1+
FROM golang:1.13
22
WORKDIR /build
33
COPY . .
44
RUN ["/build/build.sh"]

pkg/storage/enginepb/mvcc3.pb.go

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/storage/rocksdb.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,7 @@ func cStringToGoString(s C.DBString) string {
24172417
return ""
24182418
}
24192419
// Reinterpret the string as a slice, then cast to string which does a copy.
2420-
result := string(cSliceToUnsafeGoBytes(C.DBSlice(s)))
2420+
result := string(cSliceToUnsafeGoBytes(C.DBSlice{s.data, s.len}))
24212421
C.free(unsafe.Pointer(s.data))
24222422
return result
24232423
}
@@ -2599,7 +2599,7 @@ func dbGetProto(
25992599
// Make a byte slice that is backed by result.data. This slice
26002600
// cannot live past the lifetime of this method, but we're only
26012601
// using it to unmarshal the roachpb.
2602-
data := cSliceToUnsafeGoBytes(C.DBSlice(result))
2602+
data := cSliceToUnsafeGoBytes(C.DBSlice{data: result.data, len: result.len})
26032603
err = protoutil.Unmarshal(data, msg)
26042604
}
26052605
C.free(unsafe.Pointer(result.data))

pkg/util/hlc/timestamp.pb.go

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor

Submodule vendor updated 1 file

0 commit comments

Comments
 (0)