Skip to content

Commit

Permalink
Merge pull request #10081 from neondatabase/skyzh/cherry-pick-fix
Browse files Browse the repository at this point in the history
pageserver: fix CLog truncate walingest
  • Loading branch information
skyzh authored Dec 11, 2024
2 parents 7ac2a55 + bc63549 commit 2455dca
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions pageserver/src/walingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,22 +877,24 @@ impl WalIngest {
// will block waiting for the last valid LSN to advance up to
// it. So we use the previous record's LSN in the get calls
// instead.
for segno in modification
.tline
.list_slru_segments(SlruKind::Clog, Version::Modified(modification), ctx)
.await?
{
let segpage = segno * pg_constants::SLRU_PAGES_PER_SEGMENT;
if modification.tline.get_shard_identity().is_shard_zero() {
for segno in modification
.tline
.list_slru_segments(SlruKind::Clog, Version::Modified(modification), ctx)
.await?
{
let segpage = segno * pg_constants::SLRU_PAGES_PER_SEGMENT;

let may_delete = dispatch_pgversion!(modification.tline.pg_version, {
pgv::nonrelfile_utils::slru_may_delete_clogsegment(segpage, pageno)
});
let may_delete = dispatch_pgversion!(modification.tline.pg_version, {
pgv::nonrelfile_utils::slru_may_delete_clogsegment(segpage, pageno)
});

if may_delete {
modification
.drop_slru_segment(SlruKind::Clog, segno, ctx)
.await?;
trace!("Drop CLOG segment {:>04X}", segno);
if may_delete {
modification
.drop_slru_segment(SlruKind::Clog, segno, ctx)
.await?;
trace!("Drop CLOG segment {:>04X}", segno);
}
}
}

Expand Down

1 comment on commit 2455dca

@github-actions
Copy link

@github-actions github-actions bot commented on 2455dca Dec 11, 2024

Choose a reason for hiding this comment

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

6436 tests run: 6150 passed, 0 failed, 286 skipped (full report)


Flaky tests (4)

Postgres 15

Postgres 14

Test coverage report is not available

The comment gets automatically updated with the latest test results
2455dca at 2024-12-11T07:55:50.192Z :recycle:

Please sign in to comment.