Skip to content

Commit 93f7f1d

Browse files
Merge pull request #9573 from neondatabase/releases/2024-10-29-compute-only-2
Compute release 2024-10-29
2 parents cf8646d + 80e1630 commit 93f7f1d

File tree

113 files changed

+3791
-1610
lines changed

Some content is hidden

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

113 files changed

+3791
-1610
lines changed

Diff for: .github/workflows/benchmarking.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,10 @@ jobs:
671671
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
672672
options: --init
673673

674+
# Increase timeout to 12h, default timeout is 6h
675+
# we have regression in clickbench causing it to run 2-3x longer
676+
timeout-minutes: 720
677+
674678
steps:
675679
- uses: actions/checkout@v4
676680

@@ -716,7 +720,7 @@ jobs:
716720
test_selection: performance/test_perf_olap.py
717721
run_in_parallel: false
718722
save_perf_report: ${{ env.SAVE_PERF_REPORT }}
719-
extra_params: -m remote_cluster --timeout 21600 -k test_clickbench
723+
extra_params: -m remote_cluster --timeout 43200 -k test_clickbench
720724
pg_version: ${{ env.DEFAULT_PG_VERSION }}
721725
env:
722726
VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"

Diff for: .github/workflows/build_and_test.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ jobs:
839839
- name: Build vm image
840840
run: |
841841
./vm-builder \
842+
-size=2G \
842843
-spec=compute/vm-image-spec-${{ matrix.version.debian }}.yaml \
843844
-src=neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }} \
844845
-dst=neondatabase/vm-compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}
@@ -1116,7 +1117,10 @@ jobs:
11161117
11171118
gh workflow --repo neondatabase/infra run deploy-proxy-prod.yml --ref main \
11181119
-f deployPgSniRouter=true \
1119-
-f deployProxy=true \
1120+
-f deployProxyLink=true \
1121+
-f deployPrivatelinkProxy=true \
1122+
-f deployProxyScram=true \
1123+
-f deployProxyAuthBroker=true \
11201124
-f branch=main \
11211125
-f dockerTag=${{needs.tag.outputs.build-tag}}
11221126
else

Diff for: Cargo.lock

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

Diff for: Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ members = [
3333
"libs/postgres_ffi/wal_craft",
3434
"libs/vm_monitor",
3535
"libs/walproposer",
36+
"libs/wal_decoder",
3637
]
3738

3839
[workspace.package]
@@ -238,6 +239,7 @@ tracing-utils = { version = "0.1", path = "./libs/tracing-utils/" }
238239
utils = { version = "0.1", path = "./libs/utils/" }
239240
vm_monitor = { version = "0.1", path = "./libs/vm_monitor/" }
240241
walproposer = { version = "0.1", path = "./libs/walproposer/" }
242+
wal_decoder = { version = "0.1", path = "./libs/wal_decoder" }
241243

242244
## Common library dependency
243245
workspace_hack = { version = "0.1", path = "./workspace_hack/" }

Diff for: compute/compute-node.Dockerfile

+113-5
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ RUN apt-get update && \
666666
#
667667
# Use new version only for v17
668668
# because Release_2024_09_1 has some backward incompatible changes
669-
# https://github.com/rdkit/rdkit/releases/tag/Release_2024_09_1
669+
# https://github.com/rdkit/rdkit/releases/tag/Release_2024_09_1
670670
ENV PATH="/usr/local/pgsql/bin/:/usr/local/pgsql/:$PATH"
671671
RUN case "${PG_VERSION}" in \
672672
"v17") \
@@ -860,18 +860,98 @@ ENV PATH="/home/nonroot/.cargo/bin:/usr/local/pgsql/bin/:$PATH"
860860
USER nonroot
861861
WORKDIR /home/nonroot
862862

