Skip to content
Merged
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
29 changes: 7 additions & 22 deletions .github/workflows/run-python-tests-epas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
run: |
FOR /f "delims=" %%F IN ('python tools\get_sb_package.py "${{ secrets.EDB_SBP_URL }}" "edb_as${{ matrix.pgver }}_dbserver" "windows-x64"') DO SET INSTALLER_EXE=%%F
ECHO Running %INSTALLER_EXE%...
%INSTALLER_EXE% --prefix C:\EPAS\${{ matrix.pgver }} --datadir C:\EPAS\${{ matrix.pgver }}\data --serverport 59${{ matrix.pgver }} --superpassword enterprisedb --create_samples no --install_runtimes 0 --mode unattended --unattendedmodeui none --disable-components stackbuilderplus${{ matrix.pgver < 15 && ',pgadmin4' || '' }}
%INSTALLER_EXE% --prefix C:\EPAS\${{ matrix.pgver }} --datadir C:\EPAS\${{ matrix.pgver }}\data --serverport 58${{ matrix.pgver }} --superpassword enterprisedb --create_samples no --install_runtimes 0 --mode unattended --unattendedmodeui none --disable-components stackbuilderplus${{ matrix.pgver < 15 && ',pgadmin4' || '' }}

choco install -y mitkerberos

Expand Down Expand Up @@ -105,38 +105,23 @@ jobs:
run: |
# Note: we use a custom port for PostgreSQL as the runner may already have a version of PostgreSQL installed
sudo su -c "echo local all all trust > /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host all all 127.0.0.1/32 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host all all ::1/128 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host replication postgres 127.0.0.1/32 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host replication postgres ::1/128 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf"
sudo sed -i "s/port = 544[0-9]/port = 59${{ matrix.pgver }}/g" /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf
sudo sed -i "s/port = 544[0-9]/port = 58${{ matrix.pgver }}/g" /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf
sudo sed -i "s/shared_preload_libraries = '/shared_preload_libraries = '\$libdir\/plugin_debugger,/g" /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf
echo "wal_level = logical" | sudo tee -a /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf
sudo su - enterprisedb -c "mkdir -p /var/run/edb-as/${{ matrix.pgver }}-main.epas_stat_tmp"
sudo systemctl restart edb-as@${{ matrix.pgver }}-main

until sudo runuser -l enterprisedb -c "/usr/lib/edb-as/${{ matrix.pgver }}/bin/pg_isready -p 59${{ matrix.pgver }}" 2>/dev/null; do
until sudo runuser -l enterprisedb -c "/usr/lib/edb-as/${{ matrix.pgver }}/bin/pg_isready -p 58${{ matrix.pgver }}" 2>/dev/null; do
>&2 echo "EPAS is unavailable - sleeping for 2 seconds"
sleep 2
done

- name: Start PostgreSQL on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo host replication postgres 127.0.0.1/32 trust >> "C:\EPAS\${{ matrix.pgver }}\data\pg_hba.conf"
echo host replication postgres ::1/128 trust >> "C:\EPAS\${{ matrix.pgver }}\data\pg_hba.conf"
echo wal_level = logical >> "C:\EPAS\${{ matrix.pgver }}\data\postgresql.conf"
net stop edb-as-${{ matrix.pgver }}
net start edb-as-${{ matrix.pgver }}
shell: cmd

