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

storage: compaction alignment test #24636

Merged
merged 3 commits into from
Jan 11, 2025

Conversation

WillemKauf
Copy link
Contributor

Minor enhancements to #24621

  • Sliding window compaction
  • Simulation of internal topic compaction

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.3.x
  • v24.2.x
  • v24.1.x

Release Notes

  • none

@WillemKauf WillemKauf changed the title E compaction alignment test storage: compaction alignment test Dec 20, 2024
@WillemKauf WillemKauf requested a review from Lazin December 20, 2024 22:30
Lazin
Lazin previously approved these changes Dec 20, 2024
@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Dec 21, 2024

CI test results

test results on build#60030
test_id test_kind job_url test_status passed
rptest.tests.datalake.partition_movement_test.PartitionMovementTest.test_cross_core_movements.cloud_storage_type=CloudStorageType.S3 ducktape https://buildkite.com/redpanda/redpanda/builds/60030#0193e6ed-9f27-4427-9221-edf95b330ebb FLAKY 1/6
storage_single_thread_rpunit.storage_single_thread_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60030#0193e6a6-f454-437b-b938-aea99b04429d FAIL 0/2
storage_single_thread_rpunit.storage_single_thread_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60030#0193e6a6-f455-405f-be53-9e777219169f FAIL 0/2
test results on build#60036
test_id test_kind job_url test_status passed
gtest_raft_rpunit.gtest_raft_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60036#0193e7c7-36a5-42ac-9dbb-bb1b944f8d58 FLAKY 1/2
rptest.tests.datalake.partition_movement_test.PartitionMovementTest.test_cross_core_movements.cloud_storage_type=CloudStorageType.S3 ducktape https://buildkite.com/redpanda/redpanda/builds/60036#0193e81f-5818-4d78-87d3-26df330fce03 FLAKY 4/6
storage_single_thread_rpunit.storage_single_thread_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60036#0193e7c7-36a3-44ad-b7cd-78fc94dbcee6 FAIL 0/2
storage_single_thread_rpunit.storage_single_thread_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60036#0193e7c7-36a5-42ac-9dbb-bb1b944f8d58 FAIL 0/2
test results on build#60040
test_id test_kind job_url test_status passed
rptest.tests.random_node_operations_test.RandomNodeOperationsTest.test_node_operations.enable_failures=False.mixed_versions=False.with_tiered_storage=False.with_iceberg=False.cloud_storage_type=CloudStorageType.S3 ducktape https://buildkite.com/redpanda/redpanda/builds/60040#0193eacd-03cf-46fd-b8a3-3c28471a57d0 FAIL 0/1
test results on build#60545
test_id test_kind job_url test_status passed
rptest.tests.cluster_config_test.ClusterConfigLegacyDefaultTest.test_legacy_default.wipe_cache=False ducktape https://buildkite.com/redpanda/redpanda/builds/60545#01944d84-617d-4529-8781-5ac3e8ed736f FAIL 0/1
rptest.tests.cluster_config_test.ClusterConfigLegacyDefaultTest.test_legacy_default_explicit_before_upgrade.wipe_cache=False ducktape https://buildkite.com/redpanda/redpanda/builds/60545#01944d84-617d-4529-8781-5ac3e8ed736f FAIL 0/1
rptest.tests.cluster_config_test.ClusterConfigLegacyDefaultTest.test_removal_of_legacy_default_overriden.wipe_cache=False ducktape https://buildkite.com/redpanda/redpanda/builds/60545#01944d84-617d-4529-8781-5ac3e8ed736f FAIL 0/1
rptest.tests.control_character_flag_test.ControlCharacterNag.test_validate_nag_message.initial_version=.23.1.1 ducktape https://buildkite.com/redpanda/redpanda/builds/60545#01944d84-617d-4529-8781-5ac3e8ed736f FAIL 0/1
rptest.tests.control_character_flag_test.ControlCharacterPermittedAfterUpgrade.test_upgrade_from_pre_v23_2.initial_version=.22.3.11 ducktape https://buildkite.com/redpanda/redpanda/builds/60545#01944d84-617d-4529-8781-5ac3e8ed736f FAIL 0/1
rptest.tests.delete_records_test.DeleteRecordsTest.test_delete_records_concurrent_truncations.cloud_storage_enabled=True.truncate_point=start_offset ducktape https://buildkite.com/redpanda/redpanda/builds/60545#01944d96-6d95-48f9-bc19-e0e585378072 FAIL 0/1
test results on build#60564
test_id test_kind job_url test_status passed
gtest_raft_rpunit.gtest_raft_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60564#01944e3e-cd4a-44a0-b355-7b84e46120d8 FLAKY 1/2
partition_balancer_planner_test_rpunit.partition_balancer_planner_test_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60564#01944e3e-cd4a-44a0-b355-7b84e46120d8 FLAKY 1/2
rm_stm_tests_rpunit.rm_stm_tests_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60564#01944e3e-cd4a-44a0-b355-7b84e46120d8 FLAKY 1/2
test results on build#60596
test_id test_kind job_url test_status passed
rm_stm_tests_rpunit.rm_stm_tests_rpunit unit https://buildkite.com/redpanda/redpanda/builds/60596#019450cc-6b35-45d4-ae03-066bed122570 FLAKY 1/2
rptest.tests.data_migrations_api_test.DataMigrationsApiTest.test_creating_and_listing_migrations ducktape https://buildkite.com/redpanda/redpanda/builds/60596#01945126-8b95-46ef-8b6a-7af200570ad5 FLAKY 5/6
rptest.tests.partition_reassignments_test.PartitionReassignmentsTest.test_reassignments_kafka_cli ducktape https://buildkite.com/redpanda/redpanda/builds/60596#0194511e-c37f-4727-b33b-38f2be0dfff5 FLAKY 3/6

