mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-28 14:36:51 +00:00
Make clippy happy
This commit is contained in:
@@ -1741,7 +1741,7 @@ mod tests {
|
||||
drop(writer);
|
||||
|
||||
tline.checkpoint(CheckpointConfig::Forced)?;
|
||||
tline.compact()?;
|
||||
tline.reconstruct()?;
|
||||
|
||||
let writer = tline.writer();
|
||||
writer.put(*TEST_KEY, Lsn(0x20), &Value::Image(TEST_IMG("foo at 0x20")))?;
|
||||
@@ -1749,7 +1749,7 @@ mod tests {
|
||||
drop(writer);
|
||||
|
||||
tline.checkpoint(CheckpointConfig::Forced)?;
|
||||
tline.compact()?;
|
||||
tline.reconstruct()?;
|
||||
|
||||
let writer = tline.writer();
|
||||
writer.put(*TEST_KEY, Lsn(0x30), &Value::Image(TEST_IMG("foo at 0x30")))?;
|
||||
@@ -1757,7 +1757,7 @@ mod tests {
|
||||
drop(writer);
|
||||
|
||||
tline.checkpoint(CheckpointConfig::Forced)?;
|
||||
tline.compact()?;
|
||||
tline.reconstruct()?;
|
||||
|
||||
let writer = tline.writer();
|
||||
writer.put(*TEST_KEY, Lsn(0x40), &Value::Image(TEST_IMG("foo at 0x40")))?;
|
||||
@@ -1765,7 +1765,7 @@ mod tests {
|
||||
drop(writer);
|
||||
|
||||
tline.checkpoint(CheckpointConfig::Forced)?;
|
||||
tline.compact()?;
|
||||
tline.reconstruct()?;
|
||||
|
||||
assert_eq!(tline.get(*TEST_KEY, Lsn(0x10))?, TEST_IMG("foo at 0x10"));
|
||||
assert_eq!(tline.get(*TEST_KEY, Lsn(0x1f))?, TEST_IMG("foo at 0x10"));
|
||||
@@ -1813,7 +1813,7 @@ mod tests {
|
||||
|
||||
tline.update_gc_info(Vec::new(), cutoff, Duration::ZERO)?;
|
||||
tline.checkpoint(CheckpointConfig::Forced)?;
|
||||
tline.compact()?;
|
||||
tline.reconstruct()?;
|
||||
tline.gc()?;
|
||||
}
|
||||
|
||||
@@ -1883,7 +1883,7 @@ mod tests {
|
||||
let cutoff = tline.get_last_record_lsn();
|
||||
tline.update_gc_info(Vec::new(), cutoff, Duration::ZERO)?;
|
||||
tline.checkpoint(CheckpointConfig::Forced)?;
|
||||
tline.compact()?;
|
||||
tline.reconstruct()?;
|
||||
tline.gc()?;
|
||||
}
|
||||
|
||||
@@ -1962,7 +1962,7 @@ mod tests {
|
||||
let cutoff = tline.get_last_record_lsn();
|
||||
tline.update_gc_info(Vec::new(), cutoff, Duration::ZERO)?;
|
||||
tline.checkpoint(CheckpointConfig::Forced)?;
|
||||
tline.compact()?;
|
||||
tline.reconstruct()?;
|
||||
tline.gc()?;
|
||||
}
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ impl Layer for DeltaLayer {
|
||||
inner.index_root_blk,
|
||||
file,
|
||||
);
|
||||
let search_key = DeltaKey::from_key_lsn(&key, Lsn(0));
|
||||
let search_key = DeltaKey::from_key_lsn(key, Lsn(0));
|
||||
let mut found = false;
|
||||
reader.visit(
|
||||
&search_key.0,
|
||||
|
||||
@@ -238,7 +238,7 @@ impl Layer for InMemoryLayer {
|
||||
|
||||
fn contains(&self, key: &Key) -> Result<bool> {
|
||||
let inner = self.inner.read().unwrap();
|
||||
Ok(inner.index.get(&key).is_some())
|
||||
Ok(inner.index.get(key).is_some())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -276,11 +276,11 @@ impl LayerMap {
|
||||
continue;
|
||||
}
|
||||
assert!(l.get_key_range().contains(&key));
|
||||
/*
|
||||
/*
|
||||
if !l.contains(&key)? {
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
if l.get_lsn_range().start >= end_lsn {
|
||||
info!(
|
||||
"Candidate delta layer {}..{} is too new for lsn {}",
|
||||
@@ -367,6 +367,7 @@ impl LayerMap {
|
||||
pub fn remove_historic(&mut self, layer: Arc<dyn Layer>) {
|
||||
if layer.get_key_range() == (Key::MIN..Key::MAX) {
|
||||
if let Some(latest_layer) = &self.latest_delta_layer {
|
||||
#[allow(clippy::vtable_address_comparisons)]
|
||||
if Arc::ptr_eq(&layer, latest_layer) {
|
||||
self.latest_delta_layer = None;
|
||||
}
|
||||
|
||||
@@ -1537,8 +1537,8 @@ impl Timeline {
|
||||
let mut new_layers = Vec::new();
|
||||
let mut last_key: Option<Key> = None;
|
||||
if let Some(last_delta_layer) = latest_delta_layer {
|
||||
let end_lsn = last_delta_layer.get_lsn_range().end;
|
||||
let lsn_range = end_lsn..end_lsn+1;
|
||||
let end_lsn = last_delta_layer.get_lsn_range().end;
|
||||
let lsn_range = end_lsn..end_lsn + 1;
|
||||
for (key, lsn, _) in last_delta_layer.key_iter(true) {
|
||||
let value = self.get(key, lsn)?;
|
||||
if let Some(curr_writer) = &writer {
|
||||
|
||||
Reference in New Issue
Block a user