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
@bfops bfops added the release-any To be landed in any release window label Jan 12, 2026
Copy link
Contributor

@gefjon gefjon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better error messages, thank you!

@kim kim merged commit 02eeeb4 into kim/in-memory-module-logs Jan 16, 2026
38 of 41 checks passed
@kim kim deleted the kim/disk-logs branch January 16, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants