-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This also adds a slighly modified sysbench to the repository, which creates encrypted tables, and modifies the debug message default to 0.
- Loading branch information
Showing
15 changed files
with
1,658 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: postgresql-16-src-meson-perf | ||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
name: pg-16-src-meson-test | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
|
||
- name: Remove old postgres | ||
run: | | ||
sudo apt purge postgresql-client-common postgresql-common \ | ||
postgresql postgresql* | ||
sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \ | ||
/usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \ | ||
/etc/postgresql | ||
sudo rm -f /usr/bin/pg_config | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libreadline6-dev systemtap-sdt-dev \ | ||
zlib1g-dev libssl-dev libpam0g-dev bison flex \ | ||
libipc-run-perl -y docbook-xsl docbook-xsl libxml2 libxml2-utils \ | ||
libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \ | ||
libsystemd-dev gettext tcl-dev libperl-dev pkg-config clang-11 \ | ||
llvm-11 llvm-11-dev libselinux1-dev python3-dev \ | ||
uuid-dev liblz4-dev meson ninja-build libjson-c-dev \ | ||
sysbench | ||
sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN' | ||
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim' | ||
- name: Clone postgres repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'postgres/postgres' | ||
ref: 'a81e5516fa4bc53e332cb35eefe231147c0e1749' | ||
path: 'src' | ||
|
||
- name: Clone postgres-tde-ext repository | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'src/contrib/postgres-tde-ext' | ||
|
||
- name: Include postgres-tde-ext in meson build | ||
run: | | ||
echo "subdir('postgres-tde-ext')" >> src/contrib/meson.build | ||
- name: Build postgres | ||
run: | | ||
meson setup build --prefix `pwd`/../inst --buildtype=release | ||
cd build && ninja && ninja install | ||
working-directory: src | ||
|
||
- name: Test postgres-tde-ext | ||
run: | | ||
cp ../contrib/postgres-tde-ext/keyring.json /tmp/keyring.json | ||
meson test --suite setup -v | ||
meson test --suite postgres-tde-ext -v --num-processes 1 | ||
working-directory: src/build | ||
|
||
- name: Report on test fail | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
name: Regressions diff and postgresql log | ||
path: | | ||
src/build/testrun/postgres-tde-ext/regress/ | ||
retention-days: 3 | ||
|
||
- name: Setup test environment | ||
run: | | ||
bin/initdb -D data | ||
bin/pg_ctl -D data start | ||
bin/createdb sbtest | ||
bin/createdb sbtest2 | ||
cp -r ../src/contrib/postgres-tde-ext/sysbench . | ||
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_insert.lua --tables=1 --table-size=100000 --pgsql-db=sbtest prepare | ||
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_common_tde.lua --tables=1 --table-size=100000 --pgsql-db=sbtest2 prepare | ||
#sysbench --db-driver=pgsql --threads=1 --pgsql-user= sysbench/oltp_read_only.lua --tables=1 --table-size=100000 --pgsql-db=sbtest2 run | ||
working-directory: inst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/sysbench | ||
-- -------------------------------------------------------------------------- -- | ||
-- Bulk insert benchmark: do multi-row INSERTs concurrently in --threads | ||
-- threads with each thread inserting into its own table. The number of INSERTs | ||
-- executed by each thread is controlled by either --time or --events. | ||
-- -------------------------------------------------------------------------- -- | ||
|
||
cursize=0 | ||
|
||
function thread_init() | ||
drv = sysbench.sql.driver() | ||
con = drv:connect() | ||
end | ||
|
||
function prepare() | ||
local i | ||
|
||
local drv = sysbench.sql.driver() | ||
local con = drv:connect() | ||
|
||
for i = 1, sysbench.opt.threads do | ||
print("Creating table 'sbtest" .. i .. "'...") | ||
con:query(string.format([[ | ||
CREATE TABLE IF NOT EXISTS sbtest%d ( | ||
id INTEGER NOT NULL, | ||
k INTEGER DEFAULT '0' NOT NULL, | ||
PRIMARY KEY (id))]], i)) | ||
end | ||
end | ||
|
||
function event() | ||
if (cursize == 0) then | ||
con:bulk_insert_init("INSERT INTO sbtest" .. thread_id+1 .. " VALUES") | ||
end | ||
|
||
cursize = cursize + 1 | ||
|
||
con:bulk_insert_next("(" .. cursize .. "," .. cursize .. ")") | ||
end | ||
|
||
function thread_done(thread_9d) | ||
con:bulk_insert_done() | ||
con:disconnect() | ||
end | ||
|
||
function cleanup() | ||
local i | ||
|
||
local drv = sysbench.sql.driver() | ||
local con = drv:connect() | ||
|
||
for i = 1, sysbench.opt.threads do | ||
print("Dropping table 'sbtest" .. i .. "'...") | ||
con:query("DROP TABLE IF EXISTS sbtest" .. i ) | ||
end | ||
end |
Oops, something went wrong.