863-
RUN case "${PG_VERSION}" in "v17") \
864-
echo "v17 is not supported yet by pgrx. Quit" && exit 0;; \
865-
esac && \
866-
curl -sSO https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux-gnu/rustup-init && \
863+
RUN curl -sSO https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux-gnu/rustup-init && \
867864
chmod +x rustup-init && \
868865
./rustup-init -y --no-modify-path --profile minimal --default-toolchain stable && \
869866
rm rustup-init && \
867+
case "${PG_VERSION}" in \
868+
'v17') \
869+
echo 'v17 is not supported yet by pgrx. Quit' && exit 0;; \
870+
esac && \
870871
cargo install --locked --version 0.11.3 cargo-pgrx && \
871872
/bin/bash -c 'cargo pgrx init --pg${PG_VERSION:1}=/usr/local/pgsql/bin/pg_config'
872873

873874
USER root
874875

876+
#########################################################################################
877+
#
878+
# Layer "rust extensions pgrx12"
879+
#
880+
# pgrx started to support Postgres 17 since version 12,
881+
# but some older extension aren't compatible with it.
882+
# This layer should be used as a base for new pgrx extensions,
883+
# and eventually get merged with `rust-extensions-build`
884+
#
885+
#########################################################################################
886+
FROM build-deps AS rust-extensions-build-pgrx12
887+
ARG PG_VERSION
888+
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
889+
890+
RUN apt-get update && \
891+
apt-get install --no-install-recommends -y curl libclang-dev && \
892+
useradd -ms /bin/bash nonroot -b /home
893+
894+
ENV HOME=/home/nonroot
895+
ENV PATH="/home/nonroot/.cargo/bin:/usr/local/pgsql/bin/:$PATH"
896+
USER nonroot
897+
WORKDIR /home/nonroot
898+
899+
RUN curl -sSO https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux-gnu/rustup-init && \
900+
chmod +x rustup-init && \
901+
./rustup-init -y --no-modify-path --profile minimal --default-toolchain stable && \
902+
rm rustup-init && \
903+
cargo install --locked --version 0.12.6 cargo-pgrx && \
904+
/bin/bash -c 'cargo pgrx init --pg${PG_VERSION:1}=/usr/local/pgsql/bin/pg_config'
905+
906+
USER root
907+
908+
#########################################################################################
909+
#
910+
# Layers "pg-onnx-build" and "pgrag-pg-build"
911+
# Compile "pgrag" extensions
912+
#
913+
#########################################################################################
914+
915+
FROM rust-extensions-build-pgrx12 AS pg-onnx-build
916+
917+
# cmake 3.26 or higher is required, so installing it using pip (bullseye-backports has cmake 3.25).
918+
# Install it using virtual environment, because Python 3.11 (the default version on Debian 12 (Bookworm)) complains otherwise
919+
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv && \
920+
python3 -m venv venv && \
921+
. venv/bin/activate && \
922+
python3 -m pip install cmake==3.30.5 && \
923+
wget https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.18.1.tar.gz -O onnxruntime.tar.gz && \
924+
mkdir onnxruntime-src && cd onnxruntime-src && tar xzf ../onnxruntime.tar.gz --strip-components=1 -C . && \
925+
./build.sh --config Release --parallel --skip_submodule_sync --skip_tests --allow_running_as_root
926+
927+
928+
FROM pg-onnx-build AS pgrag-pg-build
929+
930+
RUN apt-get install -y protobuf-compiler && \
931+
wget https://github.com/neondatabase-labs/pgrag/archive/refs/tags/v0.0.0.tar.gz -O pgrag.tar.gz && \
932+
echo "2cbe394c1e74fc8bcad9b52d5fbbfb783aef834ca3ce44626cfd770573700bb4 pgrag.tar.gz" | sha256sum --check && \
933+
mkdir pgrag-src && cd pgrag-src && tar xzf ../pgrag.tar.gz --strip-components=1 -C . && \
934+
\
935+
cd exts/rag && \
936+
sed -i 's/pgrx = "0.12.6"/pgrx = { version = "0.12.6", features = [ "unsafe-postgres" ] }/g' Cargo.toml && \
937+
cargo pgrx install --release && \
938+
echo "trusted = true" >> /usr/local/pgsql/share/extension/rag.control && \
939+
\
940+
cd ../rag_bge_small_en_v15 && \
941+
sed -i 's/pgrx = "0.12.6"/pgrx = { version = "0.12.6", features = [ "unsafe-postgres" ] }/g' Cargo.toml && \
942+
ORT_LIB_LOCATION=/home/nonroot/onnxruntime-src/build/Linux \
943+
REMOTE_ONNX_URL=http://pg-ext-s3-gateway/pgrag-data/bge_small_en_v15.onnx \
944+
cargo pgrx install --release --features remote_onnx && \
945+
echo "trusted = true" >> /usr/local/pgsql/share/extension/rag_bge_small_en_v15.control && \
946+
\
947+
cd ../rag_jina_reranker_v1_tiny_en && \
948+
sed -i 's/pgrx = "0.12.6"/pgrx = { version = "0.12.6", features = [ "unsafe-postgres" ] }/g' Cargo.toml && \
949+
ORT_LIB_LOCATION=/home/nonroot/onnxruntime-src/build/Linux \
950+
REMOTE_ONNX_URL=http://pg-ext-s3-gateway/pgrag-data/jina_reranker_v1_tiny_en.onnx \
951+
cargo pgrx install --release --features remote_onnx && \
952+
echo "trusted = true" >> /usr/local/pgsql/share/extension/rag_jina_reranker_v1_tiny_en.control
953+
954+
875955
#########################################################################################
876956
#
877957
# Layer "pg-jsonschema-pg-build"
@@ -1041,6 +1121,31 @@ RUN wget https://github.com/pgpartman/pg_partman/archive/refs/tags/v5.1.0.tar.gz
10411121
make -j $(getconf _NPROCESSORS_ONLN) install && \
10421122
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_partman.control
10431123

