hpfs binary with optimized write fix. (#303)

* Updated hpfs bin.
* Improved logs.
* Local cluster script log level fix.
This commit is contained in:
Ravin Perera
2021-05-08 17:51:16 +05:30
committed by GitHub
parent ef2bb22b67
commit 321ae2d753
8 changed files with 10 additions and 9 deletions

View File

@@ -275,7 +275,7 @@ namespace comm
/**
* Returns printable name for the session based on uniqueid (used for logging).
*/
const std::string comm_session::display_name()
const std::string comm_session::display_name() const
{
if (challenge_status == comm::CHALLENGE_STATUS::CHALLENGE_VERIFIED)
{

View File

@@ -71,7 +71,7 @@ namespace comm
void mark_for_closure();
void close();
void mark_as_verified();
virtual const std::string display_name();
virtual const std::string display_name() const;
void set_threshold(const SESSION_THRESHOLDS threshold_type, const uint64_t threshold_limit, const uint32_t intervalms);
void increment_metric(const SESSION_THRESHOLDS threshold_type, const uint64_t amount);

View File

@@ -263,7 +263,7 @@ namespace hpfs
// Validate received fs data against the hash.
if (!validate_fs_entry_hash(vpath, hash, fs_resp.dir_mode(), peer_fs_entries))
{
LOG_INFO << "Hpfs " << name << " sync: Skipping response from [" << from << "] due to fs entry hash mismatch.";
LOG_INFO << "Hpfs " << name << " sync: Skipping mismatched fs entries response from [" << from << "] for " << vpath;
continue;
}
@@ -281,7 +281,7 @@ namespace hpfs
// Validate received hashmap against the hash.
if (!validate_file_hashmap_hash(vpath, hash, file_resp.file_mode(), block_hashes, block_hash_count))
{
LOG_INFO << "Hpfs " << name << " sync: Skipping response from [" << from << "] due to file hashmap hash mismatch.";
LOG_INFO << "Hpfs " << name << " sync: Skipping mismatched hashmap response from [" << from << "] for " << vpath;
continue;
}
@@ -309,7 +309,8 @@ namespace hpfs
// Validate received block data against the hash.
if (!validate_file_block_hash(hash, block_id, buf))
{
LOG_INFO << "Hpfs " << name << " sync: Skipping response from [" << from << "] due to file block hash mismatch.";
LOG_INFO << "Hpfs " << name << " sync: Skipping mismatched block response from [" << from << "] for block_id:" << block_id
<< " (len:" << buf.length() << ") of " << vpath;
continue;
}

View File

@@ -45,7 +45,7 @@ namespace msg::fbuf::p2pmsg
const uint64_t time_now = util::get_epoch_milliseconds();
if (p2p_msg->created_on() < (time_now - (conf::cfg.contract.roundtime * 4)))
{
LOG_DEBUG << "Peer message is too old. type:" << p2p_msg->content_type() << " [" << (session ? session->uniqueid : "") << "]";
LOG_DEBUG << "Peer message is too old. type:" << p2p_msg->content_type() << " from:" << (session ? session->display_name() : "");
return p2p::peer_message_info{NULL, P2PMsgContent_NONE, 0};
}
}

View File

@@ -259,7 +259,7 @@ namespace p2p
const uint64_t time_now = util::get_epoch_milliseconds();
if (originated_on < (time_now - (conf::cfg.contract.roundtime * 3)))
{
LOG_DEBUG << "Peer message is too old for forwarding. type:" << msg_type << " [" << session.uniqueid << "]";
LOG_DEBUG << "Peer message is too old for forwarding. type:" << msg_type << " from:" << session.display_name();
return false;
}

View File

@@ -82,7 +82,7 @@ namespace p2p
if (!recent_peermsg_hashes.try_emplace(crypto::get_hash(message)))
{
session.increment_metric(comm::SESSION_THRESHOLDS::MAX_DUPMSGS_PER_MINUTE, 1);
LOG_DEBUG << "Duplicate peer message. type:" << mi.type << " " << session.display_name() << " [" << session.uniqueid << "]";
LOG_DEBUG << "Duplicate peer message. type:" << mi.type << " from:" << session.display_name();
return 0;
}

Binary file not shown.

View File

@@ -116,7 +116,7 @@ do
}, null, 2)")
log_json=$(node -p "JSON.stringify({...require('./tmp.json').log, \
loglevel: '$loglevel', \
log_level: '$loglevel', \
loggers:['console', 'file'] \
}, null, 2)")