Skip to content

Commit

Permalink
pageserver: don't ingest checkpoint page on shards >0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp committed Nov 20, 2024
1 parent e67d9b4 commit 636e702
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pageserver/src/walingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl WalIngest {
assert!(!modification.has_dirty_data());
}

assert!(!self.checkpoint_modified);
assert!(!self.checkpoint_modified || !self.shard.is_shard_zero());
if interpreted.xid != pg_constants::INVALID_TRANSACTION_ID
&& self.checkpoint.update_next_xid(interpreted.xid)
{
Expand Down Expand Up @@ -277,8 +277,8 @@ impl WalIngest {
.ingest_batch(interpreted.batch, &self.shard, ctx)
.await?;

// If checkpoint data was updated, store the new version in the repository
if self.checkpoint_modified {
// If checkpoint data was updated, store the new version in the repository (on shard zero only)
if self.checkpoint_modified && self.shard.is_shard_zero() {
let new_checkpoint_bytes = self.checkpoint.encode()?;

modification.put_checkpoint(new_checkpoint_bytes)?;
Expand Down

0 comments on commit 636e702

Please sign in to comment.