From 5477d7db93f47112e0aa3d6625997c06db99d23c Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 27 Jan 2025 11:47:49 -0800 Subject: [PATCH] fast_import: fixes for Postgres v17 (#10414) Now that the tests are run on v17, they're also run in debug mode, which is slow. Increase statement_timeout in the test to work around that. --- pageserver/src/tenant/timeline/import_pgdata.rs | 2 +- .../import_pgdata/importbucket_client.rs | 2 +- test_runner/regress/test_import_pgdata.py | 16 ++++------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/pageserver/src/tenant/timeline/import_pgdata.rs b/pageserver/src/tenant/timeline/import_pgdata.rs index de56468580..6940179ae9 100644 --- a/pageserver/src/tenant/timeline/import_pgdata.rs +++ b/pageserver/src/tenant/timeline/import_pgdata.rs @@ -113,7 +113,7 @@ pub async fn doit( match res { Ok(_) => break, Err(err) => { - info!(?err, "indefintely waiting for pgdata to finish"); + info!(?err, "indefinitely waiting for pgdata to finish"); if tokio::time::timeout(std::time::Duration::from_secs(10), cancel.cancelled()) .await .is_ok() diff --git a/pageserver/src/tenant/timeline/import_pgdata/importbucket_client.rs b/pageserver/src/tenant/timeline/import_pgdata/importbucket_client.rs index bc4d148a29..68937e535d 100644 --- a/pageserver/src/tenant/timeline/import_pgdata/importbucket_client.rs +++ b/pageserver/src/tenant/timeline/import_pgdata/importbucket_client.rs @@ -308,7 +308,7 @@ impl ControlFile { 202107181 => 14, 202209061 => 15, 202307071 => 16, - /* XXX pg17 */ + 202406281 => 17, catversion => { anyhow::bail!("unrecognized catalog version {catversion}") } diff --git a/test_runner/regress/test_import_pgdata.py b/test_runner/regress/test_import_pgdata.py index d02a9d19db..182f715b0e 100644 --- a/test_runner/regress/test_import_pgdata.py +++ b/test_runner/regress/test_import_pgdata.py @@ -14,10 +14,8 @@ from fixtures.pageserver.http import ( ImportPgdataIdemptencyKey, PageserverApiException, ) -from fixtures.pg_version import PgVersion from fixtures.port_distributor import PortDistributor from fixtures.remote_storage import RemoteStorageKind -from fixtures.utils import run_only_on_postgres from pytest_httpserver import HTTPServer from werkzeug.wrappers.request import Request from werkzeug.wrappers.response import Response @@ -39,10 +37,6 @@ smoke_params = [ ] -@run_only_on_postgres( - [PgVersion.V14, PgVersion.V15, PgVersion.V16], - "newer control file catalog version and struct format isn't supported", -) @pytest.mark.parametrize("shard_count,stripe_size,rel_block_size", smoke_params) def test_pgdata_import_smoke( vanilla_pg: VanillaPostgres, @@ -117,13 +111,15 @@ def test_pgdata_import_smoke( # TODO: would be nicer to just compare pgdump # Enable IO concurrency for batching on large sequential scan, to avoid making - # this test unnecessarily onerous on CPU + # this test unnecessarily onerous on CPU. Especially on debug mode, it's still + # pretty onerous though, so increase statement_timeout to avoid timeouts. assert ep.safe_psql_many( [ "set effective_io_concurrency=32;", + "SET statement_timeout='300s';", "select count(*), sum(data::bigint)::bigint from t", ] - ) == [[], [(expect_nrows, expect_sum)]] + ) == [[], [], [(expect_nrows, expect_sum)]] validate_vanilla_equivalence(vanilla_pg) @@ -317,10 +313,6 @@ def test_pgdata_import_smoke( br_initdb_endpoint.safe_psql("select * from othertable") -@run_only_on_postgres( - [PgVersion.V14, PgVersion.V15, PgVersion.V16], - "newer control file catalog version and struct format isn't supported", -) def test_fast_import_binary( test_output_dir, vanilla_pg: VanillaPostgres,