-
Notifications
You must be signed in to change notification settings - Fork 596
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
storage
: compaction alignment test
#24636
Conversation
storage
: compaction alignment test
939053a
to
80b0f72
Compare
CI test resultstest results on build#60030
test results on build#60036
test results on build#60040
test results on build#60545
test results on build#60564
test results on build#60596
|
6a7731e
to
d6833b7
Compare
Retry command for Build#60040please wait until all jobs are finished before running the slash command
|
ss::future<ss::stop_iteration> operator()(model::record_batch rb) { | ||
static const auto translation_batches | ||
= model::offset_translator_batch_types(); | ||
if ( |
There was a problem hiding this comment.
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.
d6833b7
to
c10d572
Compare
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(); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@WillemKauf sorry I think I caused this conflict and it needs a rebase. |
c10d572
to
f89c04f
Compare
Force push to:
|
Retry command for Build#60545please wait until all jobs are finished before running the slash command
|
f89c04f
to
4c0afb1
Compare
Force push to:
|
4c0afb1
to
b37169a
Compare
The test uses different segment layouts, runs compaction and compares results.
b37169a
to
1edec69
Compare
Force push to:
|
Minor enhancements to #24621
Backports Required
Release Notes