Unexpected exception during reconnectiong api_node with enable sql serializer.

Scenario:

  1. Run init_node and allow to produce blocks.
  2. Run api_node connected to initnode and allow to synchronize.
  3. Close api_node
  4. Enable in api_node SQL serializer end set url to database in config.ini.
  5. Rerun api_node.
  6. Unexpected exception

2023-01-19T14:40:23.543077 data_processor.cpp:194 join ] Caught unhandled exception Dynamic exception type: pqxx::foreign_key_violation std::exception::what: ERROR: insert or update on table "irreversible_data" violates foreign key constraint "fk_1_hive_irreversible_data" DETAIL: Key (consistent_block)=(1264) is not present in table "blocks". CONTEXT: SQL statement "UPDATE hive.irreversible_data SET consistent_block = _block_num" PL/pgSQL function hive.set_irreversible(integer) line 30 at SQL statement

Edited by Radosław Masłowski