Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

fix: remove foreign key constraint #77

Merged
merged 2 commits into from
Jan 19, 2024
Merged

fix: remove foreign key constraint #77

merged 2 commits into from
Jan 19, 2024

Conversation

rllola
Copy link
Contributor

@rllola rllola commented Jan 17, 2024

fix issue #76

Remove the foreign key constraint on the secondary tables that collect the decoded transaction data. It should speed up things and remove the fk violation error because the indexer try to insert the decoded transaction before the raw transaction info.

We are assuming They would be there because they come from the same source of information.

@rllola rllola requested review from jleni and neithanmo January 19, 2024 09:37
@romanv1812
Copy link
Contributor

romanv1812 commented Jan 19, 2024

indexer |
postgres | 2024-01-19 11:08:27.444 UTC [96] ERROR: duplicate key value violates unique constraint "vote_proposal_pkey"
postgres | 2024-01-19 11:08:27.444 UTC [96] DETAIL: Key (vote_proposal_id)=(\x0000000000000000) already exists.
postgres | 2024-01-19 11:08:27.444 UTC [96] STATEMENT: INSERT INTO public_testnet_15.vote_proposal(
postgres | vote_proposal_id,
indexer | 2024-01-19T11:08:27.444561Z ERROR namadexer::indexer: Closing block producer task due to an error saving last block: Database error: error returned from database: duplicate key value violates unique constraint "vote_proposal_pkey"
indexer | at src/indexer/mod.rs:225
indexer |
postgres | vote,
postgres | vote_default,
postgres | voter,
postgres | tx_id
postgres | )VALUES ($1, $2, $3, $4, $5)
postgres | 2024-01-19 11:08:27.444 UTC [96] LOG: could not receive data from client: Connection reset by peer
indexer | Error: DB(Database(PgDatabaseError { severity: Error, code: "23505", message: "duplicate key value violates unique constraint "vote_proposal_pkey"", detail: Some("Key (vote_proposal_id)=(\x0000000000000000) already exists."), hint: None, position: None, where: None, schema: Some("public_testnet_15"), table: Some("vote_proposal"), column: None, data_type: None, constraint: Some("vote_proposal_pkey"), file: Some("nbtinsert.c"), line: Some(663), routine: Some("_bt_check_unique") }))
indexer exited with code 1

@rllola rllola merged commit 3d89fa0 into main Jan 19, 2024
5 checks passed
@rllola rllola deleted the fix/fk-issue branch January 19, 2024 14:39
@rllola
Copy link
Contributor Author

rllola commented Jan 19, 2024

@romanv1812
This is an other error unrelated to this. Could you create a new issue so we can look at this ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants