aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-20 20:56:47 -0500
committerRiccardo Spagni <ric@spagni.net>2017-01-20 20:56:47 -0500
commit8698dd36f2945f8b2c672e94f3f2925d6e271c83 (patch)
tree1b4ccb0232d9cdddfe6d47f0c631b9d432a12d4a
parentMerge pull request #1586 (diff)
parentTweak some msg loglevels (diff)
downloadmonero-8698dd36f2945f8b2c672e94f3f2925d6e271c83.tar.xz
Merge pull request #1587
843769f8 Tweak some msg loglevels (Howard Chu)
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 343fd1fa4..7d548afed 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -441,7 +441,7 @@ void BlockchainLMDB::do_resize(uint64_t increase_size)
if (result)
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();
}
@@ -525,7 +525,7 @@ void BlockchainLMDB::check_and_resize_for_batch(uint64_t batch_num_blocks)
// size-based check
if (need_resize(threshold_size))
{
- LOG_PRINT_L0("[batch] DB resize needed");
+ MGINFO("[batch] DB resize needed");
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)
{
- 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;
}
#if VERSION > 0
@@ -2301,11 +2301,11 @@ void BlockchainLMDB::batch_commit()
if (! m_batch_transactions)
throw0(DB_ERROR("batch transactions not enabled"));
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)
- throw0(DB_ERROR("batch transaction not in progress"));
+ throw1(DB_ERROR("batch transaction not in progress"));
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();
@@ -2328,11 +2328,11 @@ void BlockchainLMDB::batch_stop()
if (! m_batch_transactions)
throw0(DB_ERROR("batch transactions not enabled"));
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)
- throw0(DB_ERROR("batch transaction not in progress"));
+ throw1(DB_ERROR("batch transaction not in progress"));
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();
LOG_PRINT_L3("batch transaction: committing...");
TIME_MEASURE_START(time1);
@@ -2354,9 +2354,11 @@ void BlockchainLMDB::batch_abort()
if (! m_batch_transactions)
throw0(DB_ERROR("batch transactions not enabled"));
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())
- return; // batch txn owned by other thread
+ throw1(DB_ERROR("batch transaction owned by other thread"));
check_open();
// for destruction of batch transaction
m_write_txn = nullptr;