Skip to content

fix(pegboard-envoy): downgrade fresh sqlite miss log#4994

Draft
NathanFlurry wants to merge 1 commit intomainfrom
sqlite-logs/downgrade-fresh-db-miss
Draft

fix(pegboard-envoy): downgrade fresh sqlite miss log#4994
NathanFlurry wants to merge 1 commit intomainfrom
sqlite-logs/downgrade-fresh-db-miss

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

@NathanFlurry NathanFlurry commented May 7, 2026

Stack Context

This PR quiets expected SQLite bootstrap noise in pegboard-envoy logs.

Why?

Fresh actor SQLite databases do not have a Depot branch until the first commit creates one. The native VFS intentionally treats a missing page 1 read as empty-database bootstrap, so logging that exact case as an error creates false alarms while investigating real SQLite failures.

The error log remains for non-bootstrap get_pages failures, including non-page-1 reads, known-head reads, timeouts, and fence issues.

@railway-app
Copy link
Copy Markdown

railway-app Bot commented May 7, 2026

🚅 Deployed to the rivet-pr-4994 environment in rivet-frontend

Service Status Web Updated (UTC)
website 😴 Sleeping (View Logs) Web May 7, 2026 at 6:51 am
frontend-inspector ❌ Build Failed (View Logs) Web May 7, 2026 at 6:50 am
ladle ❌ Build Failed (View Logs) Web May 7, 2026 at 6:43 am
frontend-cloud ❌ Build Failed (View Logs) Web May 7, 2026 at 6:43 am
mcp-hub ✅ Success (View Logs) Web May 7, 2026 at 6:43 am
kitchen-sink ❌ Build Failed (View Logs) Web May 7, 2026 at 6:42 am

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 7, 2026

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 7, 2026

Code Review

PR: fix(pegboard-envoy): downgrade fresh sqlite miss log
Status: Draft

Overview

This PR quiets expected log noise by demoting a specific error-level log to debug when a fresh actor SQLite database has no persisted Depot branch yet. The detection is gated on three conditions: page 1 read, no expected head txid, and a specific depot error variant — which is appropriately conservative.


Code Quality

Positive:

  • The is_initial_sqlite_database_missing helper is clean, well-scoped, and correctly triple-gated. False suppression is unlikely: all three conditions must hold simultaneously.
  • Inline comment in the helper accurately explains the invariant without documenting obvious code.
  • Tracing fields are consistent between the demoted debug path and the retained error path — diagnostics are preserved.
  • Log messages are lowercase and structured, matching CLAUDE.md conventions.
  • The match on MetaMissing { operation: "get_pages" } is intentionally narrow, which is the right call here.

Minor suggestions:

  • pgnos == [1] is valid and idiomatic Rust, but the block comment above the predicate already explains the SQLite page-1 invariant well, so no change needed there.
  • debug level is appropriate. trace could also be argued since this is expected steady-state bootstrap behavior, but debug is useful when actively investigating a fresh-actor issue, so it's the right call.

Correctness

The logic is sound. The three conditions together uniquely identify the bootstrap case:

  1. pgnos == [1] — only the root page, not any data page
  2. expected_head_txid.is_none() — no committed state exists yet
  3. DatabaseNotFound | MetaMissing { operation: "get_pages" } — depot confirms nothing is stored

Non-bootstrap get_pages failures (wrong page, known-head reads, timeouts, fence issues) continue to log at error. No real failures are silenced.


Security / Risk

No security impact. Log demotion for an expected-good path; no behavior change in the response path (sqlite_error_response is still returned in both branches).


Summary

Clean, minimal fix with correct and conservative detection logic. Ready to merge once out of draft.

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.

1 participant