From 649b467adbc2cd30baba818bd025a07c3bd61f3c Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 14 Jul 2021 09:53:42 -0400 Subject: [PATCH] fix: CatalogChunk no longer needs to record a write when created from a MUB chunk --- server/src/db/catalog/chunk.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server/src/db/catalog/chunk.rs b/server/src/db/catalog/chunk.rs index 17b1d51625..38fdeb62cb 100644 --- a/server/src/db/catalog/chunk.rs +++ b/server/src/db/catalog/chunk.rs @@ -238,8 +238,7 @@ impl ChunkMetrics { impl CatalogChunk { /// Creates a new open chunk from the provided MUB chunk. /// - /// Panics if the provided chunk is empty, otherwise creates a new open chunk and records a - /// write at the current time. + /// Panics if the provided chunk is empty, otherwise creates a new open chunk. pub(super) fn new_open( addr: ChunkAddr, chunk: mutable_buffer::chunk::MBChunk, @@ -256,7 +255,7 @@ impl CatalogChunk { .state .inc_with_labels(&[KeyValue::new("state", "open")]); - let mut chunk = Self { + Self { addr, stage, lifecycle_action: None, @@ -264,9 +263,7 @@ impl CatalogChunk { time_of_first_write: Some(first_write), time_of_last_write: Some(last_write), time_closed: None, - }; - chunk.record_write(); - chunk + } } /// Creates a new RUB chunk from the provided RUB chunk and metadata