Compare commits

...

4 Commits

Author SHA1 Message Date
Alex Chi Z
b7d7496221 fix storage tests
Signed-off-by: Alex Chi Z <chi@neon.tech>
2025-06-24 13:56:38 -04:00
Suhas Thalanki
5c9470a5cf Merge branch 'main' into thesuhas/pg_stat_rollout 2025-06-19 09:42:07 -07:00
Suhas Thalanki
9678734b75 reverted some changes, added boot_val from global_settings in staging 2025-06-18 14:42:31 -07:00
Suhas Thalanki
ed3100a70e setting a non-zero value for pg_stat rollout test 2025-06-18 11:28:13 -07:00
4 changed files with 28 additions and 7 deletions

View File

@@ -514,7 +514,7 @@ _PG_init(void)
"Maximal size of pgstat.stat file saved in Neon storage",
"Zero value disables persisting pgstat.stat file",
&neon_pgstat_file_size_limit,
0, 0, 1000000, /* disabled by default */
16384, 0, 1000000, /* disabled by default */
PGC_SIGHUP,
GUC_UNIT_KB,
NULL, NULL, NULL);

View File

@@ -5806,6 +5806,7 @@ def generate_uploads_and_deletions(
data: str | None = None,
pageserver: NeonPageserver,
wait_until_uploaded: bool = True,
config_lines: list[str] | None = None,
):
"""
Using the environment's default tenant + timeline, generate a load pattern
@@ -5823,7 +5824,7 @@ def generate_uploads_and_deletions(
ps_http = pageserver.http_client()
with env.endpoints.create_start(
"main", tenant_id=tenant_id, pageserver_id=pageserver.id
"main", tenant_id=tenant_id, pageserver_id=pageserver.id, config_lines=config_lines
) as endpoint:
if init:
endpoint.safe_psql("CREATE TABLE foo (id INTEGER PRIMARY KEY, val text)")

View File

@@ -226,7 +226,14 @@ def test_deletion_queue_recovery(
ps_http.configure_failpoints(failpoints)
generate_uploads_and_deletions(env, pageserver=main_pageserver)
# As the compute will write a pg_stat aux file record when shutting down and we check the delta layers
# generated in this test case, we need to disable it to avoid the test case from failing + make things
# more deterministic.
disable_pg_stat_persistence_config_line = ["neon.pgstat_file_size_limit = 0"]
generate_uploads_and_deletions(
env, pageserver=main_pageserver, config_lines=disable_pg_stat_persistence_config_line
)
# There should be entries in the deletion queue
assert_deletion_queue(ps_http, lambda n: n > 0)

View File

@@ -93,7 +93,14 @@ def test_ancestor_detach_branched_from(
client = env.pageserver.http_client()
with env.endpoints.create_start("main", tenant_id=env.initial_tenant) as ep:
# As the compute will write a pg_stat aux file record when shutting down and we check the delta layers
# generated in this test case, we need to disable it to avoid the test case from failing + make things
# more deterministic.
disable_pg_stat_persistence_config_line = ["neon.pgstat_file_size_limit = 0"]
with env.endpoints.create_start(
"main", tenant_id=env.initial_tenant, config_lines=disable_pg_stat_persistence_config_line
) as ep:
ep.safe_psql("CREATE TABLE foo (i BIGINT);")
after_first_tx = wait_for_last_flush_lsn(env, ep, env.initial_tenant, env.initial_timeline)
@@ -151,7 +158,9 @@ def test_ancestor_detach_branched_from(
assert branch_at == recorded, "the test should not use unaligned lsns"
if write_to_branch_first:
with env.endpoints.create_start(name, tenant_id=env.initial_tenant) as ep:
with env.endpoints.create_start(
name, tenant_id=env.initial_tenant, config_lines=disable_pg_stat_persistence_config_line
) as ep:
assert ep.safe_psql("SELECT count(*) FROM foo;")[0][0] == rows
# make sure the ep is writable
# with BEFORE_L0, AFTER_L0 there will be a gap in Lsns caused by accurate end_lsn on straddling layers
@@ -180,10 +189,14 @@ def test_ancestor_detach_branched_from(
env.pageserver.stop()
env.pageserver.start()
with env.endpoints.create_start("main", tenant_id=env.initial_tenant) as ep:
with env.endpoints.create_start(
"main", tenant_id=env.initial_tenant, config_lines=disable_pg_stat_persistence_config_line
) as ep:
assert ep.safe_psql("SELECT count(*) FROM foo;")[0][0] == 16384
with env.endpoints.create_start(name, tenant_id=env.initial_tenant) as ep:
with env.endpoints.create_start(
name, tenant_id=env.initial_tenant, config_lines=disable_pg_stat_persistence_config_line
) as ep:
assert ep.safe_psql("SELECT count(*) FROM foo;")[0][0] == rows
old_main_info = client.layer_map_info(env.initial_tenant, env.initial_timeline)