add connect method to call by hived at the beginning of synchronization process
There is a need to make some method in the hived API which initializes some internals of hive fork manager when a new session with hived is starting ( first connect to the HFM, or connect after rebooting the systems, crash etc... ). At the moment I see two things to do in the function:
- in the case of unintentional break (crash, SIG KILL, lack of electricity, etc... ) of reindexing (also known as replaying) there may stay rubbish data in the irreversible tables, thus because the reindexing threads are brutally stopped, and some parts of the last processing block were dumped and some not - the last block is not confirmed by rendezvous trigger. These rubbish data have to be removed from the irreversible tables.
- some useful information may be saved by the hived in the database, at the moment we know about the version of hived
- the tables which are now a part of the extension but have to be dumped with pg_dump must be created there https://www.postgresql.org/docs/11/extend-extensions.html
Even more useful, pg_dump knows that it should not dump the individual member objects of the extension — it will just include a CREATE EXTENSION command in dumps, instead. This vastly simplifies migration to a new version of the extension that might contain more or different objects than the old version.
https://www.postgresql.org/docs/12/extend-extensions.html
Ordinarily, if a table is part of an extension, neither the table's definition nor its content will be dumped by pg_dump.
The hived algorithm must be extended for the session initialization:
Edited by Marcin