Skip to content

Commit f88d4a4

Browse files
authored
Merge branch 'develop' into pg17_7
2 parents 03a9800 + 25d86be commit f88d4a4

File tree

15 files changed

+586
-409
lines changed

15 files changed

+586
-409
lines changed

.github/workflows/testinfra-ami-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,18 @@ jobs:
109109
echo "" >> common-nix.vars.pkr.hcl
110110
111111
- name: Build AMI stage 1
112+
env:
113+
AWS_MAX_ATTEMPTS: 10
114+
AWS_RETRY_MODE: adaptive
112115
run: |
113116
GIT_SHA=${{github.sha}}
114117
nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl
115118
nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl
116119
117120
- name: Build AMI stage 2
121+
env:
122+
AWS_MAX_ATTEMPTS: 10
123+
AWS_RETRY_MODE: adaptive
118124
run: |
119125
GIT_SHA=${{github.sha}}
120126
nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl

Dockerfile-orioledb-17

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,17 @@ RUN sed -i \
204204
# Remove items from postgresql.conf
205205
RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf"
206206
#as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present
207-
RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf"
208-
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf"
209-
RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf"
210-
RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf"
211-
207+
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf"
208+
RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf"
209+
RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf"
210+
211+
# OrioleDB rewind configuration
212+
# Enables time-based rewind capability for up to 20 minutes (1200 seconds)
213+
# Buffer size: 1280 buffers * 8KB = 10MB for transaction retention
214+
RUN echo "orioledb.enable_rewind = true" >> "/etc/postgresql/postgresql.conf" && \
215+
echo "orioledb.rewind_max_time = 1200" >> "/etc/postgresql/postgresql.conf" && \
216+
echo "orioledb.rewind_max_transactions = 100000" >> "/etc/postgresql/postgresql.conf" && \
217+
echo "orioledb.rewind_buffers = 1280" >> "/etc/postgresql/postgresql.conf"
212218

213219

214220
# # Include schema migrations

amazon-arm64-nix.pkr.hcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ source "amazon-ebssurrogate" "source" {
115115
#secret_key = "${var.aws_secret_key}"
116116
force_deregister = var.force-deregister
117117

118+
# Increase timeout for instance stop operations to handle large instances
119+
aws_polling {
120+
delay_seconds = 15
121+
max_attempts = 120 # 120 * 15s = 30 minutes max wait
122+
}
123+
118124
# Use latest official ubuntu noble ami owned by Canonical.
119125
source_ami_filter {
120126
filters = {

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,38 @@
5151
line: "default_table_access_method = 'orioledb'"
5252
path: '/etc/postgresql/postgresql.conf'
5353
state: 'present'
54+
55+
- name: Enable OrioleDB rewind feature
56+
ansible.builtin.lineinfile:
57+
path: /etc/postgresql/postgresql.conf
58+
line: "orioledb.enable_rewind = true"
59+
state: present
60+
when: is_psql_oriole and stage2_nix
61+
become: yes
62+
63+
- name: Set OrioleDB rewind max time (20 minutes)
64+
ansible.builtin.lineinfile:
65+
path: /etc/postgresql/postgresql.conf
66+
line: "orioledb.rewind_max_time = 1200"
67+
state: present
68+
when: is_psql_oriole and stage2_nix
69+
become: yes
70+
71+
- name: Set OrioleDB rewind max transactions
72+
ansible.builtin.lineinfile:
73+
path: /etc/postgresql/postgresql.conf
74+
line: "orioledb.rewind_max_transactions = 100000"
75+
state: present
76+
when: is_psql_oriole and stage2_nix
77+
become: yes
78+
79+
- name: Set OrioleDB rewind buffers (1280 buffers = 10MB)
80+
ansible.builtin.lineinfile:
81+
path: /etc/postgresql/postgresql.conf
82+
line: "orioledb.rewind_buffers = 1280"
83+
state: present
84+
when: is_psql_oriole and stage2_nix
85+
become: yes
5486

5587
- name: Add ORIOLEDB_ENABLED environment variable
5688
ansible.builtin.lineinfile:

ansible/vars.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ postgres_major:
1010

1111
# Full version strings for each major version
1212
postgres_release:
13-
postgresorioledb-17: "17.5.1.073-orioledb"
1413
postgres17: "17.7.1.001"
15-
postgres15: "15.14.1.052"
14+
postgresorioledb-17: "17.6.0.010-orioledb"
15+
postgres15: "15.14.1.053"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.19.0

migrations/schema-orioledb-17.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
-- PostgreSQL database dump
33
--
44

5-
-- Dumped from database version 17.5
6-
-- Dumped by pg_dump version 17.5
5+
\restrict SupabaseTestDumpKey123
6+
7+
-- Dumped from database version 17.6
8+
-- Dumped by pg_dump version 17.6
79

810
SET statement_timeout = 0;
911
SET lock_timeout = 0;
@@ -1012,3 +1014,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
10121014
-- PostgreSQL database dump complete
10131015
--
10141016

1017+
\unrestrict SupabaseTestDumpKey123
1018+

0 commit comments

Comments
 (0)