fix: Warn when a non-generation item is found in a database directory
parent
7cf7fb02ed
commit
82b566a3bb
|
@ -1925,6 +1925,7 @@ dependencies = [
|
||||||
"data_types",
|
"data_types",
|
||||||
"futures",
|
"futures",
|
||||||
"object_store",
|
"object_store",
|
||||||
|
"observability_deps",
|
||||||
"snafu",
|
"snafu",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
|
|
|
@ -9,6 +9,7 @@ bytes = "1.0"
|
||||||
data_types = { path = "../data_types" }
|
data_types = { path = "../data_types" }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
object_store = { path = "../object_store" }
|
object_store = { path = "../object_store" }
|
||||||
|
observability_deps = { path = "../observability_deps" }
|
||||||
snafu = "0.6"
|
snafu = "0.6"
|
||||||
tokio = { version = "1.0", features = ["macros", "time"] }
|
tokio = { version = "1.0", features = ["macros", "time"] }
|
||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
|
|
|
@ -24,6 +24,7 @@ use object_store::{
|
||||||
path::{parsed::DirsAndFileName, ObjectStorePath, Path},
|
path::{parsed::DirsAndFileName, ObjectStorePath, Path},
|
||||||
ObjectStore, ObjectStoreApi, Result,
|
ObjectStore, ObjectStoreApi, Result,
|
||||||
};
|
};
|
||||||
|
use observability_deps::tracing::warn;
|
||||||
use snafu::{ensure, ResultExt, Snafu};
|
use snafu::{ensure, ResultExt, Snafu};
|
||||||
use std::{io, sync::Arc};
|
use std::{io, sync::Arc};
|
||||||
use tokio::sync::mpsc::channel;
|
use tokio::sync::mpsc::channel;
|
||||||
|
@ -131,8 +132,6 @@ impl IoxObjectStore {
|
||||||
.last()
|
.last()
|
||||||
.expect("path can't be empty");
|
.expect("path can't be empty");
|
||||||
|
|
||||||
// Deliberately ignoring errors with parsing; if the directory isn't a usize, it's
|
|
||||||
// not a valid database generation directory and we should skip it.
|
|
||||||
if let Ok(id) = id.to_string().parse() {
|
if let Ok(id) = id.to_string().parse() {
|
||||||
// TODO: Check for tombstone file once we add a way to create the tombstone file
|
// TODO: Check for tombstone file once we add a way to create the tombstone file
|
||||||
// However, if we can't list the contents of a database directory, we can't
|
// However, if we can't list the contents of a database directory, we can't
|
||||||
|
@ -145,6 +144,10 @@ impl IoxObjectStore {
|
||||||
// .any(|object| object.location == prefix);
|
// .any(|object| object.location == prefix);
|
||||||
|
|
||||||
generations.push(Generation::new(id));
|
generations.push(Generation::new(id));
|
||||||
|
} else {
|
||||||
|
// Deliberately ignoring errors with parsing; if the directory isn't a usize, it's
|
||||||
|
// not a valid database generation directory and we should skip it.
|
||||||
|
warn!("invalid generation directory found: {}", id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue