pageserver: filter WAL by ShardIdentity

This commit is contained in:
John Spray
2023-11-05 14:02:05 +00:00
parent 61fe9d360d
commit f7795ee2a5
4 changed files with 97 additions and 0 deletions

View File

@@ -411,6 +411,12 @@ impl ShardIdentity {
String::new()
}
}
/// Convenience for checking if this identity is the 0th shard in a tenant,
/// for special cases on shard 0 such as ingesting relation sizes.
pub fn is_zero(&self) -> bool {
self.number == ShardNumber(0)
}
}
impl Serialize for ShardIndex {