We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When importing a basebackup tar archive, bail if there is garbage after the valid tar file.
Discussed at #1978 (comment)
The text was updated successfully, but these errors were encountered:
I wrote a test case for this, to see if this is still an issue. It is. Here's the test case:
diff --git a/test_runner/regress/test_import.py b/test_runner/regress/test_import.py index 91cca557..77ba6c7f 100644 --- a/test_runner/regress/test_import.py +++ b/test_runner/regress/test_import.py @@ -61,6 +61,12 @@ def test_import_from_vanilla(test_output_dir, pg_bin, vanilla_pg, neon_env_build cwd=unpacked_base, ) + # Make copy of base.tar and append some garbage to it. + base_plus_garbage_tar = os.path.join(basebackup_dir, "base-plus-garbage.tar") + shutil.copyfile(base_tar, base_plus_garbage_tar) + with open(base_plus_garbage_tar, "a") as f: + f.write("trailing garbage") + # Get start_lsn and end_lsn with open(os.path.join(basebackup_dir, "backup_manifest")) as f: manifest = json.load(f) @@ -130,6 +136,10 @@ def test_import_from_vanilla(test_output_dir, pg_bin, vanilla_pg, neon_env_build with pytest.raises(Exception): import_tar(corrupt_base_tar, wal_tar) + # Importing tar with trailing garbage fails + with pytest.raises(Exception): + import_tar(base_plus_garbage_tar, wal_tar) + # Importing correct backup works import_tar(base_tar, wal_tar)
Sorry, something went wrong.
The test code above was committed, mostly in 0fd3cd2
I think we can close this.
Came to this because I'm moving the import functionality into mgmt HTTP API in
page_service
import basebackup
import wal
@hlinnaka please reopen if I'm wrong.
No branches or pull requests
When importing a basebackup tar archive, bail if there is garbage after the valid tar file.
Discussed at #1978 (comment)
The text was updated successfully, but these errors were encountered: