Skip to content

Commit

Permalink
namespace: print cache eviction reason in debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
psarna committed Dec 5, 2023
1 parent ec4d1c1 commit cf5e74f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libsql-server/src/namespace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,10 @@ impl<M: MakeNamespace> NamespaceStore<M> {
snapshot_at_shutdown: bool,
max_active_namespaces: usize,
) -> Self {
tracing::trace!("Max active namespaces: {max_active_namespaces}");
let store = Cache::<NamespaceName, NamespaceEntry<M::Database>>::builder()
.async_eviction_listener(move |name, ns, _| {
tracing::info!("evicting namespace `{name}` asynchronously");
.async_eviction_listener(move |name, ns, cause| {
tracing::debug!("evicting namespace `{name}` asynchronously: {cause:?}");
// TODO(sarna): not clear if we should snapshot-on-evict...
// On the one hand, better to do so, because we have no idea
// for how long we're evicting a namespace.
Expand Down

0 comments on commit cf5e74f

Please sign in to comment.