Skip to content

Commit

Permalink
Merge pull request #23000 from vbotbuildovich/backport-pr-22995-v24.2…
Browse files Browse the repository at this point in the history
….x-377

[v24.2.x] Revert `storage`: fix condition in `disk_log_impl::have_segments_to_evict()`
  • Loading branch information
piyushredpanda authored Aug 22, 2024
2 parents 67fe6fe + ce37899 commit 31317cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/v/storage/disk_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ disk_log_impl::request_eviction_until_offset(model::offset max_offset) {
max_offset);
// we only notify eviction monitor if there are segments to evict
auto have_segments_to_evict
= !_segs.empty()
= (_segs.size() > 1)
&& _segs.front()->offsets().get_committed_offset() <= max_offset;

if (_eviction_monitor && have_segments_to_evict) {
Expand Down
4 changes: 2 additions & 2 deletions src/v/storage/tests/log_retention_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ FIXTURE_TEST(retention_test_size_with_one_segment, gc_fixture) {
builder.get_disk_log_impl().get_probe().partition_size()));
BOOST_CHECK_EQUAL(builder.get_log()->segment_count(), 1);

BOOST_TEST_MESSAGE("Should collect the segment");
BOOST_TEST_MESSAGE("Should not collect the segment");
builder
| storage::garbage_collect(model::timestamp(1), std::optional<size_t>(0))
| storage::stop();

BOOST_CHECK_EQUAL(builder.get_log()->segment_count(), 0);
BOOST_CHECK_EQUAL(builder.get_log()->segment_count(), 1);
}

/*
Expand Down

0 comments on commit 31317cc

Please sign in to comment.