eureka-network / rs-eureka

Eureka sink
0 stars 0 forks source link

stopping and restarting run-time might still try to insert duplicate keys on restarting #84

Closed benjaminbollen closed 1 year ago

benjaminbollen commented 1 year ago

when starting /bin/packages/blocks/ethereum, and then stopping and restarting won't (always) work

thread 'main' panicked at 'Failed to execute query: FailedToExecuteQuery { query: "INSERT INTO ethereummainnet.eth_blockheaders (id,number,hash,timestamp,parent_hash) VALUES ('b419bbcd446a238539b2a89f0564783dbd58c3f3eaf08bd15a9843553a4de430',100,'dfe2e70d6c116a541101cecbb256d7402d62125f6ddc9b607d49edc989825c64','2015-07-30T15:34:03Z','db10afd3efa45327eb284c83cc925bd9bd7966aea53067c1eebe0724d124ec1e')", error: "duplicate key value violates unique constraint \"eth_blockheaders_pk\"" }', eureka-sink-postgres/db/src/flush.rs:31:30

this is likely because we don't properly clean up our runtime on exit, so flushing and cursor tables won't work as expected

vadim-frolov commented 1 year ago

fixed in PR #99