error logs from sql_serializer `insert or update on table "transactions_reversible" violates foreign key constraint`
2762627ms database.cpp:1410 notify_post_apply_bl ] Caught unexpected exception in plugin: ERROR: insert or update on table "transactions_reversible" violates foreign key constraint "fk_1_hive_transactions_reversible"
DETAIL: Key (block_num, fork_id)=(229, 4) is not present in table "blocks_reversible".
CONTEXT: SQL statement "INSERT INTO hive.transactions_reversible VALUES( ( unnest( _transactions ) ).*, __fork_id )"
PL/pgSQL function hive.push_block(hive.blocks,hive.transactions[],hive.transactions_multisig[],hive.operations[]) line 13 at SQL statement
This happens all the time when executing test test_trigger_undo_with_witnesses.py from branch ms_more_fork_tests https://gitlab.syncad.com/hive/hive/-/tree/ms_more_fork_tests
Test is not yet properly configured to run on CI, so to execute you must:
- have postgres and extension hive_fork_manager installed
- have user 'myuser' with password 'mypassword' and membership in 'hived_group'
- create database, example commands psql -d postgres -c 'DROP DATABASE IF EXISTS haf_block_log;'; psql -d postgres -c 'CREATE DATABASE haf_block_log;'; psql -d haf_block_log -c 'CREATE EXTENSION hive_fork_manager;';
- run test test_trigger_undo_with_witnesses as usual, by cd tests/functional/python_tests/more_fork_tests; pytest -s test_trigger_undo_with_witnesses.py;
- watch logs from node connected to database, for example less GeneratedInWorld/Beta/ApiNode1/stderr.txt
There is also issue with some missing blocks/operations in database 'select * from hive.blocks order by num;' but I'm not sure if this is related, maybe there will be another issue here.