Skip to content

Commit 86d5798

Browse files
authored
Merge pull request #10576 from neondatabase/rc/release-proxy/2025-01-30
Proxy release 2025-01-30
2 parents c91905e + 8b4088d commit 86d5798

File tree

242 files changed

+9310
-3760
lines changed

Some content is hidden

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

242 files changed

+9310
-3760
lines changed

Diff for: .github/actionlint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ self-hosted-runner:
44
- large
55
- large-arm64
66
- small
7+
- small-metal
78
- small-arm64
89
- us-east-2
910
config-variables:

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

+48
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,31 @@ inputs:
1717
compute_units:
1818
description: '[Min, Max] compute units'
1919
default: '[1, 1]'
20+
# settings below only needed if you want the project to be sharded from the beginning
21+
shard_split_project:
22+
description: 'by default new projects are not shard-split, specify true to shard-split'
23+
required: false
24+
default: 'false'
25+
admin_api_key:
26+
description: 'Admin API Key needed for shard-splitting. Must be specified if shard_split_project is true'
27+
required: false
28+
shard_count:
29+
description: 'Number of shards to split the project into, only applies if shard_split_project is true'
30+
required: false
31+
default: '8'
32+
stripe_size:
33+
description: 'Stripe size, optional, in 8kiB pages. e.g. set 2048 for 16MB stripes. Default is 128 MiB, only applies if shard_split_project is true'
34+
required: false
35+
default: '32768'
36+
psql_path:
37+
description: 'Path to psql binary - it is caller responsibility to provision the psql binary'
38+
required: false
39+
default: '/tmp/neon/pg_install/v16/bin/psql'
40+
libpq_lib_path:
41+
description: 'Path to directory containing libpq library - it is caller responsibility to provision the libpq library'
42+
required: false
43+
default: '/tmp/neon/pg_install/v16/lib'
44+
2045

2146
outputs:
2247
dsn:
@@ -63,10 +88,33 @@ runs:
6388
echo "project_id=${project_id}" >> $GITHUB_OUTPUT
6489
6590
echo "Project ${project_id} has been created"
91+
92+
if [ "${SHARD_SPLIT_PROJECT}" = "true" ]; then
93+
# determine tenant ID
94+
TENANT_ID=`${PSQL} ${dsn} -t -A -c "SHOW neon.tenant_id"`
95+
96+
echo "Splitting project ${project_id} with tenant_id ${TENANT_ID} into $((SHARD_COUNT)) shards with stripe size $((STRIPE_SIZE))"
97+
98+
echo "Sending PUT request to https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/shard_split"
99+
echo "with body {\"new_shard_count\": $((SHARD_COUNT)), \"new_stripe_size\": $((STRIPE_SIZE))}"
100+
101+
# we need an ADMIN API KEY to invoke storage controller API for shard splitting (bash -u above checks that the variable is set)
102+
curl -X PUT \
103+
"https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/shard_split" \
104+
-H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer ${ADMIN_API_KEY}" \
105+
-d "{\"new_shard_count\": $SHARD_COUNT, \"new_stripe_size\": $STRIPE_SIZE}"
106+
fi
107+
66108
env:
67109
API_HOST: ${{ inputs.api_host }}
68110
API_KEY: ${{ inputs.api_key }}
69111
REGION_ID: ${{ inputs.region_id }}
70112
POSTGRES_VERSION: ${{ inputs.postgres_version }}
71113
MIN_CU: ${{ fromJSON(inputs.compute_units)[0] }}
72114
MAX_CU: ${{ fromJSON(inputs.compute_units)[1] }}
115+
SHARD_SPLIT_PROJECT: ${{ inputs.shard_split_project }}
116+
ADMIN_API_KEY: ${{ inputs.admin_api_key }}
117+
SHARD_COUNT: ${{ inputs.shard_count }}
118+
STRIPE_SIZE: ${{ inputs.stripe_size }}
119+
PSQL: ${{ inputs.psql_path }}
120+
LD_LIBRARY_PATH: ${{ inputs.libpq_lib_path }}

Diff for: .github/workflows/_benchmarking_preparation.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
platform: [ aws-rds-postgres, aws-aurora-serverless-v2-postgres, neon ]
20+
platform: [ aws-rds-postgres, aws-aurora-serverless-v2-postgres, neon, neon_pg17 ]
2121
database: [ clickbench, tpch, userexample ]
2222

2323
env:
@@ -41,6 +41,9 @@ jobs:
4141
neon)
4242
CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CONNSTR }}
4343
;;
44+
neon_pg17)
45+
CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CONNSTR_PG17 }}
46+
;;
4447
aws-rds-postgres)
4548
CONNSTR=${{ secrets.BENCHMARK_RDS_POSTGRES_CONNSTR }}
4649
;;

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

+8-6
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ jobs:
158158

