Skip to content

Commit

Permalink
fix(pagesever): stablize gc-compaction tests (neondatabase#10621)
Browse files Browse the repository at this point in the history
## Problem

Hopefully this can resolve
neondatabase#10517. The reason why the
test is flaky is that after restart the compute node might write some
data so that the pageserver flush some layers, and in the end, causing
L0 compaction to run, and we cannot get the test scenario as we want.

## Summary of changes

Ensure all L0 layers are compacted before starting the test.

Signed-off-by: Alex Chi Z <chi@neon.tech>
  • Loading branch information
skyzh authored and winter-loo committed Feb 4, 2025
1 parent 96485ce commit 37888fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test_runner/regress/test_compaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ def compaction_finished():
workload.churn_rows(row_count, env.pageserver.id)
# compact 3 times if mode is before_restart
n_compactions = 3 if compaction_mode == "before_restart" else 1
ps_http.timeline_compact(
tenant_id, timeline_id, force_l0_compaction=True, wait_until_uploaded=True
)
for _ in range(n_compactions):
# Force refresh gc info to have gc_cutoff generated
ps_http.timeline_gc(tenant_id, timeline_id, None)
Expand Down

0 comments on commit 37888fa

Please sign in to comment.