Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(pageserver): add small tenant compaction #11049

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
36 changes: 36 additions & 0 deletions test_runner/regress/test_compaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,42 @@ def compaction_finished():
workload.validate(env.pageserver.id)


def test_pageserver_small_tenant_compaction(neon_env_builder: NeonEnvBuilder):
"""
Create a small tenant that rarely needs compaction and ensure that everything works.
"""
SMOKE_CONF = {
# Run both gc and gc-compaction.
"gc_period": "5s",
"compaction_period": "5s",
# No PiTR interval and small GC horizon
"pitr_interval": "0s",
"gc_horizon": 1024,
"lsn_lease_length": "0s",
}

env = neon_env_builder.init_start(initial_tenant_conf=SMOKE_CONF)
tenant_id = env.initial_tenant
timeline_id = env.initial_timeline

ps_http = env.pageserver.http_client()

workload = Workload(env, tenant_id, timeline_id)
workload.init(env.pageserver.id)

log.info("Writing initial data ...")
workload.write_rows(10000, env.pageserver.id)

for _ in range(100):
workload.churn_rows(10, env.pageserver.id, upload=False, ingest=False)
ps_http.timeline_checkpoint(tenant_id, timeline_id, wait_until_uploaded=True)
ps_http.timeline_compact(tenant_id, timeline_id)
ps_http.timeline_gc(tenant_id, timeline_id, None)

log.info("Validating at workload end ...")
workload.validate(env.pageserver.id)


# Stripe sizes in number of pages.
TINY_STRIPES = 16
LARGE_STRIPES = 32768
Expand Down
Loading