fix(state): make read_only_open_with_ephemeral_config_returns_error more robust - #11146
Conversation
|
Closing as bug no longer exists |
|
Accidentally closed the wrong PR. Reopening. |
And four more auto-invalidated findings. Analyzed one file, diff |
alchemydc
left a comment
There was a problem hiding this comment.
I went through the four v12 findings and verified each against the code. All four are mechanically real, but all four are pre-existing conditions of the read-only open path on main — none are introduced by this PR — so I don't think any of them should block it. Summary:
- F-107518 (panic on unreadable/malformed version file): real. The
.expectatzebra_db.rs:113panics when the version file exists but is permission-denied or unparseable;check_cache_dir_readableonly guards the top-level cache dir, so the doc comment above it overclaims. Note the read-write path has the identical.expect, so read-only is no worse — but a typed error would be better for a secondary reading a primary's cache. - F-107520 (read-only skips all format validation): real behaviorally, partly by design. Skipping upgrades read-only is required; silently accepting
Upgrade/Downgradedisk versions is a genuine gap (the stale-version-file scenario via an interruptedtry_reusing_previous_db_after_major_upgradeis real — it deliberately writes the old major into the new path's version file). Caveat on the suggested remedy: running the fatal validity checks on a secondary that lags a mid-upgrade primary could fail spuriously and panic, so "the checks are safe read-only" isn't clear-cut. A warn/error onUpgrade/Downgradein read-only mode seems like the right-sized fix. - F-107521 (indexer read-only serves empty spend indexes): real, and the most consequential — it produces silently wrong results (
None) rather than a crash, because the+indexermarker lives only in semver build metadata, whichcmp_precedenceignores, and the backfill only runs from the format-change task that read-only mode skips. Filed as #11155. - F-107522 (empty versioned dir → misleading "Database likely already open" panic): real. An empty
cache_dir/state/vN/<net>/yieldsSome(N.0.0), bypasses the newly-created guard, and the secondary open failure panics with a misleading hint. Error-message quality issue; deserves a typed error.
This PR's change itself is correct: it fixes the real root cause of the test flake (error-precedence depended on whether the default cache dir existed on the machine) and matches the authoritative check in DiskDb::new(). It also avoids the temp-dir leak from calling database_format_version_on_disk() with ephemeral = true. LGTM; the findings above are follow-up material for the read-only open feature, not this fix.
Merge Queue Status
This pull request spent 36 minutes 27 seconds in the queue, including 35 minutes 54 seconds running CI. Waiting for any of
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks
Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. Requeued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 2 minutes 9 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks HintYou may have to fix your CI before adding the pull request to the queue again. Requeued — the merge queue status continues in this comment ↓. |
☑️ This pull request is already queued |
Merge Queue Status
This pull request spent 2 minutes 29 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks HintYou may have to fix your CI before adding the pull request to the queue again. Requeued — the merge queue status continues in this comment ↓. |
…rror checking more robust
2c187ad to
2bbefc2
Compare
Merge Queue Status
This pull request spent 51 seconds in the queue, including 11 seconds running CI. Required conditions to merge
|
Link the read-only ephemeral configuration fix to PR #11146 so crate consumers can find its implementation and tests.
Link the read-only ephemeral configuration fix to PR #11146 so crate consumers can find its implementation and tests.
Link the read-only ephemeral configuration fix to PR #11146 so crate consumers can find its implementation and tests.
Motivation
Closes #11147
Solution
The issue was actually in the code, we improve error checking which makes the test reliable and not dependent on a specific folder existing or not during testing
Tests
Specifications & References
Follow-up Work
AI Disclosure
PR Checklist
type(scope): description