Additional pruning logs
This commit is contained in:
		
					parent
					
						
							
								2bd58ddee6
							
						
					
				
			
			
				commit
				
					
						ccda6d6675
					
				
			
		
					 2 changed files with 14 additions and 5 deletions
				
			
		|  | @ -427,12 +427,15 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, std::filesy | |||
| 				logger.critical (nano::log::type::node, "Incompatibility detected between config node.enable_voting and existing pruned blocks"); | ||||
| 				std::exit (1); | ||||
| 			} | ||||
| 			else if (!flags.enable_pruning && !flags.inactive_node) | ||||
| 			if (!flags.enable_pruning && !flags.inactive_node) | ||||
| 			{ | ||||
| 				logger.critical (nano::log::type::node, "To start node with existing pruned blocks use launch flag --enable_pruning"); | ||||
| 				std::exit (1); | ||||
| 			} | ||||
| 
 | ||||
| 			logger.warn (nano::log::type::node, "WARNING: Ledger pruning is enabled. This feature is experimental and may result in node instability! Please see release notes for more information."); | ||||
| 		} | ||||
| 
 | ||||
| 		cementing_set.cemented_observers.add ([this] (auto const & block) { | ||||
| 			// TODO: Is it neccessary to call this for all blocks?
 | ||||
| 			if (block->is_send ()) | ||||
|  |  | |||
|  | @ -38,14 +38,20 @@ void nano::pruning::stop () | |||
| 
 | ||||
| void nano::pruning::ongoing_ledger_pruning () | ||||
| { | ||||
| 	if (stopped) | ||||
| 	{ | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	auto bootstrap_weight_reached (ledger.block_count () >= ledger.bootstrap_weight_max_blocks); | ||||
| 
 | ||||
| 	ledger_pruning (flags.block_processor_batch_size != 0 ? flags.block_processor_batch_size : 2 * 1024, bootstrap_weight_reached); | ||||
| 
 | ||||
| 	auto const ledger_pruning_interval (bootstrap_weight_reached ? config.max_pruning_age : std::min (config.max_pruning_age, std::chrono::seconds (15 * 60))); | ||||
| 	logger.debug (nano::log::type::pruning, "Next pruning iteration in {}s", ledger_pruning_interval.count ()); | ||||
| 	workers.post_delayed (ledger_pruning_interval, [this] () { | ||||
| 		workers.post ([this] () { | ||||
| 		ongoing_ledger_pruning (); | ||||
| 	}); | ||||
| 	}); | ||||
| } | ||||
| 
 | ||||
| void nano::pruning::ledger_pruning (uint64_t const batch_size_a, bool bootstrap_weight_reached_a) | ||||
|  | @ -89,7 +95,7 @@ void nano::pruning::ledger_pruning (uint64_t const batch_size_a, bool bootstrap_ | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	logger.debug (nano::log::type::pruning, "Total recently pruned block count: {}", pruned_count); | ||||
| 	logger.info (nano::log::type::pruning, "Recently pruned blocks: {}", pruned_count); | ||||
| } | ||||
| 
 | ||||
| bool nano::pruning::collect_ledger_pruning_targets (std::deque<nano::block_hash> & pruning_targets_a, nano::account & last_account_a, uint64_t const batch_read_size_a, uint64_t const max_depth_a, uint64_t const cutoff_time_a) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Piotr Wójcik
				Piotr Wójcik