duplicate key value violates unique constraint when hived resumes operation after Ctrl+C from live sync
Running 74e5cc4e of haf with hived at e266447c601c89f16a94cea69b4ca59249811897 when stopped and started again
183 2021-12-03T14:01:54.650 p2p_plugin.cpp:184 handle_block ] Got 119 transactions on block 59715494 by roelandp -- Block Time Offset: 650 ms
186 2021-12-03T14:01:57.194 data_processor.cpp:152 only_report_batch_fi ] 59715495 commited by Transaction multisig data writer
186 2021-12-03T14:01:57.194 data_processor.cpp:152 only_report_batch_fi ] 59715495 commited by Accounts data writer
186 2021-12-03T14:01:57.211 block_num_rendezvous_trigger.cpp:37 report_complete_thre ] Dump whole block 59715495
186 2021-12-03T14:01:57.661 database.cpp:1420 notify_irreversible_ ] Caught unexpected exception in plugin: ERROR: duplicate key value violates unique constraint "hive_account_operations_uq_1"
186 DETAIL: Key (account_id, account_op_seq_no)=(626420, 0) already exists.
186 CONTEXT: SQL statement "INSERT INTO hive.account_operations
186 SELECT
186 haor.account_id
186 , haor.account_op_seq_no
186 , haor.operation_id
186 FROM
186 hive.account_operations_reversible haor
186 JOIN hive.operations_reversible hor1 ON hor1.id = haor.operation_id AND haor.fork_id = hor1.fork_id
186 JOIN (
186 SELECT
186 DISTINCT ON ( hbr.num ) hbr.num
186 , hor.fork_id
186 FROM hive.blocks_reversible hbr
186 LEFT JOIN hive.operations_reversible hor ON hor.fork_id = hbr.fork_id AND hor.block_num = hbr.num
186 WHERE
186 hbr.num <= _new_irreversible_block
186 AND hbr.num > _head_block_of_irreversible_blocks
186 ORDER BY hbr.num ASC, hbr.fork_id DESC
186 ) as num_and_forks ON hor1.fork_id = num_and_forks.fork_id AND hor1.block_num = num_and_forks.num"
186 PL/pgSQL function copy_account_operations_to_irreversible(integer,integer) line 3 at SQL statement
186 SQL statement "SELECT hive.copy_account_operations_to_irreversible( __irreversible_head_block, _block_num )"
186 PL/pgSQL function set_irreversible(integer) line 18 at PERFORM
186
186 2021-12-03T14:01:57.662 p2p_plugin.cpp:184 handle_block ] Got 120 transactions on block 59715495 by blocktrades -- Block Time Offset: 662 ms