Skip to content

Commit bbcf286

Browse files
committed
feat: apply changes to Dockerfile for orioledb
chore: bump version
1 parent 47d12a9 commit bbcf286

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

Dockerfile-orioledb-17

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

212218

213219
# # Include schema migrations

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: 3 additions & 3 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.055-orioledb-odb-1"
14-
postgres17: "17.6.1.034-odb-1"
15-
postgres15: "15.14.1.034-odb-1"
13+
postgresorioledb-17: "17.5.1.055-orioledb-odb-2"
14+
postgres17: "17.6.1.034-odb-2"
15+
postgres15: "15.14.1.034-odb-2"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.19.0

nix/tools/run-server.sh.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ orioledb_config_items() {
248248
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf"
249249
sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf"
250250
echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf"
251+
# OrioleDB rewind configuration (20 minute window, 10MB buffer)
252+
echo "orioledb.enable_rewind = true" >> "$DATDIR/postgresql.conf"
253+
echo "orioledb.rewind_max_time = 1200" >> "$DATDIR/postgresql.conf"
254+
echo "orioledb.rewind_max_transactions = 100000" >> "$DATDIR/postgresql.conf"
255+
echo "orioledb.rewind_buffers = 1280" >> "$DATDIR/postgresql.conf"
251256
elif [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then
252257
# macOS specific configuration
253258
echo "macOS detected, applying macOS specific configuration"
@@ -263,6 +268,11 @@ orioledb_config_items() {
263268
perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf"
264269

265270
echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf"
271+
# OrioleDB rewind configuration (20 minute window, 10MB buffer)
272+
echo "orioledb.enable_rewind = true" >> "$DATDIR/postgresql.conf"
273+
echo "orioledb.rewind_max_time = 1200" >> "$DATDIR/postgresql.conf"
274+
echo "orioledb.rewind_max_transactions = 100000" >> "$DATDIR/postgresql.conf"
275+
echo "orioledb.rewind_buffers = 1280" >> "$DATDIR/postgresql.conf"
266276
elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then
267277
echo "non-macos pg 17 conf"
268278
sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"

0 commit comments

Comments
 (0)