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
101 changes: 101 additions & 0 deletions .github/workflows/test-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: pgactive PG-Master CI
on:
#schedule:
# # Runs every day at 5am.
# - cron: '0 5 * * *'
#push:
# paths-ignore:
# - 'docs/**'
#pull_request:
# paths-ignore:
# - 'docs/**'
workflow_dispatch:
jobs:
test:
defaults:
run:
shell: sh

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
version: [
master
]

runs-on: ${{ matrix.os }}
timeout-minutes: 120

steps:
- name: Checkout pgactive
uses: actions/checkout@v4
with:
path: pgactive

- name: Checkout Postgres
run: |
sudo apt-get -y -q install libipc-run-perl build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libxml2-utils xsltproc ccache pkg-config libicu-dev
git clone --depth 1 --branch ${{ matrix.version }} https://github.com/postgres/postgres.git

- if: ${{ matrix.version == 'REL_11_STABLE' }}
name: Apply per-test-script runtime display patch (REL_11_STABLE only)
run: |
cd postgres
git apply $GITHUB_WORKSPACE/pgactive/src/compat/11/v1-0001-Add-per-test-script-runtime-display-to-pg_regress.patch
git status

- name: Build Postgres
run: |
cd $GITHUB_WORKSPACE/postgres
sh configure --prefix=$PWD/inst/ --enable-debug --enable-cassert --enable-tap-tests CFLAGS="-ggdb3 -O0"
make -j4 install

# Install extensions required for pgactive tests
make -C contrib/btree_gist install
make -C contrib/cube install
make -C contrib/hstore install
make -C contrib/pg_trgm install

- name: Check pgactive code indentation
run: |
cd $GITHUB_WORKSPACE/pgactive
ls -1 src/compat/??/pg_dump/*.[ch] >$GITHUB_WORKSPACE/postgres/pgindent.ignore

cd $GITHUB_WORKSPACE/postgres
make -C src/tools/pg_bsd_indent/ -j4 install
src/tools/pgindent/pgindent --indent=$GITHUB_WORKSPACE/postgres/src/tools/pg_bsd_indent/pg_bsd_indent --excludes=pgindent.ignore --diff $GITHUB_WORKSPACE/pgactive > pgindent.diffs
test -s pgindent.diffs && cat pgindent.diffs && exit 1 || exit 0

- name: Build pgactive
run: |
cd pgactive
PATH=$GITHUB_WORKSPACE/postgres/inst/bin:"$PATH"
sh configure
make PROFILE="-Wall -Wmissing-prototypes -Werror=maybe-uninitialized -Werror" -j1 all install

- name: Run pgactive core tests
run: |
cd pgactive
make regress_check

- name: Show pgactive core tests diff
if: ${{ failure() }}
run: |
cat pgactive/test/regression.diffs

- name: Run pgactive extended tests
run: |
cd pgactive
make PROVE_FLAGS="--timer -v" prove_check

- name: Upload test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-artifact-${{ matrix.os }}-${{ matrix.version }}
path: |
postgres/pgindent.diffs
pgactive/test/regression.diffs
pgactive/test/tmp_check/log
retention-days: 1
16 changes: 0 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,6 @@ jobs:
make -C contrib/hstore install
make -C contrib/pg_trgm install

- if: ${{ matrix.version == 'REL_17_STABLE' }}
name: Check pgactive code indentation (REL_17_STABLE only)
run: |
cd postgres
make -C src/tools/pg_bsd_indent/ -j4 install
cat << EOF >> pgindent.ignore
src/compat/13/pg_dump/*
src/compat/14/pg_dump/*
src/compat/15/pg_dump/*
src/compat/16/pg_dump/*
src/compat/17/pg_dump/*
src/compat/18/pg_dump/*
EOF
src/tools/pgindent/pgindent --indent=$GITHUB_WORKSPACE/postgres/src/tools/pg_bsd_indent/pg_bsd_indent --excludes=pgindent.ignore --diff $GITHUB_WORKSPACE/pgactive > pgindent.diffs
test -s pgindent.diffs && cat pgindent.diffs && exit 1 || exit 0

- name: Build pgactive
run: |
cd pgactive
Expand Down
22 changes: 16 additions & 6 deletions include/pgactive.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
#include "pgactive_compat.h"
#include "nodes/execnodes.h"

/* pg_fallthrough was introduced in PG 19 (c.h) */
#ifndef pg_fallthrough
#if __has_attribute(fallthrough)
#define pg_fallthrough __attribute__((fallthrough))
#else
#define pg_fallthrough
#endif
#endif

#define NODEID_BITS 10
#define MAX_NODE_ID ((1 << NODEID_BITS) - 1)

Expand Down Expand Up @@ -446,11 +455,12 @@ extern bool pgactive_log_conflicts_to_table;
extern bool pgactive_log_conflicts_to_logfile;
extern bool pgactive_conflict_logging_include_tuples;

/* replaced by pgactive_skip_ddl_replication for now
extern bool pgactive_permit_ddl_locking;
extern bool pgactive_permit_unsafe_commands;
extern bool pgactive_skip_ddl_locking;
*/
/*
* replaced by pgactive_skip_ddl_replication for now
* extern bool pgactive_permit_ddl_locking;
* extern bool pgactive_permit_unsafe_commands;
* extern bool pgactive_skip_ddl_locking;
*/
extern bool pgactive_skip_ddl_replication;
extern bool prev_pgactive_skip_ddl_replication;
extern bool pgactive_do_not_replicate;
Expand Down Expand Up @@ -774,7 +784,7 @@ extern struct pg_conn *pgactive_establish_connection_and_slot(const char *dsn,
const char *application_name_suffix,
Name out_slot_name,
pgactiveNodeId * out_nodeid,
RepOriginId *out_rep_origin_id,
RepOriginId * out_rep_origin_id,
char *out_snapshot);

extern PGconn *pgactive_connect_nonrepl(const char *connstring,
Expand Down
Loading
Loading