Skip to content

Commit

Permalink
Release v0.11. (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri authored Mar 15, 2023
1 parent ef5dcaa commit 1da087e
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 88 deletions.
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
### pgcopydb v0.11 (March 15, 2023) ###

This release introduces support for the Postgres code logical decoding
plugin test_decoding in addition to wal2json, and also introduces the fully
automated switch from prefetch and catchup replication to live streaming.

More features are added such as support for skipping collations, support for
skipping role passwords, a feature to cache the `pg_table_size()` results
and avoid re-computing it again when doing more than one migration with
pgcopydb, and the new `pgcopydb ping` command.

This release also contains the usual amount of bug fixes and improvements,
code refactoring, etc.

### Added
* Automatically switch from prefetch/catchup to live replay mode. (#199)
* Implement pgcopydb stream replay. (#196)
* Implement support for --no-role-passwords. (#205)
* Implement "live" streaming of changes from source to target. (#185)
* Implement new command: pgcopydb ping (#191)
* Support unlogged tables for data copy (#183)
* Implement --skip-collations. (#160)
* Implement support for logical decoding plugin test_decoding. (#156)
* Implement pgcopydb list tables --drop-cache. (#150)
* Implement an option to cache pg_table_size() results. (#146)

### Changed
* Refactor our internal representation for Logical Messages. (#198)
* Refactor our clone --follow implementation. (#197)
* Refactor the transform process management. (#194)
* When streaming into a JSON file, write to a partial file first. (#187)
* When transforming into a SQL file, write to a partial file first. (#186)
* Arrange to use Logical Replication protocol metadata. (#155)
* Refrain from using wal2json computed column "nextlsn". (#151)

### Fixed
* Fix internal return value that prevented error handling. (#204)
* Avoid using stdin/stdout/stderr as variable names (#193)
* Refactor debugParameters string building to use PQExpBuffer. (#190)
* Fix same-table-copy query to use cached pgcopydb.table_size. (#184)
* Fix stream_read_context retry loop. (#181)
* Fix `dir` of stream cleanup and do cleanup for other commands. (#178)
* Fix huge memory allocations copydb_prepare_table_specs. (#175)
* Fix the SQL query that retrieves the column name for partitioning. (#176)
* Fix `lsn` for KEEPALIVE action. (#164)
* Blind fix attempt for a reported segfault. (#173)
* Error out early when work dir does not exists and is expected to. (#171)
* Trivial: Write index OIDs as unsigned integers correctly to the summary file & fix partitioning for tables with bigint primary keys with values gre>
* Fix transform process to handle endpos in between transactions. (#166)
* One of our syscalls (to mkdir) failed to include the OS error message. (#162)
* Fix migration failure of an empty database with --drop-if-exists. (#152)
* Adding dir option pgcopydb list progress command (#148)

### Packaging fixes
* Fix debian B-D in our debian build Dockerfiles. (#145)

### pgcopydb v0.10 (November 3, 2022) ###

Bug fix release, with added compatibility to Postgres 9.5, 9.6 and 10.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COPY ./src ./src/
COPY ./docs ./docs/

WORKDIR /usr/src
RUN tar czf pgcopydb_0.10.orig.tar.gz pgcopydb
RUN tar czf pgcopydb_0.11.orig.tar.gz pgcopydb

WORKDIR /usr/src/pgcopydb

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.debian-qa
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM debian:sid

ENV TAR v0.10.tar.gz
ENV ORIG pgcopydb_0.10.orig.tar.gz
ENV WORKDIR /usr/src/pgcopydb-0.10
ENV TAR v0.11.tar.gz
ENV ORIG pgcopydb_0.11.orig.tar.gz
ENV WORKDIR /usr/src/pgcopydb-0.11
ENV ARCHIVE https://github.com/dimitri/pgcopydb/archive/refs/tags/
ENV RELEASE ${ARCHIVE}${TAR}

Expand Down
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=0.10
DEF_VER=0.11

LF='
'
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ $ pgcopydb help
clone Clone an entire database from source to target
fork Clone an entire database from source to target
follow Replay changes from the source database to the target database
copy-db Copy an entire database from source to target
copy-db Clone an entire database from source to target
snapshot Create and exports a snapshot on the source database
+ copy Implement the data section of the database copy
+ dump Dump database objects from a Postgres instance
+ restore Restore database objects into a Postgres instance
+ list List database objects from a Postgres instance
+ stream Stream changes from the source database
ping Copy the roles from the source instance to the target instance
help print help message
version print pgcopydb version
Expand Down Expand Up @@ -86,6 +87,7 @@ $ pgcopydb help
pgcopydb list
extensions List all the source extensions to copy
collations List all the source collations to copy
tables List all the source tables to copy data from
table-parts List a source table copy partitions
sequences List all the source sequences to copy data from
Expand All @@ -99,6 +101,7 @@ $ pgcopydb help
cleanup cleanup source and target systems for logical decoding
prefetch Stream JSON changes from the source database and transform them to SQL
catchup Apply prefetched changes from SQL files to the target database
replay Replay changes from the source to the target database, live
+ create Create resources needed for pgcopydb
+ drop Drop resources needed for pgcopydb
+ sentinel Maintain a sentinel table on the source database
Expand Down Expand Up @@ -204,7 +207,7 @@ Several distributions are available for pgcopydb:
version currently in debian stable.

```
$ docker run --rm -it dimitri/pgcopydb:v0.10 pgcopydb --version
$ docker run --rm -it dimitri/pgcopydb:v0.11 pgcopydb --version
```

Or you can use the CI/CD integration that publishes packages from the
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
pgcopydb (0.11-1) unstable; urgency=medium

* Official 0.11 release of pgcopydb

-- Dimitri Fontaine <[email protected]> Wed, 15 Mar 2023 13:42:58 +0100

pgcopydb (0.10-1) unstable; urgency=medium

* B-D on libzstd-dev. (Closes: #1022290)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
author = 'Dimitri Fontaine'

# The full version, including alpha/beta/rc tags
version = '0.10'
release = '0.10'
version = '0.11'
release = '0.11'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ stable.

To use this docker image::

$ docker run --rm -it dimitri/pgcopydb:v0.10 pgcopydb --version
$ docker run --rm -it dimitri/pgcopydb:v0.11 pgcopydb --version

__ https://hub.docker.com/r/dimitri/pgcopydb#!

Expand Down
161 changes: 84 additions & 77 deletions docs/ref/pgcopydb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,83 +47,90 @@ The ``pgcopydb help`` command lists all the supported sub-commands:

::

pgcopydb pgcopydb help
pgcopydb
clone Clone an entire database from source to target
fork Clone an entire database from source to target
follow Replay changes from the source database to the target database
copy-db Copy an entire database from source to target
snapshot Create and exports a snapshot on the source database
+ copy Implement the data section of the database copy
+ dump Dump database objects from a Postgres instance
+ restore Restore database objects into a Postgres instance
+ list List database objects from a Postgres instance
+ stream Stream changes from the source database
help print help message
version print pgcopydb version

pgcopydb copy
db Copy an entire database from source to target
roles Copy the roles from the source instance to the target instance
schema Copy the database schema from source to target
data Copy the data section from source to target
table-data Copy the data from all tables in database from source to target
blobs Copy the blob data from ther source database to the target
sequences Copy the current value from all sequences in database from source to target
indexes Create all the indexes found in the source database in the target
constraints Create all the constraints found in the source database in the target

pgcopydb dump
schema Dump source database schema as custom files in work directory
pre-data Dump source database pre-data schema as custom files in work directory
post-data Dump source database post-data schema as custom files in work directory
roles Dump source database roles as custome file in work directory

pgcopydb restore
schema Restore a database schema from custom files to target database
pre-data Restore a database pre-data schema from custom file to target database
post-data Restore a database post-data schema from custom file to target database
roles Restore database roles from SQL file to target database
parse-list Parse pg_restore --list output from custom file

pgcopydb list
tables List all the source tables to copy data from
table-parts List a source table copy partitions
sequences List all the source sequences to copy data from
indexes List all the indexes to create again after copying the data
depends List all the dependencies to filter-out

pgcopydb stream
setup Setup source and target systems for logical decoding
cleanup cleanup source and target systems for logical decoding
prefetch Stream JSON changes from the source database and transform them to SQL
catchup Apply prefetched changes from SQL files to the target database
+ create Create resources needed for pgcopydb
+ drop Drop resources needed for pgcopydb
+ sentinel Maintain a sentinel table on the source database
receive Stream changes from the source database
transform Transform changes from the source database into SQL commands
apply Apply changes from the source database into the target database

pgcopydb stream create
slot Create a replication slot in the source database
origin Create a replication origin in the target database

pgcopydb stream drop
slot Drop a replication slot in the source database
origin Drop a replication origin in the target database

pgcopydb stream sentinel
create Create the sentinel table on the source database
drop Drop the sentinel table on the source database
get Get the sentinel table values on the source database
+ set Maintain a sentinel table on the source database

pgcopydb stream sentinel set
startpos Set the sentinel start position LSN on the source database
endpos Set the sentinel end position LSN on the source database
apply Set the sentinel apply mode on the source database
prefetch Set the sentinel prefetch mode on the source database
$ pgcopydb help
pgcopydb
clone Clone an entire database from source to target
fork Clone an entire database from source to target
follow Replay changes from the source database to the target database
copy-db Clone an entire database from source to target
snapshot Create and exports a snapshot on the source database
+ copy Implement the data section of the database copy
+ dump Dump database objects from a Postgres instance
+ restore Restore database objects into a Postgres instance
+ list List database objects from a Postgres instance
+ stream Stream changes from the source database
ping Copy the roles from the source instance to the target instance
help print help message
version print pgcopydb version

pgcopydb copy
db Copy an entire database from source to target
roles Copy the roles from the source instance to the target instance
extensions Copy the extensions from the source instance to the target instance
schema Copy the database schema from source to target
data Copy the data section from source to target
table-data Copy the data from all tables in database from source to target
blobs Copy the blob data from ther source database to the target
sequences Copy the current value from all sequences in database from source to target
indexes Create all the indexes found in the source database in the target
constraints Create all the constraints found in the source database in the target

pgcopydb dump
schema Dump source database schema as custom files in work directory
pre-data Dump source database pre-data schema as custom files in work directory
post-data Dump source database post-data schema as custom files in work directory
roles Dump source database roles as custome file in work directory

pgcopydb restore
schema Restore a database schema from custom files to target database
pre-data Restore a database pre-data schema from custom file to target database
post-data Restore a database post-data schema from custom file to target database
roles Restore database roles from SQL file to target database
parse-list Parse pg_restore --list output from custom file

pgcopydb list
extensions List all the source extensions to copy
collations List all the source collations to copy
tables List all the source tables to copy data from
table-parts List a source table copy partitions
sequences List all the source sequences to copy data from
indexes List all the indexes to create again after copying the data
depends List all the dependencies to filter-out
schema List the schema to migrate, formatted in JSON
progress List the progress

pgcopydb stream
setup Setup source and target systems for logical decoding
cleanup cleanup source and target systems for logical decoding
prefetch Stream JSON changes from the source database and transform them to SQL
catchup Apply prefetched changes from SQL files to the target database
replay Replay changes from the source to the target database, live
+ create Create resources needed for pgcopydb
+ drop Drop resources needed for pgcopydb
+ sentinel Maintain a sentinel table on the source database
receive Stream changes from the source database
transform Transform changes from the source database into SQL commands
apply Apply changes from the source database into the target database

pgcopydb stream create
slot Create a replication slot in the source database
origin Create a replication origin in the target database

pgcopydb stream drop
slot Drop a replication slot in the source database
origin Drop a replication origin in the target database

pgcopydb stream sentinel
create Create the sentinel table on the source database
drop Drop the sentinel table on the source database
get Get the sentinel table values on the source database
+ set Maintain a sentinel table on the source database

pgcopydb stream sentinel set
startpos Set the sentinel start position LSN on the source database
endpos Set the sentinel end position LSN on the source database
apply Set the sentinel apply mode on the source database
prefetch Set the sentinel prefetch mode on the source database

pgcopydb version
----------------
Expand Down
2 changes: 1 addition & 1 deletion src/bin/pgcopydb/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "git-version.h"

/* additional version information for printing version on CLI */
#define PGCOPYDB_VERSION "0.10"
#define PGCOPYDB_VERSION "0.11"

#ifdef GIT_VERSION
#define VERSION_STRING GIT_VERSION
Expand Down

0 comments on commit 1da087e

Please sign in to comment.