Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
13 changes: 10 additions & 3 deletions Dockerfile-orioledb-17
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,16 @@ 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)
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 = 13" >> "/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
ansible.builtin.lineinfile:
path: /etc/postgresql/postgresql.conf
line: "orioledb.rewind_buffers = 13"
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.051-orioledb-rewind"
postgres17: "17.6.1.028"
postgres15: "15.14.1.028"

Expand Down
2 changes: 1 addition & 1 deletion nix/ext/orioledb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
python3
openssl
];
buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=11";
buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=11 IS_DEV=1";
installPhase = ''
runHook preInstall

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)
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 = 13" >> "$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)
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 = 13" >> "$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