Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Dockerfile-orioledb-17
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,17 @@ RUN sed -i \
RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf"
#as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present
RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf"
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf"
RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf"
RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf"
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf"
RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf"
RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf"

# OrioleDB rewind configuration
# Enables time-based rewind capability for up to 20 minutes (1200 seconds)
# Buffer size: 1280 buffers * 8KB = 10MB for transaction retention
RUN echo "orioledb.enable_rewind = true" >> "/etc/postgresql/postgresql.conf" && \
echo "orioledb.rewind_max_time = 1200" >> "/etc/postgresql/postgresql.conf" && \
echo "orioledb.rewind_max_transactions = 100000" >> "/etc/postgresql/postgresql.conf" && \
echo "orioledb.rewind_buffers = 1280" >> "/etc/postgresql/postgresql.conf"



Expand Down
34 changes: 33 additions & 1 deletion ansible/tasks/stage2-setup-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,39 @@
state: present
when: is_psql_oriole and stage2_nix
become: yes


- name: Enable OrioleDB rewind feature
ansible.builtin.lineinfile:
path: /etc/postgresql/postgresql.conf
line: "orioledb.enable_rewind = true"
state: present
when: is_psql_oriole and stage2_nix
become: yes

- name: Set OrioleDB rewind max time (20 minutes)
ansible.builtin.lineinfile:
path: /etc/postgresql/postgresql.conf
line: "orioledb.rewind_max_time = 1200"
state: present
when: is_psql_oriole and stage2_nix
become: yes

- name: Set OrioleDB rewind max transactions
ansible.builtin.lineinfile:
path: /etc/postgresql/postgresql.conf
line: "orioledb.rewind_max_transactions = 100000"
state: present
when: is_psql_oriole and stage2_nix
become: yes

- name: Set OrioleDB rewind buffers (1280 buffers = 10MB)
ansible.builtin.lineinfile:
path: /etc/postgresql/postgresql.conf
line: "orioledb.rewind_buffers = 1280"
state: present
when: is_psql_oriole and stage2_nix
become: yes

- name: Add ORIOLEDB_ENABLED environment variable
ansible.builtin.lineinfile:
path: /etc/environment
Expand Down
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ ebssurrogate_mode: true
async_mode: true

postgres_major:
- "15"
- "17"
# - "15" # only building orioledb-17 for rewind feature
# - "17" # only building orioledb-17 for rewind feature
- orioledb-17

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.5.1.049-orioledb"
postgresorioledb-17: "17.5.1.058-orioledb-rewind"
postgres17: "17.6.1.028"
postgres15: "15.14.1.028"

Expand Down
12 changes: 11 additions & 1 deletion nix/tools/run-server.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ orioledb_config_items() {
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf"
sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf"
echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf"
# OrioleDB rewind configuration (20 minute window, 10MB buffer)
echo "orioledb.enable_rewind = true" >> "$DATDIR/postgresql.conf"
echo "orioledb.rewind_max_time = 1200" >> "$DATDIR/postgresql.conf"
echo "orioledb.rewind_max_transactions = 100000" >> "$DATDIR/postgresql.conf"
echo "orioledb.rewind_buffers = 1280" >> "$DATDIR/postgresql.conf"
elif [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then
# macOS specific configuration
echo "macOS detected, applying macOS specific configuration"
Expand All @@ -261,8 +266,13 @@ orioledb_config_items() {
perl -pi -e 's/ plv8,//g' "$DATDIR/supautils.conf"
perl -pi -e 's/ pgjwt,//g' "$DATDIR/supautils.conf"
perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf"

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