Skip to content

Commit 75c933e

Browse files
author
Devdutt Shenoi
committed
fix: #1189
1 parent 56efae3 commit 75c933e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/handlers/http/logstream.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ use tracing::warn;
4747

4848
pub async fn delete(stream_name: Path<String>) -> Result<impl Responder, StreamError> {
4949
let stream_name = stream_name.into_inner();
50-
if !PARSEABLE.streams.contains(&stream_name) {
50+
// Error out if stream doesn't exist in memory, or in the case of query node, in storage as well
51+
if !PARSEABLE.streams.contains(&stream_name)
52+
&& PARSEABLE.options.mode == Mode::Query
53+
&& matches!(
54+
PARSEABLE
55+
.create_stream_and_schema_from_storage(&stream_name)
56+
.await,
57+
Ok(true) | Err(_)
58+
)
59+
{
5160
return Err(StreamNotFound(stream_name).into());
5261
}
5362

src/parseable/streams.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ impl Stream {
569569
}
570570

571571
pub fn get_retention(&self) -> Option<Retention> {
572-
self.metadata.read().expect(LOCK_EXPECT).retention.clone()
572+
dbg!(self.metadata.read().expect(LOCK_EXPECT).retention.clone())
573573
}
574574

575575
pub fn get_schema_version(&self) -> SchemaVersion {
@@ -596,7 +596,7 @@ impl Stream {
596596
}
597597

598598
pub fn set_retention(&self, retention: Retention) {
599-
self.metadata.write().expect(LOCK_EXPECT).retention = Some(retention);
599+
self.metadata.write().expect(LOCK_EXPECT).retention = Some(dbg!(retention));
600600
}
601601

602602
pub fn set_first_event_at(&self, first_event_at: &str) {

0 commit comments

Comments
 (0)