Skip to content

Commit 156c18e

Browse files
authored
Merge pull request #10713 from neondatabase/rc/release-compute/2025-02-07
Compute release 2025-02-07
2 parents dd04e3e + ffc1a81 commit 156c18e

File tree

141 files changed

+5620
-1844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+5620
-1844
lines changed

Diff for: .dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
!storage_controller/
2525
!vendor/postgres-*/
2626
!workspace_hack/
27+
!build_tools/patches

Diff for: .github/actionlint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ config-variables:
2727
- SLACK_ON_CALL_QA_STAGING_STREAM
2828
- DEV_AWS_OIDC_ROLE_MANAGE_BENCHMARK_EC2_VMS_ARN
2929
- SLACK_ON_CALL_STORAGE_STAGING_STREAM
30+
- SLACK_CICD_CHANNEL_ID

Diff for: .github/actions/neon-project-create/action.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ inputs:
4141
description: 'Path to directory containing libpq library - it is caller responsibility to provision the libpq library'
4242
required: false
4343
default: '/tmp/neon/pg_install/v16/lib'
44-
44+
project_settings:
45+
description: 'A JSON object with project settings'
46+
required: false
47+
default: '{}'
4548

4649
outputs:
4750
dsn:
@@ -73,7 +76,7 @@ runs:
7376
\"provisioner\": \"k8s-neonvm\",
7477
\"autoscaling_limit_min_cu\": ${MIN_CU},
7578
\"autoscaling_limit_max_cu\": ${MAX_CU},
76-
\"settings\": { }
79+
\"settings\": ${PROJECT_SETTINGS}
7780
}
7881
}")
7982
@@ -92,12 +95,12 @@ runs:
9295
if [ "${SHARD_SPLIT_PROJECT}" = "true" ]; then
9396
# determine tenant ID
9497
TENANT_ID=`${PSQL} ${dsn} -t -A -c "SHOW neon.tenant_id"`
95-
98+
9699
echo "Splitting project ${project_id} with tenant_id ${TENANT_ID} into $((SHARD_COUNT)) shards with stripe size $((STRIPE_SIZE))"
97100
98101
echo "Sending PUT request to https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/shard_split"
99102
echo "with body {\"new_shard_count\": $((SHARD_COUNT)), \"new_stripe_size\": $((STRIPE_SIZE))}"
100-
103+
101104
# we need an ADMIN API KEY to invoke storage controller API for shard splitting (bash -u above checks that the variable is set)
102105
curl -X PUT \
103106
"https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/shard_split" \
@@ -118,3 +121,4 @@ runs:
118121
STRIPE_SIZE: ${{ inputs.stripe_size }}
119122
PSQL: ${{ inputs.psql_path }}
120123
LD_LIBRARY_PATH: ${{ inputs.libpq_lib_path }}
124+
PROJECT_SETTINGS: ${{ inputs.project_settings }}

