Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pg_version: [17, 18]
pg_version: [16, 17, 18]
os: [ubuntu-24.04]
compiler: [gcc, clang]
build_type: [debugoptimized]
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pg_version: [17, 18]
pg_version: [16, 17, 18]
os: [ubuntu-24.04-arm]
compiler: [gcc, clang]
build_type: [debugoptimized]
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To build `pg_tde` from source code, you require the following:
* git
* Meson or make
* gcc or clang
* Percona Server for PostgreSQL 17 or later
* Percona Server for PostgreSQL 16 or later

Refer to the [Building from source code](https://github.com/percona/pg_tde?tab=readme-ov-file#building-from-sources-for-community-postgresql) section for guidelines.

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ OBJS = \
TDE_XLOG_OBJS = src/access/pg_tde_xlog_smgr.frontend

TDE_OBJS = \
src/pg_tde_fe.frontend \
src/access/pg_tde_tdemap.frontend \
src/catalog/tde_keyring.frontend \
src/access/pg_tde_xlog_keys.frontend \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Transparent Data Encryption offers encryption at the file level and solves the p

This access method:

- Works only with [Percona Server for PostgreSQL 17](https://docs.percona.com/postgresql/17/postgresql-server.html) or [Percona Server for PostgreSQL 18](https://docs.percona.com/postgresql/18/postgresql-server.html)
- Works only with ??? , [Percona Server for PostgreSQL 17](https://docs.percona.com/postgresql/17/postgresql-server.html) or [Percona Server for PostgreSQL 18](https://docs.percona.com/postgresql/18/postgresql-server.html)
- Uses extended Storage Manager and WAL APIs
- Encrypts tuples, WAL and indexes
- It **does not** encrypt temporary files and statistics **yet**
Expand Down
20 changes: 16 additions & 4 deletions ci_scripts/build-and-install-psp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@ SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
INSTALL_DIR="$SCRIPT_DIR/../../pginst"
PSP_DIR="$SCRIPT_DIR/../../postgres"

PG_VERSION=$(pg_config --version | sed -n 's/PostgreSQL \([0-9]*\).*/\1/p')

INSTALL_INJECTION_POINTS=0

case "$1" in
debug)
echo "Building with debug option"
ARGS+=" --enable-cassert --enable-injection-points"
ARGS+=" --enable-cassert"
INSTALL_INJECTION_POINTS=1
;;

debugoptimized)
echo "Building with debugoptimized option"
export CFLAGS="-O2"
ARGS+=" --enable-cassert --enable-injection-points"
ARGS+=" --enable-cassert"
INSTALL_INJECTION_POINTS=1
;;

coverage)
echo "Building with coverage option"
ARGS+=" --enable-injection-points --enable-coverage"
ARGS+=" --enable-coverage"
INSTALL_INJECTION_POINTS=1
;;

Expand All @@ -42,8 +44,18 @@ case "$1" in
;;
esac

if [ "$PG_VERSION" -lt 17 ]; then
INSTALL_INJECTION_POINTS=0
fi

if [ "$INSTALL_INJECTION_POINTS" = 1 ]; then
ARGS+=" --enable-injection-points"
fi

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
ARGS+=" --with-liburing"
if [ "$PG_VERSION" -ge 17 ]; then
ARGS+=" --with-liburing"
fi
NCPU=$(nproc)
elif [[ "$OSTYPE" == "darwin"* ]]; then
NCPU=$(sysctl -n hw.ncpu)
Expand Down
54 changes: 54 additions & 0 deletions fetools/pg16/include/backup/backup_manifest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*-------------------------------------------------------------------------
*
* backup_manifest.h
* Routines for generating a backup manifest.
*
* Portions Copyright (c) 2010-2023, PostgreSQL Global Development Group
*
* src/include/backup/backup_manifest.h
*
*-------------------------------------------------------------------------
*/
#ifndef BACKUP_MANIFEST_H
#define BACKUP_MANIFEST_H

#include "backup/basebackup_sink.h"
#include "common/checksum_helper.h"
#include "pgtime.h"
#include "storage/buffile.h"

typedef enum manifest_option
{
MANIFEST_OPTION_YES,
MANIFEST_OPTION_NO,
MANIFEST_OPTION_FORCE_ENCODE
} backup_manifest_option;

typedef struct backup_manifest_info
{
BufFile *buffile;
pg_checksum_type checksum_type;
pg_cryptohash_ctx *manifest_ctx;
uint64 manifest_size;
bool force_encode;
bool first_file;
bool still_checksumming;
} backup_manifest_info;

extern void InitializeBackupManifest(backup_manifest_info *manifest,
backup_manifest_option want_manifest,
pg_checksum_type manifest_checksum_type);
extern void AddFileToBackupManifest(backup_manifest_info *manifest,
const char *spcoid,
const char *pathname, size_t size,
pg_time_t mtime,
pg_checksum_context *checksum_ctx);
extern void AddWALInfoToBackupManifest(backup_manifest_info *manifest,
XLogRecPtr startptr,
TimeLineID starttli, XLogRecPtr endptr,
TimeLineID endtli);

extern void SendBackupManifest(backup_manifest_info *manifest, bbsink *sink);
extern void FreeBackupManifest(backup_manifest_info *manifest);

#endif
39 changes: 39 additions & 0 deletions fetools/pg16/include/backup/basebackup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*-------------------------------------------------------------------------
*
* basebackup.h
* Exports from replication/basebackup.c.
*
* Portions Copyright (c) 2010-2023, PostgreSQL Global Development Group
*
* src/include/backup/basebackup.h
*
*-------------------------------------------------------------------------
*/
#ifndef _BASEBACKUP_H
#define _BASEBACKUP_H

#include "nodes/replnodes.h"

/*
* Minimum and maximum values of MAX_RATE option in BASE_BACKUP command.
*/
#define MAX_RATE_LOWER 32
#define MAX_RATE_UPPER 1048576

/*
* Information about a tablespace
*
* In some usages, "path" can be NULL to denote the PGDATA directory itself.
*/
typedef struct
{
char *oid; /* tablespace's OID, as a decimal string */
char *path; /* full path to tablespace's directory */
char *rpath; /* relative path if it's within PGDATA, else
* NULL */
int64 size; /* total size as sent; -1 if not known */
} tablespaceinfo;

extern void SendBaseBackup(BaseBackupCmd *cmd);

#endif /* _BASEBACKUP_H */
Loading
Loading