Skip to content

Commit b5efd4f

Browse files
erikgrinakerwinter-loo
authored andcommitted
test_runner: force-compact in test_sharding_autosplit (neondatabase#10605)
## Problem This test may not fully detect data corruption during splits, since we don't force-compact the entire keyspace. ## Summary of changes Force-compact all data in `test_sharding_autosplit`.
1 parent 3ac6c18 commit b5efd4f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test_runner/performance/test_sharding_autosplit.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def assert_all_split():
247247
log.info(f"{shard_zero_id} timeline: {timeline_info}")
248248

249249
# Run compaction for all tenants, restart endpoint so that on subsequent reads we will
250-
# definitely hit pageserver for reads. This compaction passis expected to drop unwanted
250+
# definitely hit pageserver for reads. This compaction pass is expected to drop unwanted
251251
# layers but not do any rewrites (we're still in the same generation)
252252
for tenant_id, tenant_state in tenants.items():
253253
tenant_state.endpoint.stop()
@@ -296,6 +296,16 @@ def assert_all_split():
296296
for fut in pgbench_futs:
297297
fut.result()
298298

299+
# Run a full forced compaction, to detect any data corruption.
300+
for tenant_id, tenant_state in tenants.items():
301+
for shard_id, shard_ps in tenant_get_shards(env, tenant_id):
302+
shard_ps.http_client().timeline_compact(
303+
shard_id,
304+
tenant_state.timeline_id,
305+
force_image_layer_creation=True,
306+
force_l0_compaction=True,
307+
)
308+
299309
# Assert that some rewrites happened
300310
# TODO: uncomment this after https://github.com/neondatabase/neon/pull/7531 is merged
301311
# assert any(ps.log_contains(".*Rewriting layer after shard split.*") for ps in env.pageservers)

0 commit comments

Comments
 (0)