1124+
#########################################################################################
1125+
#
1126+
# Layer "pg_mooncake"
1127+
# compile pg_mooncake extension
1128+
#
1129+
#########################################################################################
1130+
FROM rust-extensions-build AS pg-mooncake-build
1131+
ARG PG_VERSION
1132+
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
1133+
1134+
ENV PG_MOONCAKE_VERSION=882175dbba07ba2e6e59b1088d61bf325b910b9e
1135+
ENV PATH="/usr/local/pgsql/bin/:$PATH"
1136+
1137+
RUN case "${PG_VERSION}" in \
1138+
'v14') \
1139+
echo "pg_mooncake is not supported on Postgres ${PG_VERSION}" && exit 0;; \
1140+
esac && \
1141+
git clone --depth 1 --branch neon https://github.com/kelvich/pg_mooncake.git pg_mooncake-src && \
1142+
cd pg_mooncake-src && \
1143+
git checkout "${PG_MOONCAKE_VERSION}" && \
1144+
git submodule update --init --depth 1 --recursive && \
1145+
make BUILD_TYPE=release -j $(getconf _NPROCESSORS_ONLN) && \
1146+
make BUILD_TYPE=release -j $(getconf _NPROCESSORS_ONLN) install && \
1147+
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_mooncake.control
1148+
10441149
#########################################################################################
10451150
#
10461151
# Layer "neon-pg-ext-build"
@@ -1059,6 +1164,7 @@ COPY --from=h3-pg-build /h3/usr /
10591164
COPY --from=unit-pg-build /usr/local/pgsql/ /usr/local/pgsql/
10601165
COPY --from=vector-pg-build /usr/local/pgsql/ /usr/local/pgsql/
10611166
COPY --from=pgjwt-pg-build /usr/local/pgsql/ /usr/local/pgsql/
1167+
COPY --from=pgrag-pg-build /usr/local/pgsql/ /usr/local/pgsql/
10621168
COPY --from=pg-jsonschema-pg-build /usr/local/pgsql/ /usr/local/pgsql/
10631169
COPY --from=pg-graphql-pg-build /usr/local/pgsql/ /usr/local/pgsql/
10641170
COPY --from=pg-tiktoken-pg-build /usr/local/pgsql/ /usr/local/pgsql/
@@ -1084,6 +1190,7 @@ COPY --from=wal2json-pg-build /usr/local/pgsql /usr/local/pgsql
10841190
COPY --from=pg-anon-pg-build /usr/local/pgsql/ /usr/local/pgsql/
10851191
COPY --from=pg-ivm-build /usr/local/pgsql/ /usr/local/pgsql/
10861192
COPY --from=pg-partman-build /usr/local/pgsql/ /usr/local/pgsql/
1193+
COPY --from=pg-mooncake-build /usr/local/pgsql/ /usr/local/pgsql/
10871194
COPY pgxn/ pgxn/
10881195

