Skip to content

Commit

Permalink
v0.7.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmaetz committed Feb 7, 2024
1 parent 54e4f63 commit 6c88249
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ docker/postgres-stage
docker/postgres-oracle
docker/newpg
docker/benchmark
docker/pgbackrest-old
docker/pgbackrest-old

#FerretDB
docker/ferretdb
ferretdb
launcher/ferretdb

#Exporter_v2
docker/exporter_v2
launcher/exporter_v2
6 changes: 5 additions & 1 deletion scripts/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ def deep_update(a, b):
max_connections: {{postgresql.parameters.max_connections}}
max_replication_slots: 10
hot_standby: 'on'
password_encryption: 'scram-sha-256'
tcp_keepalives_idle: 900
tcp_keepalives_interval: 100
log_line_prefix: '%t [%p]: [%l-1] %c %x %d %u %a %h '
Expand Down Expand Up @@ -258,6 +257,8 @@ def deep_update(a, b):
- encoding: UTF8
- locale: {{INITDB_LOCALE}}.UTF-8
- data-checksums
- locale-provider: icu
- icu-locale: {{INITDB_LOCALE}}
{{#USE_ADMIN}}
users:
{{PGUSER_ADMIN}}:
Expand Down Expand Up @@ -588,6 +589,7 @@ def get_placeholders(provider):
placeholders.setdefault('CLONE_TARGET_TIME', '')
placeholders.setdefault('CLONE_TARGET_INCLUSIVE', True)

placeholders.setdefault('LOG_GROUP_BY_DATE', False)
placeholders.setdefault('LOG_SHIP_SCHEDULE', '1 0 * * *')
placeholders.setdefault('LOG_S3_BUCKET', '')
placeholders.setdefault('LOG_S3_ENDPOINT', '')
Expand Down Expand Up @@ -766,6 +768,8 @@ def write_log_environment(placeholders):
log_env['LOG_AWS_REGION'] = aws_region

log_s3_key = 'spilo/{LOG_BUCKET_SCOPE_PREFIX}{SCOPE}{LOG_BUCKET_SCOPE_SUFFIX}/log/'.format(**log_env)
if os.getenv('LOG_GROUP_BY_DATE'):
log_s3_key += '{DATE}/'
log_s3_key += placeholders['instance_data']['id']
log_env['LOG_S3_KEY'] = log_s3_key

Expand Down
20 changes: 0 additions & 20 deletions scripts/post_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,6 @@ ALTER EXTENSION set_user UPDATE;
# GRANT EXECUTE ON FUNCTION public.set_user(text) TO admin;
# GRANT EXECUTE ON FUNCTION public.pg_stat_statements_reset($RESET_ARGS) TO admin;"


# CPO-Monitoring
echo "GRANT pg_monitor TO cpo_exporter;
GRANT SELECT ON TABLE pg_authid TO cpo_exporter;";

# Structure

echo "CREATE SCHEMA IF NOT EXISTS exporter;
ALTER SCHEMA exporter OWNER TO cpo_exporter;
CREATE EXTENSION IF NOT EXISTS pgnodemx with SCHEMA exporter;
alter extension pgnodemx UPDATE;
CREATE TABLE exporter.pgbackrestbackupinfo (
name text NOT NULL,
data jsonb NOT NULL,
data_time timestamp with time zone DEFAULT now() NOT NULL
)
WITH (autovacuum_analyze_scale_factor='0', autovacuum_vacuum_scale_factor='0', autovacuum_vacuum_threshold='2', autovacuum_analyze_threshold='2');
ALTER TABLE exporter.pgbackrestbackupinfo OWNER TO cpo_exporter;";

done < <(psql -d "$2" -tAc 'select pg_catalog.quote_ident(datname) from pg_catalog.pg_database where datallowconn')
) | PGOPTIONS="-c synchronous_commit=local" psql -Xd "$2"

0 comments on commit 6c88249

Please sign in to comment.