Skip to content

go/store/nbs: For local databases, crash on fatal I/O errors during writes.#10429

Merged
reltuk merged 2 commits intomainfrom
aaron/fsync-fail-crash
Feb 10, 2026
Merged

go/store/nbs: For local databases, crash on fatal I/O errors during writes.#10429
reltuk merged 2 commits intomainfrom
aaron/fsync-fail-crash

Conversation

@reltuk
Copy link
Copy Markdown
Contributor

@reltuk reltuk commented Feb 5, 2026

If an fsync fails, or if a critical write(2) calls returns an error against a shared mutable file, it is not safe for the server to keep running because it cannot necessarily guarantee the state of the files as they exist on disk and will exist on disk in the future.

Implement functionality so that the Dolt process cashes in such cases.

reltuk and others added 2 commits February 5, 2026 14:20
…rites.

If an fsync fails, or if a critical write(2) calls returns an error
against a shared mutable file, it is not safe for the server to
keep running because it cannot necessarily guarantee the state of
the files as they exist on disk and will exist on disk in the future.

Implement functionality so that the Dolt process cashes in such
cases.
@coffeegoddd
Copy link
Copy Markdown
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
0fc9dcc ok 5937471
version total_tests
0fc9dcc 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
b120fd3 ok 5937471
version total_tests
b120fd3 5937471
correctness_percentage
100.0

@reltuk reltuk requested a review from zachmu February 6, 2026 00:40
Copy link
Copy Markdown
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM

I didn't think deeply about whether the choice of behavior was correct in all instances, but the interfaces seem sensible.

func Fatalf(behavior FatalBehavior, msg string, args ...any) error {
if behavior == FatalBehaviorCrash {
go func() {
panic(fmt.Sprintf("fatal error: "+msg, args...))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this print a stack trace of the calling goroutine? I don't think it does, and it probably should.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah just tested, this gets its own stack trace starting from this stack frame.

You should def capture a stack trace before the goroutine is started.

@reltuk reltuk merged commit 8a7273a into main Feb 10, 2026
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants