Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkg/storage/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,17 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
}
// Else, already have a LoggerAndTracer. This only occurs in unit tests.

// Override Pebble's exit function so that invariant violation exits
// route through CockroachDB's fatal logging. Without this, Pebble's
// direct os.Exit(1) calls (cache invariant checks, memtable
// assertions, etc.) bypass all logging, crash reporting, and marker
// file writing — the process just vanishes with no indication of why.
//
// Requires cockroachdb/pebble#5865.
cfg.opts.ExitFunc = func(code int) {
log.Storage.Fatalf(logCtx, "pebble: invariant violation (exit code %d)", code)
}

// Establish the emergency ballast if we can. If there's not sufficient
// disk space, the ballast will be reestablished from Capacity when the
// store's capacity is queried periodically.
Expand Down
Loading