159159
- name: Run cargo build
160160
run: |
161-
PQ_LIB_DIR=$(pwd)/pg_install/v16/lib
162-
export PQ_LIB_DIR
163161
${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_FEATURES --bins --tests
164162
165163
# Do install *before* running rust tests because they might recompile the
@@ -217,8 +215,6 @@ jobs:
217215
env:
218216
NEXTEST_RETRIES: 3
219217
run: |
220-
PQ_LIB_DIR=$(pwd)/pg_install/v16/lib
221-
export PQ_LIB_DIR
222218
LD_LIBRARY_PATH=$(pwd)/pg_install/v17/lib
223219
export LD_LIBRARY_PATH
224220
@@ -229,8 +225,13 @@ jobs:
229225
${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_FEATURES -E '!package(pageserver)'
230226
231227
# run pageserver tests with different settings
232-
for io_engine in std-fs tokio-epoll-uring ; do
233-
NEON_PAGESERVER_UNIT_TEST_VIRTUAL_FILE_IOENGINE=$io_engine ${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_FEATURES -E 'package(pageserver)'
228+
for get_vectored_concurrent_io in sequential sidecar-task; do
229+
for io_engine in std-fs tokio-epoll-uring ; do
230+
NEON_PAGESERVER_UNIT_TEST_GET_VECTORED_CONCURRENT_IO=$get_vectored_concurrent_io \
231+
NEON_PAGESERVER_UNIT_TEST_VIRTUAL_FILE_IOENGINE=$io_engine \
232+
${cov_prefix} \
233+
cargo nextest run $CARGO_FLAGS $CARGO_FEATURES -E 'package(pageserver)'
234+
done
234235
done
235236
236237
# Run separate tests for real S3
@@ -314,6 +315,7 @@ jobs:
314315
CHECK_ONDISK_DATA_COMPATIBILITY: nonempty
315316
BUILD_TAG: ${{ inputs.build-tag }}
316317
PAGESERVER_VIRTUAL_FILE_IO_ENGINE: tokio-epoll-uring
318+
PAGESERVER_GET_VECTORED_CONCURRENT_IO: sidecar-task
317319
USE_LFC: ${{ matrix.lfc_state == 'with-lfc' && 'true' || 'false' }}
318320

319321
# Temporary disable this step until we figure out why it's so flaky

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

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Check Codestyle Rust
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build-tools-image:
7+
description: "build-tools image"
8+
required: true
9+
type: string
10+
archs:
11+
description: "Json array of architectures to run on"
12+
type: string
13+
14+
15+
defaults:
16+
run:
17+
shell: bash -euxo pipefail {0}
18+
19+
jobs:
20+
check-codestyle-rust:
21+
strategy:
22+
matrix:
23+
arch: ${{ fromJson(inputs.archs) }}
24+
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
25+
26+
container:
27+
image: ${{ inputs.build-tools-image }}
28+
credentials:
29+
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
31+
options: --init
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
submodules: true
38+
39+
- name: Cache cargo deps
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.cargo/registry
44+
!~/.cargo/registry/src
45+
~/.cargo/git
46+
target
47+
key: v1-${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('./Cargo.lock') }}-${{ hashFiles('./rust-toolchain.toml') }}-rust
48+
49+
# Some of our rust modules use FFI and need those to be checked
50+
- name: Get postgres headers
51+
run: make postgres-headers -j$(nproc)
52+
53+
# cargo hack runs the given cargo subcommand (clippy in this case) for all feature combinations.
54+
# This will catch compiler & clippy warnings in all feature combinations.
55+
# TODO: use cargo hack for build and test as well, but, that's quite expensive.
56+
# NB: keep clippy args in sync with ./run_clippy.sh
57+
#
58+
# The only difference between "clippy --debug" and "clippy --release" is that in --release mode,
59+
# #[cfg(debug_assertions)] blocks are not built. It's not worth building everything for second
60+
# time just for that, so skip "clippy --release".
61+
- run: |
62+
CLIPPY_COMMON_ARGS="$( source .neon_clippy_args; echo "$CLIPPY_COMMON_ARGS")"
63+
if [ "$CLIPPY_COMMON_ARGS" = "" ]; then
64+
echo "No clippy args found in .neon_clippy_args"
65+
exit 1
66+
fi
67+
echo "CLIPPY_COMMON_ARGS=${CLIPPY_COMMON_ARGS}" >> $GITHUB_ENV
68+
- name: Run cargo clippy (debug)
69+
run: cargo hack --features default --ignore-unknown-features --feature-powerset clippy $CLIPPY_COMMON_ARGS
70+
71+
- name: Check documentation generation
72+
run: cargo doc --workspace --no-deps --document-private-items
73+
env:
74+
RUSTDOCFLAGS: "-Dwarnings -Arustdoc::private_intra_doc_links"
75+
76+
# Use `${{ !cancelled() }}` to run quck tests after the longer clippy run
77+
- name: Check formatting
78+
if: ${{ !cancelled() }}
79+
run: cargo fmt --all -- --check
80+
81+
# https://github.com/facebookincubator/cargo-guppy/tree/bec4e0eb29dcd1faac70b1b5360267fc02bf830e/tools/cargo-hakari#2-keep-the-workspace-hack-up-to-date-in-ci
82+
- name: Check rust dependencies
83+
if: ${{ !cancelled() }}
84+
run: |
85+
cargo hakari generate --diff # workspace-hack Cargo.toml is up-to-date
86+
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

0 commit comments

Comments
 (0)