Skip to content
Snippets Groups Projects

issue #223: correctly detect if reversible data have to be removed after hived restart

Closed issue #223: correctly detect if reversible data have to be removed after hived restart
Closed Marcin requested to merge mi_investigate_restart_with_app into develop
Compare and Show latest version
3 files
+ 16
607
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -441,7 +441,21 @@ indexation_state::on_irreversible_block( uint32_t block_num ) {
}
void
indexation_state::on_switch_fork( cached_data_t& cached_data, uint32_t block_num ) {
indexation_state::on_switch_fork( uint32_t last_synced_block_num, cached_data_t& cached_data, uint32_t block_num ) {
if ( _state == INDEXATION::START && last_synced_block_num > block_num ) {
ilog( "Fork at start ${lb} ${b}", ("lb", last_synced_block_num)("b", block_num) );
// it is fork generated by hived during starting
auto connect_to_the_db = [&](const data_processor::data_chunk_ptr& dataPtr, transaction_controllers::transaction& tx ){
const auto FORK_QUERY = "SELECT hive.back_from_fork(" + std::to_string(block_num) + ")";
tx.exec( FORK_QUERY );
return data_processor::data_processing_status();
};
queries_commit_data_processor processor( _db_url, "Connect to the db", "connectdb", connect_to_the_db, nullptr, theApp );
processor.trigger( nullptr, 0 );
processor.join();
return;
}
if ( _state != INDEXATION::P2P ) {
return;
}
Loading