Repository navigation
fix(persistence): keep storage error text out of bulk-submit receipts - #3372
Open
angela-helios wants to merge 2 commits into
Open
angela-helios wants to merge 2 commits into
angela-helios wants to merge 2 commits into
Conversation
Per-entry receipts and file error artifacts on PostgreSQL, SQLite, MongoDB and composite storage carried the Display text of the internal StorageError. They now use StorageError::client_text(): a server-side fault is a fixed sentence with the detail in the log, and errors about the submitted content keep their text and issue code. client_text() also withholds the log-only reason of the Transient, CommitOutcomeUnknown, RolledBack and TooLargeForCache transaction errors, which the MongoDB ingest path can produce. Closes #3053
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3053
Behaviour change to review
internal storage error; the server log has the detailfor a server-side storage fault, where they used to carry the driver or SQL text. The detail is logged atwarn. The manifest error message for a file that failed on such a fault carries the same text.StorageError::client_text()now replaces the backendreasonofTransactionError::Transient,CommitOutcomeUnknown,RolledBackandTooLargeForCachewith a fixed sentence. Its other callers (purge audit descriptions,$reindexstatus errors, tenant UI alerts, bulk-export audit) change with it.Summary
Receipts that a submitter downloads from
$bulk-submit-statuswere built from theDisplaytext ofStorageErroron every backend except S3, so a storage fault put SQL fragments, table and index names or driver text indiagnostics.detail), the composite ingest index sink and the composite secondary sync (SyncStatus.error) now take their text fromStorageError::client_text().failed to ingest file ...error artifact uses the fixed text for backend and transaction errors. A broken input stream keeps its cause (connection reset ...), as bulk-submit ingest: a mid-body stream error completes the manifest with rows missing; the lease dies behind a WAL checkpoint and forces a full re-walk; Elasticsearch idles through the whole import #1127 requires.client_text()classifies the four transaction variants whosereasonis documented as log-only before its catch-all arm, since the MongoDB ingest path can produce them.Issue codes, line references and the wording of errors about the submitted content (conflicts, invalid resources, parse errors, tenant permission) are unchanged. S3 receipts were already sanitised and are not touched.
Tests
client_texton the four transaction variants; the worker'singest_failure_cause; MongoDBdetail,all_failedandinsert_failed.sync_ingestedrejection test now assert the fixed sentence and the absence of the backend's own text; two PostgreSQL savepoint tests that pinned the leaked trigger text now expect the fixed sentence.Results:
cargo test -p helios-persistence --libwith all backend features (sqlite, postgres, mongodb, s3, elasticsearch), filtered to the modules the pending fixes touch (among thembulk_submit,error::,composite::,backends::s3): 1081 passed.cargo test -p helios-persistence --test postgres_tests bulk_submitagainst a PostgreSQL container: 65 passed, 1 ignored. That includes the two updated savepoint tests.These ran on a branch that also carried other pending fixes, so the suites were verified in combination, not on this branch alone.