Diff for: .github/actions/run-python-test-set/action.yml

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ runs:
121121
export DEFAULT_PG_VERSION=${PG_VERSION#v}
122122
export LD_LIBRARY_PATH=${POSTGRES_DISTRIB_DIR}/v${DEFAULT_PG_VERSION}/lib
123123
export BENCHMARK_CONNSTR=${BENCHMARK_CONNSTR:-}
124+
export ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=0:abort_on_error=1:strict_string_checks=1:check_initialization_order=1:strict_init_order=1
125+
export UBSAN_OPTIONS=abort_on_error=1:print_stacktrace=1
124126
125127
if [ "${BUILD_TYPE}" = "remote" ]; then
126128
export REMOTE_ENV=1

Diff for: .github/file-filters.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
rust_code: ['**/*.rs', '**/Cargo.toml', '**/Cargo.lock']
2+
rust_dependencies: ['**/Cargo.lock']
23

34
v14: ['vendor/postgres-v14/**', 'Makefile', 'pgxn/**']
45
v15: ['vendor/postgres-v15/**', 'Makefile', 'pgxn/**']

Diff for: .github/workflows/_build-and-test-locally.yml

+45-14
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
required: true
2121
type: string
2222
test-cfg:
23-
description: 'a json object of postgres versions and lfc states to run regression tests on'
23+
description: 'a json object of postgres versions and lfc/sanitizers states to build and run regression tests on'
2424
required: true
2525
type: string
2626

@@ -48,6 +48,8 @@ jobs:
4848
# io_uring will account the memory of the CQ and SQ as locked.
4949
# More details: https://github.com/neondatabase/neon/issues/6373#issuecomment-1905814391
5050
options: --init --shm-size=512mb --ulimit memlock=67108864:67108864
51+
strategy:
52+
matrix: ${{ fromJSON(format('{{"include":{0}}}', inputs.test-cfg)) }}
5153
env:
5254
BUILD_TYPE: ${{ inputs.build-type }}
5355
GIT_VERSION: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -87,6 +89,7 @@ jobs:
8789
- name: Set env variables
8890
env:
8991
ARCH: ${{ inputs.arch }}
92+
SANITIZERS: ${{ matrix.sanitizers }}
9093
run: |
9194
CARGO_FEATURES="--features testing"
9295
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' ]]; then
@@ -99,8 +102,14 @@ jobs:
99102
cov_prefix=""
100103
CARGO_FLAGS="--locked --release"
101104
fi
105+
if [[ $SANITIZERS == 'enabled' ]]; then
106+
make_vars="WITH_SANITIZERS=yes"
107+
else
108+
make_vars=""
109+
fi
102110
{
103111
echo "cov_prefix=${cov_prefix}"
112+
echo "make_vars=${make_vars}"
104113
echo "CARGO_FEATURES=${CARGO_FEATURES}"
105114
echo "CARGO_FLAGS=${CARGO_FLAGS}"
106115
echo "CARGO_HOME=${GITHUB_WORKSPACE}/.cargo"
@@ -136,37 +145,39 @@ jobs:
136145

137146
- name: Build postgres v14
138147
if: steps.cache_pg_14.outputs.cache-hit != 'true'
139-
run: mold -run make postgres-v14 -j$(nproc)
148+
run: mold -run make ${make_vars} postgres-v14 -j$(nproc)
140149

141150
- name: Build postgres v15
142151
if: steps.cache_pg_15.outputs.cache-hit != 'true'
143-
run: mold -run make postgres-v15 -j$(nproc)
152+
run: mold -run make ${make_vars} postgres-v15 -j$(nproc)
144153

145154
- name: Build postgres v16
146155
if: steps.cache_pg_16.outputs.cache-hit != 'true'
147-
run: mold -run make postgres-v16 -j$(nproc)
156+
run: mold -run make ${make_vars} postgres-v16 -j$(nproc)
148157

149158
- name: Build postgres v17
150159
if: steps.cache_pg_17.outputs.cache-hit != 'true'
151-
run: mold -run make postgres-v17 -j$(nproc)
160+
run: mold -run make ${make_vars} postgres-v17 -j$(nproc)
152161

153162
- name: Build neon extensions
154-
run: mold -run make neon-pg-ext -j$(nproc)
163+
run: mold -run make ${make_vars} neon-pg-ext -j$(nproc)
155164

156165
- name: Build walproposer-lib
157-
run: mold -run make walproposer-lib -j$(nproc)
166+
run: mold -run make ${make_vars} walproposer-lib -j$(nproc)
158167

159168
- name: Run cargo build
169+
env:
170+
WITH_TESTS: ${{ matrix.sanitizers != 'enabled' && '--tests' || '' }}
160171
run: |
161-
PQ_LIB_DIR=$(pwd)/pg_install/v16/lib
162-
export PQ_LIB_DIR
163-
${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_FEATURES --bins --tests
172+
export ASAN_OPTIONS=detect_leaks=0
173+
${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_FEATURES --bins ${WITH_TESTS}
164174
165175
# Do install *before* running rust tests because they might recompile the
166176
# binaries with different features/flags.
167177
- name: Install rust binaries
168178
env:
169179
ARCH: ${{ inputs.arch }}
180+
SANITIZERS: ${{ matrix.sanitizers }}
170181
run: |
171182
# Install target binaries
172183
mkdir -p /tmp/neon/bin/
@@ -181,7 +192,7 @@ jobs:
181192
done
182193
183194
# Install test executables and write list of all binaries (for code coverage)
184-
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' ]]; then
195+
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' && $SANITIZERS != 'enabled' ]]; then
185196
# Keep bloated coverage data files away from the rest of the artifact
186197
mkdir -p /tmp/coverage/
187198
@@ -214,11 +225,10 @@ jobs:
214225
role-duration-seconds: 18000 # 5 hours
215226

216227
- name: Run rust tests
228+
if: ${{ matrix.sanitizers != 'enabled' }}
217229
env:
218230
NEXTEST_RETRIES: 3
219231
run: |
220-
PQ_LIB_DIR=$(pwd)/pg_install/v16/lib
221-
export PQ_LIB_DIR
222232
LD_LIBRARY_PATH=$(pwd)/pg_install/v17/lib
223233
export LD_LIBRARY_PATH
224234
@@ -271,6 +281,26 @@ jobs:
271281
path: /tmp/neon
272282
aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
273283

284+
- name: Check diesel schema
285+
if: inputs.build-type == 'release' && inputs.arch == 'x64'
286+
env:
287+
DATABASE_URL: postgresql://localhost:1235/storage_controller
288+
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
289+
run: |
290+
/tmp/neon/bin/neon_local init
291+
/tmp/neon/bin/neon_local storage_controller start
292+
293+
diesel print-schema > storage_controller/src/schema.rs
294+
295+
if [ -n "$(git diff storage_controller/src/schema.rs)" ]; then
296+
echo >&2 "Uncommitted changes in diesel schema"
297+
298+
git diff .
299+
exit 1
300+
fi
301+
302+
/tmp/neon/bin/neon_local storage_controller stop
303+
274304
# XXX: keep this after the binaries.list is formed, so the coverage can properly work later
275305
- name: Merge and upload coverage data
276306
if: inputs.build-type == 'debug'
@@ -303,7 +333,7 @@ jobs:
303333
- name: Pytest regression tests
304334
continue-on-error: ${{ matrix.lfc_state == 'with-lfc' && inputs.build-type == 'debug' }}
305335
uses: ./.github/actions/run-python-test-set
306-
timeout-minutes: 60
336+
timeout-minutes: ${{ matrix.sanitizers != 'enabled' && 60 || 180 }}
307337
with:
308338
build_type: ${{ inputs.build-type }}
309339
test_selection: regress
@@ -321,6 +351,7 @@ jobs:
321351
PAGESERVER_VIRTUAL_FILE_IO_ENGINE: tokio-epoll-uring
322352
PAGESERVER_GET_VECTORED_CONCURRENT_IO: sidecar-task
323353
USE_LFC: ${{ matrix.lfc_state == 'with-lfc' && 'true' || 'false' }}
354+
SANITIZERS: ${{ matrix.sanitizers }}
324355

325356
# Temporary disable this step until we figure out why it's so flaky
326357
# Ref https://github.com/neondatabase/neon/issues/4540

Diff for: .github/workflows/_check-codestyle-rust.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ defaults:
1616
run:
1717
shell: bash -euxo pipefail {0}
1818

19+
# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
20+
permissions: {}
21+
1922
jobs:
2023
check-codestyle-rust:
2124
strategy:
@@ -84,8 +87,3 @@ jobs:
8487
run: |
8588
cargo hakari generate --diff # workspace-hack Cargo.toml is up-to-date
8689
cargo hakari manage-deps --dry-run # all workspace crates depend on workspace-hack
87-
88-
# https://github.com/EmbarkStudios/cargo-deny
89-
- name: Check rust licenses/bans/advisories/sources
90-
if: ${{ !cancelled() }}
91-
run: cargo deny check --hide-inclusion-graph

Diff for: .github/workflows/approved-for-ci-run.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ jobs:
6767

6868
- uses: actions/checkout@v4
6969
with:
70-
ref: main
70+
ref: ${{ github.event.pull_request.head.sha }}
7171
token: ${{ secrets.CI_ACCESS_TOKEN }}
72-
72+
7373
- name: Look for existing PR
7474
id: get-pr
7575
env:
7676
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
7777
run: |
7878
ALREADY_CREATED="$(gh pr --repo ${GITHUB_REPOSITORY} list --head ${BRANCH} --base main --json number --jq '.[].number')"
7979
echo "ALREADY_CREATED=${ALREADY_CREATED}" >> ${GITHUB_OUTPUT}
80-
80+
8181
- name: Get changed labels
8282
id: get-labels
8383
if: steps.get-pr.outputs.ALREADY_CREATED != ''
@@ -94,16 +94,14 @@ jobs:
9494
echo "LABELS_TO_ADD=${LABELS_TO_ADD}" >> ${GITHUB_OUTPUT}
9595
echo "LABELS_TO_REMOVE=${LABELS_TO_REMOVE}" >> ${GITHUB_OUTPUT}
9696
97-
- run: gh pr checkout "${PR_NUMBER}"
98-
9997
- run: git checkout -b "${BRANCH}"
10098

10199
- run: git push --force origin "${BRANCH}"
102100
if: steps.get-pr.outputs.ALREADY_CREATED == ''
103101

104102
- name: Create a Pull Request for CI run (if required)
105103
if: steps.get-pr.outputs.ALREADY_CREATED == ''
106-
env:
104+
env:
107105
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
108106
run: |
109107
cat << EOF > body.md
@@ -140,7 +138,7 @@ jobs:
140138
141139
- run: git push --force origin "${BRANCH}"
142140
if: steps.get-pr.outputs.ALREADY_CREATED != ''
143-
141+
144142
cleanup:
145143
# Close PRs and delete branchs if the original PR is closed.
146144

Diff for: .github/workflows/benchmarking.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ jobs:
340340
],
341341
"pg_version" : [
342342
16,17
343-
],
343+
]
344344
}'
345345
346346
if [ "$(date +%A)" = "Saturday" ] || [ ${RUN_AWS_RDS_AND_AURORA} = "true" ]; then
@@ -810,7 +810,7 @@ jobs:
810810
# We might change it after https://github.com/neondatabase/neon/issues/2900.
811811
#
812812
# *_TPCH_S10_CONNSTR: DB generated with scale factor 10 (~10 GB)
813-
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
813+
# if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
814814
permissions:
815815
contents: write
816816
statuses: write
@@ -929,7 +929,7 @@ jobs:
929929
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
930930

931931
user-examples-compare:
932-
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
932+
# if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
933933
permissions:
934934
contents: write
935935
statuses: write

Diff for: .github/workflows/build-macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ jobs:
235235
echo 'CPPFLAGS=-I/usr/local/opt/openssl@3/include' >> $GITHUB_ENV
236236
237237
- name: Run cargo build (only for v17)
238-
run: PQ_LIB_DIR=$(pwd)/pg_install/v17/lib cargo build --all --release -j$(sysctl -n hw.ncpu)
238+
run: cargo build --all --release -j$(sysctl -n hw.ncpu)
239239

240240
- name: Check that no warnings are produced (only for v17)
241241
run: ./run_clippy.sh

Diff for: .github/workflows/build_and_test.yml

+39-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ jobs:
4545
run cancel-previous-in-concurrency-group.yml \
4646
--field concurrency_group="${{ env.E2E_CONCURRENCY_GROUP }}"
4747
48+
files-changed:
49+
needs: [ check-permissions ]
50+
runs-on: [ self-hosted, small ]
51+
timeout-minutes: 3
52+
outputs:
53+
check-rust-dependencies: ${{ steps.files-changed.outputs.rust_dependencies }}
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
with:
59+
submodules: true
60+
61+
- name: Check for file changes
62+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
63+
id: files-changed
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
filters: .github/file-filters.yaml
67+
4868
tag:
4969
needs: [ check-permissions ]
5070
runs-on: [ self-hosted, small ]
@@ -170,6 +190,14 @@ jobs:
170190
archs: '["x64", "arm64"]'
171191
secrets: inherit
172192

193+
check-dependencies-rust:
194+
needs: [ files-changed, build-build-tools-image ]
195+
if: ${{ needs.files-changed.outputs.check-rust-dependencies == 'true' }}
196+
uses: ./.github/workflows/cargo-deny.yml
197+
with:
198+
build-tools-image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
199+
secrets: inherit
200+
173201
build-and-test-locally:
174202
needs: [ tag, build-build-tools-image ]
175203
strategy:
@@ -654,7 +682,7 @@ jobs:
654682
push: true
655683
pull: true
656684
file: compute/compute-node.Dockerfile
657-
target: neon-pg-ext-test
685+
target: extension-tests
658686
cache-from: type=registry,ref=cache.neon.build/compute-node-${{ matrix.version.pg }}:cache-${{ matrix.version.debian }}-${{ matrix.arch }}
659687
tags: |
660688
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{needs.tag.outputs.build-tag}}-${{ matrix.version.debian }}-${{ matrix.arch }}
@@ -1332,6 +1360,8 @@ jobs:
13321360
- build-and-test-locally
13331361
- check-codestyle-python
13341362
- check-codestyle-rust
1363+
- check-dependencies-rust
1364+
- files-changed
13351365
- promote-images-dev
13361366
- test-images
13371367
- trigger-custom-extensions-build-and-wait
@@ -1344,4 +1374,11 @@ jobs:
13441374
if: |
13451375
contains(needs.*.result, 'failure')
13461376
|| contains(needs.*.result, 'cancelled')
1347-
|| contains(needs.*.result, 'skipped')
1377+
|| (needs.check-dependencies-rust.result == 'skipped' && needs.files-changed.outputs.check-rust-dependencies == 'true')
1378+
|| needs.build-and-test-locally.result == 'skipped'
1379+
|| needs.check-codestyle-python.result == 'skipped'
1380+
|| needs.check-codestyle-rust.result == 'skipped'
1381+
|| needs.files-changed.result == 'skipped'
1382+
|| needs.promote-images-dev.result == 'skipped'
1383+
|| needs.test-images.result == 'skipped'
1384+
|| needs.trigger-custom-extensions-build-and-wait.result == 'skipped'

0 commit comments

Comments
 (0)