Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Database entries for every transfer failure #362

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

carver
Copy link
Contributor

@carver carver commented Jan 27, 2025

TODO: rebase on #355

Next major step toward #336 -- saving each transfer failure into the database.

@carver carver force-pushed the query-trace-failure-records branch from acf1577 to 8e822b8 Compare January 30, 2025 17:30
@carver carver force-pushed the query-trace-failure-records branch from 8e822b8 to 2862c65 Compare February 15, 2025 02:41
The sea-orm tools will reorder based on date, which makes sense.
Oddly, the date of the 'create census table' migration comes before
other entities that it requires, like 'record'. So this change renames
the migration to an impossible date, but one that keeps it in the same
ordering that it was manually inserted at before the change.

An impossible date was chosen as a flag that we don't really know when
the migration occured.
Successful audits can contain failed transfers, because of retries. We
would still like to record the failures for analysis.

Migration success was manually confirmed with:
DATABASE_URL=postgres://postgres:password@localhost:5432/glados sea-orm-cli migrate up

Entity file was generated, using a command like this:
sea-orm-cli generate entity -l -t audit_internal_failure --database-url postgres://postgres:password@localhost:5432/glados

Includes a test that the helper function correctly records internal
failures to DB, including the sender node ID and the type of failure.

Note that the temp DB must be passed around the test, even though it
isn't used directly. If it is dropped, then the connection to it will
fail.
@carver carver force-pushed the query-trace-failure-records branch from c23d573 to 0da52f0 Compare February 18, 2025 06:05
@carver carver marked this pull request as ready for review February 18, 2025 06:05
@carver carver self-assigned this Feb 18, 2025
@carver carver changed the title WIP: Add Database entries for every transfer failure Add Database entries for every transfer failure Feb 18, 2025
@carver carver requested a review from mrferris February 18, 2025 16:40
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