10891196
RUN make -j $(getconf _NPROCESSORS_ONLN) \
@@ -1247,6 +1354,7 @@ COPY --from=unit-pg-build /postgresql-unit.tar.gz /ext-src/
12471354
COPY --from=vector-pg-build /pgvector.tar.gz /ext-src/
12481355
COPY --from=vector-pg-build /pgvector.patch /ext-src/
12491356
COPY --from=pgjwt-pg-build /pgjwt.tar.gz /ext-src
1357+
#COPY --from=pgrag-pg-build /usr/local/pgsql/ /usr/local/pgsql/
12501358
#COPY --from=pg-jsonschema-pg-build /home/nonroot/pg_jsonschema.tar.gz /ext-src
12511359
#COPY --from=pg-graphql-pg-build /home/nonroot/pg_graphql.tar.gz /ext-src
12521360
#COPY --from=pg-tiktoken-pg-build /home/nonroot/pg_tiktoken.tar.gz /ext-src

Diff for: compute/vm-image-spec-bookworm.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ commands:
1818
- name: pgbouncer
1919
user: postgres
2020
sysvInitAction: respawn
21-
shell: '/usr/local/bin/pgbouncer /etc/pgbouncer.ini'
21+
shell: '/usr/local/bin/pgbouncer /etc/pgbouncer.ini 2>&1 > /dev/virtio-ports/tech.neon.log.0'
2222
- name: local_proxy
2323
user: postgres
2424
sysvInitAction: respawn

Diff for: compute/vm-image-spec-bullseye.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ commands:
1818
- name: pgbouncer
1919
user: postgres
2020
sysvInitAction: respawn
21-
shell: '/usr/local/bin/pgbouncer /etc/pgbouncer.ini'
21+
shell: '/usr/local/bin/pgbouncer /etc/pgbouncer.ini 2>&1 > /dev/virtio-ports/tech.neon.log.0'
2222
- name: local_proxy
2323
user: postgres
2424
sysvInitAction: respawn

Diff for: control_plane/src/pageserver.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::time::Duration;
1717

