Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
24e2746
Added scheduling feature
pct960 Sep 13, 2024
34a8acb
Separated jobs from schedules
pct960 Sep 16, 2024
df40eed
Added spock exception status interface to ACE
pct960 Sep 18, 2024
09c51e3
Use default factory for mutable dataclass fields
pct960 Sep 18, 2024
f407258
Add ACE as a CLI component
pct960 Oct 5, 2024
8fc4664
Added auto-repair for insert
pct960 Sep 25, 2024
e25247c
Handle quoted columns and table names
pct960 Sep 28, 2024
f4d3ebb
Handle composite keys in auto-repair
pct960 Sep 30, 2024
4efd661
Add back min freq check
pct960 Oct 17, 2024
b3b9b4d
Add support for reading from pgpass
pct960 Oct 17, 2024
cc7e93a
Use correct error message for non-existent tables
pct960 Oct 17, 2024
160b406
Updated cols query to fix permissions issue
pct960 Oct 17, 2024
18c257b
Add application_name=ACE
pct960 Oct 17, 2024
72df529
WIP adding support for bytea datatype
pct960 Oct 23, 2024
8e0cbf8
Add priv check in table-repair
pct960 Oct 24, 2024
dca5139
Close conn pool on worker exit
pct960 Nov 12, 2024
9eeaeb3
Handle bytea during table-repair
pct960 Nov 13, 2024
ecc40bb
Short-circuit if bytea column is too large (#214)
ColinLangella Nov 14, 2024
a2dc74d
Check row types before table-diff
pct960 Nov 18, 2024
6e00a1e
JSON output fix
pct960 Nov 19, 2024
930a806
Support mixed case names in priv and bytea checks
pct960 Nov 19, 2024
e05164c
Remove double checking from temptable (#215)
ColinLangella Nov 20, 2024
b9fb567
Streamlined sanity checks
pct960 Nov 21, 2024
8b155ec
Handle mixed case table and column names
pct960 Nov 21, 2024
a9203b7
Ultra-HA Update.
Nov 27, 2024
12ac3b4
Ultra-HA minor fix.
Nov 28, 2024
4e4d983
Updated JSON creation function to include public and private IP addre…
moizpgedge Nov 29, 2024
927fa8b
Merge pull request #219 from ibrarahmad/REL25_01_HA
cmotyka Dec 2, 2024
6a86663
Updating cli versions to 24.12.0
cmotyka Dec 2, 2024
6a65000
Build only current version of spock40
cmotyka Dec 2, 2024
55aea71
Handle UUID datatype columns
pct960 Dec 2, 2024
a4b09b0
Merge pull request #218 from pgEdge/branch-repair
pct960 Dec 2, 2024
64e6486
Adding simple ace tests
pct960 Dec 2, 2024
bdc7aef
Cluster.py updated
moizpgedge Dec 3, 2024
e4984a6
Update cluster.py
moizpgedge Dec 3, 2024
b4b3038
Merge pull request #221 from ibrarahmad/REL25_01_HA
cmotyka Dec 3, 2024
60b1451
wip cluster component versions
cmotyka Dec 3, 2024
5b28c50
Adding force flag
cmotyka Dec 3, 2024
bd9d41f
Merge pull request #222 from pgEdge/UHA-ver
cmotyka Dec 4, 2024
5598b42
Fixing ace version in env.sh
cmotyka Dec 4, 2024
4e8b327
fix requirements.txt
cmotyka Dec 4, 2024
d8046e5
Upd build setup
cmotyka Dec 4, 2024
02179f2
Adding pg_ver vs ver back in
cmotyka Dec 4, 2024
7266d09
Merge pull request #223 from pgEdge/UHA-ver
cmotyka Dec 4, 2024
49649aa
Bump hub to 24.12.1 and spock40 to 4.0.7
cmotyka Dec 5, 2024
7ea33e7
Merge pull request #224 from pgEdge/REL25_01
cmotyka Dec 5, 2024
c0eb5d7
add node fix and port when force
cmotyka Dec 5, 2024
6c0b0dd
Pg and Spock defaults in cluster cleanup
cmotyka Dec 5, 2024
cf9a0e4
Fix for add node replication user
cmotyka Dec 5, 2024
18d09fc
Merge pull request #225 from pgEdge/UHA-ver
cmotyka Dec 5, 2024
1b35965
Added mixed case and composite key tests
pct960 Dec 6, 2024
8e54147
Added tests for multiple datatypes
pct960 Dec 10, 2024
ace519c
Merge branch 'REL25_01' into ace-tests
pct960 Dec 10, 2024
826ea82
Added table filter option to ACE
pct960 Dec 10, 2024
986bca8
Merge pull request #220 from pgEdge/ace-tests
pct960 Dec 11, 2024
add2675
JSON fix
pct960 Dec 11, 2024
7cd9136
Merge pull request #226 from pgEdge/ace/table-filter
pct960 Dec 11, 2024
aace580
Added table filter tests
pct960 Dec 11, 2024
5450245
[ACE] Allow report with dry-run for table repair
pct960 Dec 12, 2024
ad08afa
Sort diff output json keys
pct960 Dec 13, 2024
68645b3
Added html reporting
pct960 Dec 13, 2024
3d32565
Handle new diff file format across modules
pct960 Dec 16, 2024
2ef20f9
Merge pull request #228 from pgEdge/ace/html-report
pct960 Dec 16, 2024
54c5f20
Adding option to fix nulls in table repair
pct960 Dec 16, 2024
66a08c0
Use temp tables for null repairs
pct960 Dec 17, 2024
7834a85
Add ace_readme.md
pct960 Dec 18, 2024
e0f600a
Applied cluster.patch: Fixed issues in cluster.py and related files.
Dec 19, 2024
0cf0430
Applied cluster.patch: Fixed issues in cluster.py and related files.
Dec 19, 2024
126f412
Added tests for --fix-nulls
pct960 Dec 20, 2024
18ce7f4
Merge pull request #229 from pgEdge/ace/null-repair
pct960 Dec 20, 2024
38ab09f
Make --source-of-truth optional when fixing nulls
pct960 Dec 22, 2024
0cb8287
Merge pull request #231 from pgEdge/ace/cleanup
pct960 Dec 22, 2024
61a9813
Fix false negatives from empty set differences
pct960 Dec 24, 2024
21631e2
Overhaul auth flow for client cert auth
pct960 Dec 25, 2024
969cb53
Added client cert auth for table-diff
pct960 Dec 27, 2024
731dcc2
Fix start command
pct960 Dec 31, 2024
4387b3c
More auth flow changes
pct960 Jan 2, 2025
6c818fe
Update API contracts
pct960 Jan 2, 2025
f6d6d2e
Overhaul auto repair auth flow
pct960 Jan 3, 2025
9d82e9b
Overhaul auth flow for exception status
pct960 Jan 5, 2025
f5bf16e
Add --fire_triggers option to repair
pct960 Jan 5, 2025
7516aff
Update readme.md
pct960 Jan 5, 2025
177e892
Merge pull request #232 from pgEdge/ace/cert-auth
pct960 Jan 5, 2025
081f2c6
Merge branch 'pgEdge:REL25_01' into REL25_01
moizpgedge Jan 6, 2025
bf20bd6
Update util.py
moizpgedge Jan 6, 2025
fb2222f
WIP adding cert auth tests
pct960 Jan 6, 2025
75a6832
Minor auto-repair config fix
pct960 Jan 6, 2025
3d84eac
Add repset-diff in scheduling jobs
pct960 Jan 7, 2025
6bc8cc8
Merge pull request #230 from moizpgedge/REL25_01
cmotyka Jan 7, 2025
1b53760
Merge branch 'REL25_01' into ace/cert-tests
pct960 Jan 7, 2025
1759795
Added cert auth tests for cli
pct960 Jan 7, 2025
f6a21ba
Handle privilege dropping in table-repair
pct960 Jan 8, 2025
bbdfc1a
Merge pull request #233 from pgEdge/ace/cert-tests
pct960 Jan 8, 2025
25591aa
Bumping cli,spock versions for devel
cmotyka Jan 9, 2025
f7fe880
Fix to setup, fix to cluster-ssh, wip MM function
cmotyka Jan 9, 2025
25e6367
multidb fix
cmotyka Jan 9, 2025
c261c19
remove fix
cmotyka Jan 9, 2025
d4cf7c7
Revamp schema-diff
pct960 Jan 9, 2025
d956a9d
Use correct cryptography version
pct960 Jan 9, 2025
5071acd
Minor fix in start_daemons
pct960 Jan 9, 2025
81cf342
Merge branch 'REL25_01' into ace/schema-diff
pct960 Jan 9, 2025
021cba5
Merge pull request #237 from pgEdge/ace/schema-diff
pct960 Jan 10, 2025
f1017a2
str fix
cmotyka Jan 10, 2025
687db9e
Merge pull request #236 from pgEdge/upd-setup
cmotyka Jan 10, 2025
c5bb025
Added schema-diff for tables and objects
pct960 Jan 13, 2025
c0d8ef6
Make packaging import optional
pct960 Jan 13, 2025
e667f72
Merge branch 'REL25_01' into ace/sd-tables
pct960 Jan 13, 2025
b0f2629
Merge pull request #238 from pgEdge/ace/sd-tables
pct960 Jan 13, 2025
62af235
Fix generate_report during upsert-only
pct960 Jan 13, 2025
593839d
spelling
cmotyka Jan 14, 2025
e772c91
Add support for text array types
pct960 Jan 14, 2025
4d8790d
making json-template match old call
cmotyka Jan 15, 2025
02fd51c
Merge pull request #240 from pgEdge/upd-setup
cmotyka Jan 15, 2025
fb5f3f8
backrest issue resolved
moizpgedge Jan 15, 2025
7c4d86c
Merge pull request #241 from moizpgedge/REL25_01
cmotyka Jan 15, 2025
824bfd5
fixes for json-template with force flag, changes to repset-add-table …
cmotyka Jan 16, 2025
19544d2
Merge pull request #243 from pgEdge/upd-setup
cmotyka Jan 16, 2025
06289e3
Perform deletes first during repair
pct960 Jan 17, 2025
c79cce1
backrest setup in cluster.py_init fuc
moizpgedge Jan 21, 2025
aa49deb
Updated backrest setup in cluster.py with additional changes
moizpgedge Jan 21, 2025
6484ff0
Merge pull request #245 from moizpgedge/backrest_init
cmotyka Jan 21, 2025
598a0ae
autoddl and add-db fixes in cluster module
cmotyka Jan 21, 2025
8723486
Merge pull request #246 from pgEdge/upd-setup
cmotyka Jan 21, 2025
ff01a32
Merge pull request #247 from pgEdge/REL25_01
cmotyka Jan 21, 2025
81ffe7d
repo1path in cluster init
cmotyka Jan 21, 2025
f06704d
WIP: Adding bidirectional insert
pct960 Jan 21, 2025
875a243
add-node timing fix
cmotyka Jan 21, 2025
b7b2ca0
Merge pull request #249 from pgEdge/upd-setup
cmotyka Jan 21, 2025
0009ca7
Fixed issue where replica nodes weren't starting.
bonesmoses Jan 21, 2025
6297a60
Insert-only and bidirectional inserts complete
pct960 Jan 22, 2025
f85d096
Merge pull request #250 from bonesmoses/patroni_commit_timestamp_fix
cmotyka Jan 22, 2025
1209f26
auto ddl fix
cmotyka Jan 23, 2025
591a2cd
Fix node_list issue
pct960 Jan 23, 2025
e0059f0
Use replication for tests
pct960 Jan 27, 2025
29aa868
Add tests for bdr inserts
pct960 Jan 27, 2025
fc7a544
Merge pull request #248 from pgEdge/ace/bdr-insert
pct960 Jan 27, 2025
90d4127
Fixing logging and concurrent function
cmotyka Jan 29, 2025
260adda
Re-drafted cli README to remove old links and redirect users to our d…
susan-pgedge Jan 29, 2025
a103e13
Major update in cli(cluster.py)
moizpgedge Jan 29, 2025
69490a6
Merge pull request #259 from moizpgedge/REL25_01
cmotyka Jan 29, 2025
3864310
Generate pgedge-latest-{arch}.version file carrying the latest versio…
cmotyka Feb 3, 2025
779f1c6
Bump cli version to 24.12.0
cmotyka Feb 3, 2025
b81d042
remove and add node multidb support
moizpgedge Feb 3, 2025
ae69dcb
Merge pull request #260 from moizpgedge/remove/add_node_multidb
cmotyka Feb 5, 2025
ba02fbd
Update README.md
susan-pgedge Feb 6, 2025
119fbb6
Merge pull request #258 from pgEdge/readme_update
cmotyka Feb 6, 2025
a60a4b8
Refactored scripts (that copy packages in between various pgedge buck…
hayee-bhatti Feb 6, 2025
4e5ea63
Enhance build_to_devel to ensure offline rep tgz bundle is copied with
hayee-bhatti Feb 6, 2025
057cf70
Enhanced various copy-to-bucket scripts to check for the offline bund…
hayee-bhatti Feb 6, 2025
8189374
Establish new connection per mpire worker
pct960 Feb 11, 2025
732ce96
Bump PG minor versions to 17.3, 16.7 and 15.11
cmotyka Feb 14, 2025
c1f18d7
Open Source docs for CLI (#264)
susan-pgedge Feb 18, 2025
da81eef
Use coalesce while checking column size
pct960 Feb 19, 2025
f71a94b
Readme update (#265)
susan-pgedge Feb 19, 2025
3b5ce38
Updated ACE readme (cli/scripts/ace_readme.md) to minimize content an…
susan-pgedge Feb 19, 2025
624fbfc
Ace readme update (#266)
susan-pgedge Feb 19, 2025
00ba2b5
Adding GH Actions for test automation (#257)
susan-pgedge Feb 20, 2025
9533c0e
Update LICENSE.md (#267)
susan-pgedge Feb 20, 2025
927466d
Updating copyright years in .py files (#269)
susan-pgedge Feb 20, 2025
d699d13
build 25 restored
moizpgedge Feb 27, 2025
bd73473
Merge pull request #274 from moizpgedge/build_fix
moizpgedge Feb 27, 2025
227930d
align with REL24 and new planned version
mmols Feb 28, 2025
6dc5e51
Merge pull request #275 from pgEdge/build_issue_fix
mmols Mar 4, 2025
dc8f45d
Add a wait loop in bp to ensure the Python HTTP server is up before c…
hayee-bhatti Mar 5, 2025
b3e999e
postgis build version bump to 3.5.0-2
hayee-bhatti Mar 5, 2025
4d9b8f4
Update LICENSE.md
susan-pgedge Mar 5, 2025
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
74 changes: 74 additions & 0 deletions .github/workflows/run_unit_tests_on_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Docker tests
run-name: ${{ github.actor }} is running the test schedules.
on:
push:

pull_request:


jobs:
run-scripts:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
pgver: [14, 15, 16, 17]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout cli
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up Docker
uses: docker/setup-buildx-action@v2

- name: Build Docker Image
run: |
docker build --build-arg PGVER=${{ matrix.pgver }} -t cli .

- name: Run Docker Container
run: |
docker run -d --name cli -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 cli


- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for Postgres to be ready..."
for i in {1..30}; do
if pg_isready -h localhost -p 5432 -U postgres; then
echo "PostgreSQL is ready!"
exit 0
fi
echo "PostgreSQL is not ready yet. Retrying in 5 seconds..."
sleep 5
done
echo "PostgreSQL did not become ready in time. Exiting."
exit 1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
sudo apt -y update
sudo apt install -y postgresql-client \
libpq-dev \
python3-dev \
python3-psycopg2 \
python3-dotenv

- name: Run Test Harness (runner.py)
run: |
python test/runner.py -c test/t/lib/${{ matrix.pgver }}config.env -s test/schedule_files/script_file -k
cat latest.log

- name: Upload Log File as Artifact
uses: actions/upload-artifact@v4
with:
name: latest-log-${{ matrix.pgver }}
path: latest.log
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pyc
*.orig
out/
devel/pg/src
devel/pg/1*
Expand Down
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG PGVER
FROM postgres:$PGVER-alpine

RUN apk add --no-cache \
make \
gcc \
musl-dev \
postgresql-dev \
git \
clang \
llvm

WORKDIR /home/postgres/snowflake

COPY . /home/postgres/snowflake/

#RUN USE_PGXS=1 make && USE_PGXS=1 make install

EXPOSE 5432

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["postgres"]
6 changes: 6 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------------

Copyright (c) 2025, pgEdge, Inc.

--------------------------------------------------------------------------

## pgEdge Community License Agreement 1.1

This pgEdge Community License Agreement Version 1.1 (the "**Agreement**") sets forth the terms on which pgEdge, Inc. ("**pgEdge**") makes available certain software made available by pgEdge under this Agreement (the "**Software**"). BY INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE, YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE. IF YOU ARE RECEIVING THE SOFTWARE ON BEHALF OF A LEGAL ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE THE ACTUAL AUTHORITY TO AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT ON BEHALF OF SUCH ENTITY. "**Licensee**" means you, an individual, or the entity on whose behalf you are receiving the Software.
Expand Down
75 changes: 62 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,75 @@
# The CLI for pgEdge
# The Command Line Interface (CLI)

This is the pgEdge Command Line Interface (CLI) for managing components.
Take a look at our main pgEdge [repo](https://github.com/pgEdge/pgedge) for tips and example CLI commands.
This is the Command Line Interface (CLI) for managing components.

You can also peruse our [CHANGELOG](https://github.com/pgEdge/pgedge/blob/main/CHANGELOG.md) if you'd like to learn more about our recent enhancements and fixes.
## Table of Contents
- [Creating a Development Environment](README.md#creating-a-development-environment)
- [CLI Functions](docs/cli_functions.md)
- [Tutorials](docs/tutorials.md)
- [Release Notes](docs/cli_release_notes.md)

# Using the CLI to control a pgEdge cluster
### Prerequisites

Get started quickly by taking a look at our [tutorials](https://github.com/pgEdge/pgedge/tree/main/cli/tutorials) to create your own localhost or vm cluster.
On each machine that will host a replication node, you must:

Check out our [commands](https://github.com/pgEdge/pgedge/tree/main?tab=readme-ov-file#cli-commands) to learn more about our multi-master power at your fingertips. :-)
* Open any firewalls that could obstruct access between your servers.
* Set SELinux to `permissive` or `disabled` mode on each host, followed by a system reboot.
* Configure [passwordless sudo access](#configuring-passwordless-sudo) for a non-root OS user on each host.
* Configure [passwordless ssh](#configuring-passwordless-ssh) access for the same non-root OS user on each host.

### Creating a Development Environment
After meeting the prerequisites:

# To setup a dev environment:
1.) Clone this repository.

1.) Clone this repo
2.) Move into the setup directory: `cd cli/devel/setup`

2.) cd cli/devel/setup
3.) Run the setup scripts: `./10-toolset.sh` through `30-bashrc.sh`

3.) run `./1-cli.sh`
4.) Source the `~/.bashrc` file.

4.) configure your ~/.aws/config credentials
5.) Run `40-awscli.sh` to install AWS in a virtual environment.

5.) run `1d-pull-IN.sh` to retrieve REPO files
6.) Configure your `~/.aws/config` credentials.

7.) Run `50-pull-IN.sh` to retrieve the REPO files.

### Using the CLI

When using the CLI, you should ensure that you:

**Include a Primary Key in Each Table**

All tables must include a primary key; this allows pgEdge to replicate `INSERT`, `UPDATE`, and `DELETE` statements. If your table does not include a primary key, only `INSERT` statements will be replicated to the table.

**Use Snowflake Sequences instead of PostgreSQL sequences**

If you use a PostgreSQL sequence as part of your primary key, you should convert your sequences to [Snowflake sequences](https://github.com/pgEdge/snowflake). Snowflake sequences are composed of multiple data types that ensure a unique transaction sequence when processing your data in multiple regions. This helps accurately preserve the order in which globally distributed transactions are performed, and alleviates concerns that network lag could disrupt sequences in distributed transactions.

**Include the ENABLE ALWAYS clause in Triggers**

PostgreSQL triggers will fire only from the node on which they were invoked. If you have triggers that are related to the replication process, you should include the `ENABLE ALWAYS` clause when attaching a trigger to a table:

```
CREATE TRIGGER ins_trig AFTER INSERT ON my_table FOR EACH ROW EXECUTE PROCEDURE ins_history();
ALTER TABLE trans_history ENABLE ALWAYS TRIGGER ins_trig;
```

#### Configuring Passwordless SSH

You can use the following steps to configure passwordless SSH on each node of the replication cluster:

```sh
ssh-keygen -t rsa
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys
```

#### Configuring Passwordless sudo

To configure passwordless sudo, open the /etc/sudoers file, and add a line of the form:

%username ALL = (ALL) NOPASSWD: ALL

Where `username` specifies the name of your operating system user.
9 changes: 8 additions & 1 deletion bp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ if [ -d $outp ]; then
fi

./devel/startHTTP.sh
./build.sh -X posix -R

echo "Waiting for Python HTTP server to start..."
while ! nc -z localhost 8000; do
sleep 1 # Check every second
done

echo "HTTP server is up!"

./build.sh -X posix -R
cd $outp

./$api set GLOBAL REPO http://localhost:8000
Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ initPG () {
initC "lolor-pg$pgM" "lolor" "$lolorV" "$outPlat" "postgres/lolor" "" "" "nil"
initC "snowflake-pg$pgM" "snowflake" "$snwflkV" "$outPlat" "postgres/snowflake" "" "" "nil"
initC "spock40-pg$pgM" "spock40" "$spock40V" "$outPlat" "postgres/spock40" "" "" "nil"
initC "spock40-pg$pgM" "spock40" "$spock40V1" "$outPlat" "postgres/spock40" "" "" "nil"
fi

if [ "$pgM" \> "13" ] && [ "$pgM" \< "17" ]; then
Expand Down
2 changes: 1 addition & 1 deletion cli/scripts/ConsoleLogger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright 2022-2024 PGEDGE All rights reserved. #
# Copyright 2022-2025 PGEDGE All rights reserved. #

import os
import sys
Expand Down
14 changes: 14 additions & 0 deletions cli/scripts/ace-tests/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[run]
source = hub/scripts
omit =
*/tests/*
*/__init__.py
*/ace-tests/*

[report]
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError
if __name__ == .__main__.:
pass
Loading