Skip to content

Commit 069ef98

Browse files
committed
storage: decompress batches in validate function
In case we are validating compressed batches (to avoid an assertion failure).
1 parent 76fa467 commit 069ef98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/v/storage/tests/batch_generators.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,11 @@ struct linear_int_kv_batch_generator {
154154
static void validate_post_compaction(
155155
chunked_circular_buffer<model::record_batch>&& batches) {
156156
int idx = 0;
157-
for (const auto& batch : batches) {
157+
for (auto& batch : batches) {
158158
RPTEST_EXPECT_EQ(batch.record_count(), 1);
159+
if (batch.compressed()) {
160+
batch = model::decompress_batch_sync(batch);
161+
}
159162
batch.for_each_record([&idx](model::record rec) {
160163
RPTEST_EXPECT_EQ(
161164
reflection::from_iobuf<int>(rec.release_key()), idx++);

0 commit comments

Comments
 (0)