- name: Create pgagent extension on Linux
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.pgver <= 16 }}
run: psql -U enterprisedb -d postgres -p 59${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS pgagent;'
run: psql -U enterprisedb -d postgres -p 58${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS pgagent;'

- name: Create postgis extension on Linux
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: psql -U enterprisedb -d postgres -p 59${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
run: psql -U enterprisedb -d postgres -p 58${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS postgis;'

- name: Install Python dependencies on Linux
if: ${{ matrix.os == 'ubuntu-22.04' }}
Expand Down Expand Up @@ -206,7 +191,7 @@ jobs:
"db_username": "enterprisedb",
"host": "/var/run/edb-as",
"db_password": "",
"db_port": 59${{ matrix.pgver }},
"db_port": 58${{ matrix.pgver }},
"maintenance_db": "postgres",
"sslmode": "prefer",
"tablespace_path": "/var/lib/edb-as/tablespaces/${{ matrix.pgver }}",
Expand Down Expand Up @@ -280,7 +265,7 @@ jobs:
@echo. "db_username": "enterprisedb",
@echo. "host": "127.0.0.1",
@echo. "db_password": "enterprisedb",
@echo. "db_port": 59${{ matrix.pgver }},
@echo. "db_port": 58${{ matrix.pgver }},
@echo. "maintenance_db": "postgres",
@echo. "sslmode": "prefer",
@echo. "tablespace_path": "C:\\EPAS\\${{ matrix.pgver }}\\tablespaces",
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/run-python-tests-pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,8 @@ jobs:
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
sudo su -c "echo local all all trust > /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host all all 127.0.0.1/32 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host all all ::1/128 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host replication postgres 127.0.0.1/32 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf"
sudo su -c "echo host replication postgres ::1/128 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf"
sudo sed -i "s/port = 543[0-9]/port = 59${{ matrix.pgver }}/g" /etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf
sudo sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = '\$libdir\/plugin_debugger'/g" /etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf
echo "wal_level = logical" | sudo tee -a /etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf
sudo su - postgres -c "/usr/lib/postgresql/${{ matrix.pgver }}/bin/postgres -D /var/lib/postgresql/${{ matrix.pgver }}/main -c config_file=/etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf &"

until sudo runuser -l postgres -c "pg_isready -p 59${{ matrix.pgver }}" 2>/dev/null; do
Expand All @@ -138,12 +133,7 @@ jobs:
if: ${{ matrix.os == 'macos-latest' }}
run: |
echo local all all trust > /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf
echo 'host all all 127.0.0.1/32 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf
echo 'host all all ::1/128 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf
echo 'host replication postgres 127.0.0.1/32 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf
echo 'host replication postgres ::1/128 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf
sed -i '' "s/#port = 543[0-9]/port = 59${{ matrix.pgver }}/g" /opt/homebrew/var/postgresql@${{ matrix.pgver }}/postgresql.conf
echo "wal_level = logical" >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/postgresql.conf
brew services restart postgresql@${{ matrix.pgver }}

until /opt/homebrew/opt/postgresql@${{ matrix.pgver }}/bin/pg_isready -p 59${{ matrix.pgver }} 2>/dev/null; do
Expand All @@ -153,16 +143,6 @@ jobs:

psql postgres -p 59${{ matrix.pgver }} -c 'CREATE ROLE postgres SUPERUSER LOGIN;'

- name: Start PostgreSQL on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo host replication postgres 127.0.0.1/32 trust >> "C:\PostgreSQL\${{ matrix.pgver }}\data\pg_hba.conf"
echo host replication postgres ::1/128 trust >> "C:\PostgreSQL\${{ matrix.pgver }}\data\pg_hba.conf"
echo wal_level = logical >> "C:\PostgreSQL\${{ matrix.pgver }}\data\postgresql.conf"
net stop postgresql-x64-${{ matrix.pgver }}
net start postgresql-x64-${{ matrix.pgver }}
shell: cmd

- name: Install Python dependencies on Linux and macOS
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04' }}
run: make install-python-testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ class SubscriptionView(PGChildNodeView)
# This mapping will be used PostgresSQL 16 above
streaming_mapping = {
'p': 'parallel',
't': True,
'f': False
't': 'on',
'f': 'off'
}
two_phase_mapping = {
'p': True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import BaseUISchema from 'sources/SchemaView/base_schema.ui';
import { isEmptyString } from 'sources/validators';
import _ from 'lodash';

function getDefaultStreaming(version) {
if (version >= 180000) return 'parallel';
if (version >= 160000) return 'off';
return false;
}

export default class SubscriptionSchema extends BaseUISchema{
constructor(fieldOptions={}, node_info={}, initValues={}) {
super({
Expand All @@ -26,7 +32,7 @@ export default class SubscriptionSchema extends BaseUISchema{
binary:false,
two_phase:false,
disable_on_error:false,
streaming: (node_info?.node_info?.version >= 180000) ? 'parallel' : false,
streaming: getDefaultStreaming(node_info?.node_info?.version),
password_required:true,
run_as_owner:false,
origin:'any',
Expand Down Expand Up @@ -386,24 +392,19 @@ export default class SubscriptionSchema extends BaseUISchema{
cell: 'text',
group: gettext('With'), mode: ['create', 'edit', 'properties'],
type: ()=>{
let options = [
{
'label': gettext('On'),
value: true,
},
{
'label': gettext('Off'),
value: false,
}
];

let options;
if (obj.version >= 160000) {
options.push({
'label': gettext('Parallel'),
value: 'parallel',
});
options = [
{ label: gettext('On'), value: 'on' },
{ label: gettext('Off'), value: 'off' },
{ label: gettext('Parallel'), value: 'parallel' },
];
} else {
options = [
{ label: gettext('On'), value: true },
{ label: gettext('Off'), value: false },
];
}

return {
type: 'toggle',
options: options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
CREATE SUBSCRIPTION test_create_subscription
CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer'
PUBLICATION test_pub
WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'off', binary = false, streaming = 'False', two_phase = true, disable_on_error = false, run_as_owner = true, password_required = true, origin = 'none');
WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'off', binary = false, streaming = 'parallel', two_phase = true, disable_on_error = false, run_as_owner = true, password_required = true, origin = 'none');
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER SUBSCRIPTION test_create_subscription
SET (synchronous_commit = 'off', binary = false, streaming = 'False', disable_on_error = false, origin = 'none');
SET (synchronous_commit = 'off', binary = false, streaming = 'parallel', disable_on_error = false, origin = 'none');
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
CREATE SUBSCRIPTION test_create_subscription
CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer'
PUBLICATION test_pub
WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any');
WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any');
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE SUBSCRIPTION test_create_subscription
CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 password=xxxxxx sslmode=prefer'
PUBLICATION test_pub
WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any');
WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any');
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"password": "edb",
"sync": "remote_apply",
"binary": true,
"streaming": true,
"streaming": "on",
"disable_on_error": true,
"two_phase": true,
"password_required": true,
Expand All @@ -44,7 +44,7 @@
"data": {
"sync": "off",
"binary": false,
"streaming": false,
"streaming": "parallel",
"disable_on_error": false,
"origin": "none"
},
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
-- DROP SUBSCRIPTION IF EXISTS test_create_subscription;

CREATE SUBSCRIPTION test_create_subscription
CONNECTION 'host=localhost port=5917 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer'
CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer'
PUBLICATION test_publication
WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = true);
WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false);
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
-- DROP SUBSCRIPTION IF EXISTS test_create_subscription;

CREATE SUBSCRIPTION test_create_subscription
CONNECTION 'host=localhost port=5917 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer'
CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer'
PUBLICATION test_publication
WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false);
WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE SUBSCRIPTION test_create_subscription
CONNECTION 'host=localhost port=5917 user=postgres dbname=postgres connect_timeout=10 password=xxxxxx sslmode=prefer'
CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 password=xxxxxx sslmode=prefer'
PUBLICATION test_publication
WITH (connect = true, enabled = false, copy_data = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false);
WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false);
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"endpoint": "NODE-publication.obj",
"sql_endpoint": "NODE-publication.sql_id",
"msql_endpoint": "NODE-publication.msql",
"precondition_sql": "SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription' UNION ALL SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') AND pg_create_logical_replication_slot('test_create_subscription', 'pgoutput', false) IS NOT NULL LIMIT 1;",
"data": {
"name": "test_publication",
"evnt_insert": true,
Expand All @@ -61,7 +60,7 @@
"name": "test_create_subscription",
"subowner": "postgres",
"host": "localhost",
"port": 5917,
"port": 5434,
"db": "postgres",
"username": "postgres",
"password": "postgres",
Expand All @@ -71,10 +70,10 @@
"copy_data": false,
"create_slot": false,
"enabled": false,
"connect": true,
"connect": false,
"slot_name": "test_create_subscription",
"sync": "remote_apply",
"streaming": true,
"streaming": "on",
"binary": true,
"two_phase": true,
"disable_on_error": true,
Expand All @@ -87,18 +86,6 @@
"expected_sql_file": "create_subscription.sql",
"expected_msql_file": "create_subscription_msql.sql"
},
{
"type": "alter",
"name": "Alter failover parameter of subscription",
"endpoint": "NODE-subscription.obj_id",
"sql_endpoint": "NODE-subscription.sql_id",
"msql_endpoint": "NODE-subscription.msql_id",
"data": {
"failover": true
},
"expected_sql_file": "alter_failover_parameter.sql",
"expected_msql_file": "alter_failover_parameter_msql.sql"
},
{
"type": "alter",
"name": "Alter slot_name parameter of subscription",
Expand All @@ -117,8 +104,7 @@
"endpoint": "NODE-subscription.delete_id",
"data": {
"name": "test_create_subscription"
},
"post_scenario_sql": "SELECT 1 WHERE EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') AND (SELECT pg_drop_replication_slot('test_create_subscription')) IS NOT NULL UNION ALL SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') LIMIT 1;"
}
}
]
}
Loading
Loading