- Notifications
You must be signed in to change notification settings - Fork86
[PBCKP-150] Reading buffer is flushed each time we verify the checksum.#487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
5 commits Select commitHold shift + click to select a range
3496020
[PBCKP-150] Reading buffer is flushed each time we verify the checksum.
de8634d
[PBCKP-150] review fixes
9b88a5a
[PBCKP-150] review fixes #2
260d63c
[PBCKP-150] rename pbckp150.py -> time_consuming.py file for further …
kulaginmb7b927b
[PBCKP-150] revert travis configuration
kulaginmFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions.travis.yml
This file contains hidden or 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
2 changes: 2 additions & 0 deletionssrc/data.c
This file contains hidden or 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
2 changes: 2 additions & 0 deletionstests/Readme.md
This file contains hidden or 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
8 changes: 7 additions & 1 deletiontests/__init__.py
This file contains hidden or 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
76 changes: 76 additions & 0 deletionstests/time_consuming.py
This file contains hidden or 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,76 @@ | ||
import os | ||
import unittest | ||
from .helpers.ptrack_helpers import ProbackupTest | ||
import subprocess | ||
from time import sleep | ||
module_name = 'time_consuming' | ||
class TimeConsumingTests(ProbackupTest, unittest.TestCase): | ||
def test_pbckp150(self): | ||
""" | ||
https://jira.postgrespro.ru/browse/PBCKP-150 | ||
create a node filled with pgbench | ||
create FULL backup followed by PTRACK backup | ||
run pgbench, vacuum VERBOSE FULL and ptrack backups in parallel | ||
""" | ||
# init node | ||
fname = self.id().split('.')[3] | ||
node = self.make_simple_node( | ||
base_dir=os.path.join(module_name, fname, 'node'), | ||
set_replication=True, | ||
initdb_params=['--data-checksums']) | ||
node.append_conf('postgresql.conf', | ||
""" | ||
max_connections = 100 | ||
wal_keep_size = 16000 | ||
ptrack.map_size = 1 | ||
shared_preload_libraries='ptrack' | ||
log_statement = 'none' | ||
fsync = off | ||
log_checkpoints = on | ||
autovacuum = off | ||
""") | ||
# init probackup and add an instance | ||
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') | ||
self.init_pb(backup_dir) | ||
self.add_instance(backup_dir, 'node', node) | ||
# run the node and init ptrack | ||
node.slow_start() | ||
node.safe_psql("postgres", "CREATE EXTENSION ptrack") | ||
# populate it with pgbench | ||
node.pgbench_init(scale=5) | ||
# FULL backup followed by PTRACK backup | ||
self.backup_node(backup_dir, 'node', node, options=['--stream']) | ||
self.backup_node(backup_dir, 'node', node, backup_type='ptrack', options=['--stream']) | ||
# run ordinary pgbench scenario to imitate some activity and another pgbench for vacuuming in parallel | ||
nBenchDuration = 30 | ||
pgbench = node.pgbench(options=['-c', '20', '-j', '8', '-T', str(nBenchDuration)]) | ||
with open('/tmp/pbckp150vacuum.sql', 'w') as f: | ||
f.write('VACUUM (FULL) pgbench_accounts, pgbench_tellers, pgbench_history; SELECT pg_sleep(1);\n') | ||
pgbenchval = node.pgbench(options=['-c', '1', '-f', '/tmp/pbckp150vacuum.sql', '-T', str(nBenchDuration)]) | ||
# several PTRACK backups | ||
for i in range(nBenchDuration): | ||
print("[{}] backing up PTRACK diff...".format(i+1)) | ||
self.backup_node(backup_dir, 'node', node, backup_type='ptrack', options=['--stream', '--log-level-console', 'VERBOSE']) | ||
sleep(0.1) | ||
# if the activity pgbench has finished, stop backing up | ||
if pgbench.poll() is not None: | ||
break | ||
pgbench.kill() | ||
pgbenchval.kill() | ||
pgbench.wait() | ||
pgbenchval.wait() | ||
backups = self.show_pb(backup_dir, 'node') | ||
for b in backups: | ||
self.assertEqual("OK", b['status']) | ||
# Clean after yourself | ||
self.del_test_dir(module_name, fname) |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.