@WillemKauf WillemKauf force-pushed the e_compaction_alignment_test branch 2 times, most recently from 6a7731e to d6833b7 Compare December 21, 2024 18:38
@vbotbuildovich
Copy link
Collaborator

Retry command for Build#60040

please wait until all jobs are finished before running the slash command

/ci-repeat 1
tests/rptest/tests/random_node_operations_test.py::RandomNodeOperationsTest.test_node_operations@{"cloud_storage_type":1,"enable_failures":false,"mixed_versions":false,"with_iceberg":false,"with_tiered_storage":false}

ss::future<ss::stop_iteration> operator()(model::record_batch rb) {
static const auto translation_batches
= model::offset_translator_batch_types();
if (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A different condition than if(rb.header().type != model::record_batch_type::raft_data).

Otherwise, compaction placeholder batches may find their way into the ot_state with a gap_length of 0.

@WillemKauf WillemKauf force-pushed the e_compaction_alignment_test branch from d6833b7 to c10d572 Compare December 23, 2024 20:57
@WillemKauf WillemKauf requested a review from Lazin December 24, 2024 15:33
Comment on lines +35 to +62
static model::record_batch make_random_batch(
model::offset offset,
bool empty,
model::record_batch_type type,
std::vector<std::optional<ss::sstring>> keys,
std::vector<std::optional<ss::sstring>> values,
int num_records) {
BOOST_REQUIRE(keys.size() == values.size());
storage::record_batch_builder builder(type, offset);
auto to_iobuf = [](std::optional<ss::sstring> x) {
std::optional<iobuf> result;
if (x.has_value()) {
iobuf buf;
buf.append(x->data(), x->size());
result = std::move(buf);
}
return result;
};
if (!empty) {
for (int i = 0; i < num_records; i++) {
auto key = random_generators::random_choice(keys);
auto val = random_generators::random_choice(values);
builder.add_raw_kv(to_iobuf(key), to_iobuf(val));
}
}
return std::move(builder).build();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this doing something specific to the test? pretty sure we have at least a few versions of random batch creation utilities in the tree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like we have another random batch builder with the same signature as the one written here.

It's possible we could use some existing batch building utilities, but Evgeny probably added this for ease of use in this test. We don't assert on values, but the key generation is obviously important for compaction here.

Lazin
Lazin previously approved these changes Jan 9, 2025
@dotnwat
Copy link
Member

dotnwat commented Jan 9, 2025

@WillemKauf sorry I think I caused this conflict and it needs a rebase.

@WillemKauf
Copy link
Contributor Author

Force push to:

  • Rebase to upstream/dev to fix merge conflict

@vbotbuildovich
Copy link
Collaborator

Retry command for Build#60545

please wait until all jobs are finished before running the slash command

/ci-repeat 1
tests/rptest/tests/delete_records_test.py::DeleteRecordsTest.test_delete_records_concurrent_truncations@{"cloud_storage_enabled":true,"truncate_point":"start_offset"}

@WillemKauf WillemKauf force-pushed the e_compaction_alignment_test branch from f89c04f to 4c0afb1 Compare January 10, 2025 13:59
@WillemKauf
Copy link
Contributor Author

Force push to:

  • Rebase to upstream/dev to fix linter CI issues

@WillemKauf WillemKauf force-pushed the e_compaction_alignment_test branch from 4c0afb1 to b37169a Compare January 10, 2025 15:06
@WillemKauf WillemKauf force-pushed the e_compaction_alignment_test branch from b37169a to 1edec69 Compare January 10, 2025 15:06
@WillemKauf
Copy link
Contributor Author

Force push to:

  • Fix incorrect bazel test type for compaction_fuzz_test in storage/tests/BUILD

@WillemKauf WillemKauf requested review from dotnwat and Lazin January 10, 2025 19:48
@Lazin Lazin merged commit e9ad492 into redpanda-data:dev Jan 11, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants