Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/v/cloud_storage/tests/remote_partition_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1987,22 +1987,30 @@ FIXTURE_TEST(test_stale_reader, cloud_storage_fixture) {
batch_t data = {
.num_records = 1, .type = model::record_batch_type::raft_data};

batch_t merged = {
.num_records = 2, .type = model::record_batch_type::raft_data};

// offsets 0-29
const std::vector<std::vector<batch_t>> batch_types = {
{data, data, data, data, data, data, data, data, data, data},
{data, data, data, data, data, data, data, data, data, data},
{data, data, data, data, data, data, data, data, data, data},
};
const std::vector<std::vector<batch_t>> merged_batch_types = {
{merged, merged, merged, merged, merged},
{merged, merged, merged, merged, merged},
{merged, merged, merged, merged, merged},
};

auto segments = setup_s3_imposter(
*this, model::offset(0), model::offset_delta(0), batch_types);

print_segments(segments);

auto headers_read = scan_remote_partition_with_replacements(
*this, model::offset(0), model::offset(29), batch_types, 0, 0);
*this, model::offset(0), model::offset(29), merged_batch_types, 0, 0);

BOOST_REQUIRE_EQUAL(headers_read.size(), 30);
BOOST_REQUIRE_EQUAL(headers_read.size(), 15);
}

// Returns true if a kafka::offset scan returns the expected number of records.
Expand Down
1 change: 0 additions & 1 deletion src/v/cloud_storage/tests/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@ std::vector<in_memory_segment> replace_segments(
auto bo = s.base_offset;
auto it = manifest.find(bo);
BOOST_REQUIRE(it != manifest.end());
BOOST_REQUIRE(it->size_bytes != s.bytes.size());
auto path = manifest.generate_segment_path(*it);
segments_to_remove.push_back(ss::sstring("/") + path().native());
}
Expand Down