Merge pull request #1587

843769f8 Tweak some msg loglevels (Howard Chu)
This commit is contained in:
Riccardo Spagni 2017-01-20 20:56:47 -05:00
commit 8698dd36f2
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
1 changed files with 13 additions and 11 deletions

View File

@ -441,7 +441,7 @@ void BlockchainLMDB::do_resize(uint64_t increase_size)
if (result) if (result)
throw0(DB_ERROR(lmdb_error("Failed to set new mapsize: ", result).c_str())); throw0(DB_ERROR(lmdb_error("Failed to set new mapsize: ", result).c_str()));
MINFO("LMDB Mapsize increased." << " Old: " << mei.me_mapsize / (1024 * 1024) << "MiB" << ", New: " << new_mapsize / (1024 * 1024) << "MiB"); MGINFO("LMDB Mapsize increased." << " Old: " << mei.me_mapsize / (1024 * 1024) << "MiB" << ", New: " << new_mapsize / (1024 * 1024) << "MiB");
mdb_txn_safe::allow_new_txns(); mdb_txn_safe::allow_new_txns();
} }
@ -525,7 +525,7 @@ void BlockchainLMDB::check_and_resize_for_batch(uint64_t batch_num_blocks)
// size-based check // size-based check
if (need_resize(threshold_size)) if (need_resize(threshold_size))
{ {
LOG_PRINT_L0("[batch] DB resize needed"); MGINFO("[batch] DB resize needed");
do_resize(increase_size); do_resize(increase_size);
} }
} }
@ -1172,7 +1172,7 @@ void BlockchainLMDB::open(const std::string& filename, const int mdb_flags)
{ {
if (*(const uint32_t*)v.mv_data > VERSION) if (*(const uint32_t*)v.mv_data > VERSION)
{ {
MINFO("Existing lmdb database was made by a later version. We don't know how it will change yet."); MWARNING("Existing lmdb database was made by a later version. We don't know how it will change yet.");
compatible = false; compatible = false;
} }
#if VERSION > 0 #if VERSION > 0
@ -2301,11 +2301,11 @@ void BlockchainLMDB::batch_commit()
if (! m_batch_transactions) if (! m_batch_transactions)
throw0(DB_ERROR("batch transactions not enabled")); throw0(DB_ERROR("batch transactions not enabled"));
if (! m_batch_active) if (! m_batch_active)
throw0(DB_ERROR("batch transaction not in progress")); throw1(DB_ERROR("batch transaction not in progress"));
if (m_write_batch_txn == nullptr) if (m_write_batch_txn == nullptr)
throw0(DB_ERROR("batch transaction not in progress")); throw1(DB_ERROR("batch transaction not in progress"));
if (m_writer != boost::this_thread::get_id()) if (m_writer != boost::this_thread::get_id())
return; // batch txn owned by other thread throw1(DB_ERROR("batch transaction owned by other thread"));
check_open(); check_open();
@ -2328,11 +2328,11 @@ void BlockchainLMDB::batch_stop()
if (! m_batch_transactions) if (! m_batch_transactions)
throw0(DB_ERROR("batch transactions not enabled")); throw0(DB_ERROR("batch transactions not enabled"));
if (! m_batch_active) if (! m_batch_active)
throw0(DB_ERROR("batch transaction not in progress")); throw1(DB_ERROR("batch transaction not in progress"));
if (m_write_batch_txn == nullptr) if (m_write_batch_txn == nullptr)
throw0(DB_ERROR("batch transaction not in progress")); throw1(DB_ERROR("batch transaction not in progress"));
if (m_writer != boost::this_thread::get_id()) if (m_writer != boost::this_thread::get_id())
return; // batch txn owned by other thread throw1(DB_ERROR("batch transaction owned by other thread"));
check_open(); check_open();
LOG_PRINT_L3("batch transaction: committing..."); LOG_PRINT_L3("batch transaction: committing...");
TIME_MEASURE_START(time1); TIME_MEASURE_START(time1);
@ -2354,9 +2354,11 @@ void BlockchainLMDB::batch_abort()
if (! m_batch_transactions) if (! m_batch_transactions)
throw0(DB_ERROR("batch transactions not enabled")); throw0(DB_ERROR("batch transactions not enabled"));
if (! m_batch_active) if (! m_batch_active)
throw0(DB_ERROR("batch transaction not in progress")); throw1(DB_ERROR("batch transaction not in progress"));
if (m_write_batch_txn == nullptr)
throw1(DB_ERROR("batch transaction not in progress"));
if (m_writer != boost::this_thread::get_id()) if (m_writer != boost::this_thread::get_id())
return; // batch txn owned by other thread throw1(DB_ERROR("batch transaction owned by other thread"));
check_open(); check_open();
// for destruction of batch transaction // for destruction of batch transaction
m_write_txn = nullptr; m_write_txn = nullptr;