Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add pg_probackup plugin#92

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
demonolock merged 9 commits intomasterfromadd-pg-probackup-plugin
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
NextNext commit
fix flake8 problems
  • Loading branch information
vshepard committedJan 15, 2024
commita5fec7fa44e63e90d0c2d9f10843fd0ca8ce0ec9
17 changes: 7 additions & 10 deletionstestgres/plugins/probackup/app.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -132,14 +132,12 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
def init(self, options=None, old_binary=False, skip_log_directory=False, expect_error=False, use_backup_dir=True):
if options is None:
options = []
return self.run([
'init',
] + options,
old_binary=old_binary,
skip_log_directory=skip_log_directory,
expect_error=expect_error,
use_backup_dir=use_backup_dir
)
return self.run(['init', ] + options,
old_binary=old_binary,
skip_log_directory=skip_log_directory,
expect_error=expect_error,
use_backup_dir=use_backup_dir
)

def add_instance(self, instance, node, old_binary=False, options=None, expect_error=False):
if options is None:
Expand DownExpand Up@@ -535,7 +533,6 @@ def show_archive(
break

if tli > 0:
timeline_data = None
for timeline in instance_timelines:
if timeline['tli'] == tli:
return timeline
Expand DownExpand Up@@ -664,7 +661,7 @@ def set_archiving(
archive_command += ' --remote-proto=ssh --remote-host=localhost'

if init_params.archive_compress and compress:
archive_command += ' --compress-algorithm='+init_params.archive_compress
archive_command += ' --compress-algorithm=' +init_params.archive_compress

if overwrite:
archive_command += ' --overwrite'
Expand Down
5 changes: 1 addition & 4 deletionstestgres/plugins/probackup/gdb.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -191,10 +191,7 @@ def continue_execution_until_exit(self):
continue
if line.startswith('*stopped,reason="breakpoint-hit"'):
continue
if (
line.startswith('*stopped,reason="exited') or
line == '*stopped\n'
):
if line.startswith('*stopped,reason="exited') or line == '*stopped\n':
self.quit()
return

Expand Down
21 changes: 10 additions & 11 deletionstestgres/plugins/probackup/init_helpers.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,14 +8,16 @@
import testgres

try:
import lz4.frame
import lz4.frame # noqa: F401

HAVE_LZ4 = True
except ImportError as e:
HAVE_LZ4 = False
LZ4_error = e

try:
import zstd
import zstd # noqa: F401

HAVE_ZSTD = True
except ImportError as e:
HAVE_ZSTD = False
Expand All@@ -28,8 +30,8 @@
cache_initdb=False,
cached_initdb_dir=False,
node_cleanup_full=delete_logs)
except:
pass
except Exception as e:
print("Can't configure testgres: {0}".format(e))


class Init(object):
Expand All@@ -46,7 +48,7 @@ def __init__(self):
version = self._pg_config['VERSION'].rstrip('develalphabetapre')
parts = [*version.split(' ')[1].split('.'), '0', '0'][:3]
parts[0] = re.match(r'\d+', parts[0]).group()
self.pg_config_version = reduce(lambda v, x: v*100+int(x), parts, 0)
self.pg_config_version = reduce(lambda v, x: v *100 +int(x), parts, 0)

test_env = os.environ.copy()
envs_list = [
Expand DownExpand Up@@ -133,10 +135,7 @@ def __init__(self):

self.probackup_old_path = None
if 'PGPROBACKUPBIN_OLD' in test_env:
if (
os.path.isfile(test_env['PGPROBACKUPBIN_OLD']) and
os.access(test_env['PGPROBACKUPBIN_OLD'], os.X_OK)
):
if (os.path.isfile(test_env['PGPROBACKUPBIN_OLD']) and os.access(test_env['PGPROBACKUPBIN_OLD'], os.X_OK)):
self.probackup_old_path = test_env['PGPROBACKUPBIN_OLD']
else:
if self.verbose:
Expand DownExpand Up@@ -166,8 +165,7 @@ def __init__(self):
).group(0)

self.remote = test_env.get('PGPROBACKUP_SSH_REMOTE', None) == 'ON'
self.ptrack = test_env.get('PG_PROBACKUP_PTRACK', None) == 'ON' and \
self.pg_config_version >= 110000
self.ptrack = test_env.get('PG_PROBACKUP_PTRACK', None) == 'ON' and self.pg_config_version >= 110000

self.paranoia = test_env.get('PG_PROBACKUP_PARANOIA', None) == 'ON'
env_compress = test_env.get('ARCHIVE_COMPRESSION', None)
Expand DownExpand Up@@ -200,4 +198,5 @@ def __init__(self):
def test_env(self):
return self._test_env.copy()


init_params = Init()

[8]ページ先頭

©2009-2025 Movatter.jp