mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-15 20:20:38 +00:00
tests: stabilize test_sharding_split_compaction (#8318)
## Problem This test incorrectly assumed that a post-split compaction would only drop content. This was easily destabilized by any changes to image generation rules. ## Summary of changes - Before split, do a full image layer generation pass, to guarantee that post-split compaction should only drop data, never create it. - Fix the force_image_layer_creation mode of compaction that we use from tests like this: previously it would try and generate image layers even if one already existed with the same layer key, which caused compaction to fail.
This commit is contained in:
@@ -225,6 +225,12 @@ def test_sharding_split_compaction(neon_env_builder: NeonEnvBuilder, failpoint:
|
||||
workload.validate()
|
||||
workload.stop()
|
||||
|
||||
# Do a full image layer generation before splitting, so that when we compact after splitting
|
||||
# we should only see sizes decrease (from post-split drops/rewrites), not increase (from image layer generation)
|
||||
env.get_tenant_pageserver(tenant_id).http_client().timeline_compact(
|
||||
tenant_id, timeline_id, force_image_layer_creation=True, wait_until_uploaded=True
|
||||
)
|
||||
|
||||
# Split one shard into two
|
||||
shards = env.storage_controller.tenant_shard_split(tenant_id, shard_count=2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user