Skip to content

Commit

Permalink
chore(pageserver): warn on delete non-existing file (#7847)
Browse files Browse the repository at this point in the history
Consider the following sequence of migration:

```
1. user starts compute
2. force migrate to v2
3. user continues to write data
```

At the time of (3), the compute node is not aware that the page server
does not contain replication states any more, and might continue to
ingest neon-file records into the safekeeper. This will leave the
pageserver store a partial replication state and cause some errors. For
example, the compute could issue a deletion of some aux files in v1, but
this file does not exist in v2. Therefore, we should ignore all these
errors until everyone is migrated to v2.

Also note that if we see this warning in prod, it is likely because we
did not fully suspend users' compute when flipping the v1/v2 flag.

Signed-off-by: Alex Chi Z <chi@neon.tech>
  • Loading branch information
skyzh committed May 30, 2024
1 parent 33395dc commit f20a9e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pageserver/src/pgdatadir_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ impl<'a> DatadirModification<'a> {
self.tline.aux_file_size_estimator.on_add(content.len());
new_files.push((path, content));
}
(None, true) => anyhow::bail!("removing non-existing aux file: {}", path),
(None, true) => warn!("removing non-existing aux file: {}", path),
}
let new_val = aux_file::encode_file_value(&new_files)?;
self.put(key, Value::Image(new_val.into()));
Expand Down

1 comment on commit f20a9e7

@github-actions
Copy link

Choose a reason for hiding this comment

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

3238 tests run: 3092 passed, 0 failed, 146 skipped (full report)


Code coverage* (full report)

  • functions: 31.4% (6492 of 20671 functions)
  • lines: 48.4% (50206 of 103758 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
f20a9e7 at 2024-05-30T16:03:36.962Z :recycle:

Please sign in to comment.