1818
use anyhow::{bail, Context};
1919
use camino::Utf8PathBuf;
20-
use pageserver_api::models::{self, AuxFilePolicy, TenantInfo, TimelineInfo};
20+
use pageserver_api::models::{self, TenantInfo, TimelineInfo};
2121
use pageserver_api::shard::TenantShardId;
2222
use pageserver_client::mgmt_api;
2323
use postgres_backend::AuthType;
@@ -399,11 +399,6 @@ impl PageServerNode {
399399
.map(serde_json::from_str)
400400
.transpose()
401401
.context("parse `timeline_get_throttle` from json")?,
402-
switch_aux_file_policy: settings
403-
.remove("switch_aux_file_policy")
404-
.map(|x| x.parse::<AuxFilePolicy>())
405-
.transpose()
406-
.context("Failed to parse 'switch_aux_file_policy'")?,
407402
lsn_lease_length: settings.remove("lsn_lease_length").map(|x| x.to_string()),
408403
lsn_lease_length_for_ts: settings
409404
.remove("lsn_lease_length_for_ts")
@@ -499,11 +494,6 @@ impl PageServerNode {
499494
.map(serde_json::from_str)
500495
.transpose()
501496
.context("parse `timeline_get_throttle` from json")?,
502-
switch_aux_file_policy: settings
503-
.remove("switch_aux_file_policy")
504-
.map(|x| x.parse::<AuxFilePolicy>())
505-
.transpose()
506-
.context("Failed to parse 'switch_aux_file_policy'")?,
507497
lsn_lease_length: settings.remove("lsn_lease_length").map(|x| x.to_string()),
508498
lsn_lease_length_for_ts: settings
509499
.remove("lsn_lease_length_for_ts")

Diff for: control_plane/storcon_cli/src/main.rs

+14
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ enum Command {
111111
#[arg(long)]
112112
node: NodeId,
113113
},
114+
/// Cancel any ongoing reconciliation for this shard
115+
TenantShardCancelReconcile {
116+
#[arg(long)]
117+
tenant_shard_id: TenantShardId,
118+
},
114119
/// Modify the pageserver tenant configuration of a tenant: this is the configuration structure
115120
/// that is passed through to pageservers, and does not affect storage controller behavior.
116121
TenantConfig {
@@ -535,6 +540,15 @@ async fn main() -> anyhow::Result<()> {
535540
)
536541
.await?;
537542
}
543+
Command::TenantShardCancelReconcile { tenant_shard_id } => {
544+
storcon_client
545+
.dispatch::<(), ()>(
546+
Method::PUT,
547+
format!("control/v1/tenant/{tenant_shard_id}/cancel_reconcile"),
548+
None,
549+
)
550+
.await?;
551+
}
538552
Command::TenantConfig { tenant_id, config } => {
539553
let tenant_conf = serde_json::from_str(&config)?;
540554

Diff for: libs/pageserver_api/src/config.rs

-7
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,6 @@ pub struct TenantConfigToml {
250250
// Expresed in multiples of checkpoint distance.
251251
pub image_layer_creation_check_threshold: u8,
252252

253-
/// Switch to a new aux file policy. Switching this flag requires the user has not written any aux file into
254-
/// the storage before, and this flag cannot be switched back. Otherwise there will be data corruptions.
255-
/// There is a `last_aux_file_policy` flag which gets persisted in `index_part.json` once the first aux
256-
/// file is written.
257-
pub switch_aux_file_policy: crate::models::AuxFilePolicy,
258-
259253
/// The length for an explicit LSN lease request.
260254
/// Layers needed to reconstruct pages at LSN will not be GC-ed during this interval.
261255
#[serde(with = "humantime_serde")]
@@ -475,7 +469,6 @@ impl Default for TenantConfigToml {
475469
lazy_slru_download: false,
476470
timeline_get_throttle: crate::models::ThrottleConfig::disabled(),
477471
image_layer_creation_check_threshold: DEFAULT_IMAGE_LAYER_CREATION_CHECK_THRESHOLD,
478-
switch_aux_file_policy: crate::models::AuxFilePolicy::default_tenant_config(),
479472
lsn_lease_length: LsnLease::DEFAULT_LENGTH,
480473
lsn_lease_length_for_ts: LsnLease::DEFAULT_LENGTH_FOR_TS,
481474
}

Diff for: libs/pageserver_api/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ pub mod controller_api;
55
pub mod key;
66
pub mod keyspace;
77
pub mod models;
8+
pub mod record;
89
pub mod reltag;
910
pub mod shard;
1011
/// Public API types
1112
pub mod upcall_api;
13+
pub mod value;
1214

1315
pub mod config;

0 commit comments

Comments
 (0)