Skip to content

Conversation

@kim
Copy link
Contributor

@kim kim commented Jan 9, 2026

If a database is not currently running / runnable, we can still serve module logs if, and only if, the routing layer has correctly picked the last known leader.

To determine that this is the case, we make it so a predicate can be evaluated against the error return of NodeDelegate::leader.

In the future, we may be able to fetch from the last known leader transparently, or store module logs in distributed storage altogether, at which point the predicate trait can be retired.

In order to not leak information about the server's directory structure, DatabaseLogger::read_latest_on_disk will return an empty stream in case no log directory or recent log file exist on disk.

Expected complexity level and risk

1.5

Testing

n/a

@kim kim requested review from coolreader18 and gefjon January 9, 2026 14:08
@kim kim mentioned this pull request Jan 9, 2026
@kim
Copy link
Contributor Author

kim commented Jan 9, 2026

Stacked on top of #3961

@kim kim force-pushed the kim/in-memory-module-logs branch from c7ad80b to edb5dc8 Compare January 9, 2026 14:31
@kim kim force-pushed the kim/in-memory-module-logs branch from edb5dc8 to 38524a5 Compare January 9, 2026 14:53
If a database is not currently running / runnable, we can still serve
module logs if, and only if, the routing layer has correctly picked the
last known leader.

To determine that this is the case, we make it so a predicate can be
evaluated against the error return of `NodeDelegate::leader`.

In the future, we may be able to fetch from the last known leader
transparently, or store module logs in distributed storage altogether,
at which point the predicate trait can be retired.

In order to not leak information about the server's directory structure,
`DatabaseLogger::read_latest_on_disk` will return an empty stream in
case no log directory or recent log file exist on disk.
@kim kim force-pushed the kim/in-memory-module-logs branch from 38524a5 to 84ff62d Compare January 9, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants