Merge branch 'master' into nomerge2

This commit is contained in:
Ai Lin Chia
2017-04-19 15:55:10 +02:00
4 changed files with 24 additions and 14 deletions

2
Conf.h

@ -107,6 +107,8 @@ class Conf {
int32_t m_mergeBufSize;
// rdb settings
int32_t m_maxLostPositivesPercentage;
// posdb
int64_t m_posdbFileCacheSize;
int32_t m_posdbMaxTreeMem;

@ -7178,6 +7178,20 @@ void Parms::init ( ) {
m->m_obj = OBJ_CONF;
m++;
////////////////////
// generic rdb settings
////////////////////
m->m_title = "max percentage of lost positives after merge";
m->m_desc = "Maximum percentage of positive keys lost after merge that we'll allow. Anything above that we'll abort the instance";
m->m_cgi = "plpmerge";
simple_m_set(Conf,m_maxLostPositivesPercentage);
m->m_def = "50";
m->m_units = "percent";
m->m_flags = 0;//PF_HIDDEN | PF_NOSAVE;
m->m_page = PAGE_RDB;
m->m_group = true;
m++;
////////////////////
// clusterdb settings
////////////////////

@ -1208,7 +1208,14 @@ bool RdbBase::incorporateMerge ( ) {
}
if ( postmergePositiveRecords < m_premergeNumPositiveRecords - m_premergeNumNegativeRecords ) {
log(LOG_INFO,"merge: %s: lost %" PRId64" positives", m_dbname, m_premergeNumPositiveRecords - postmergePositiveRecords);
int64_t lostPositive = m_premergeNumPositiveRecords - postmergePositiveRecords;
double lostPercentage = (lostPositive * 100) / m_premergeNumPositiveRecords;
log(LOG_INFO,"merge: %s: lost %" PRId64" (%.2f%%) positives", m_dbname, lostPositive, lostPercentage);
if (lostPercentage > g_conf.m_maxLostPositivesPercentage) {
gbshutdownCorrupted();
}
}
if ( postmergeNegativeRecords > m_premergeNumNegativeRecords ) {

@ -1429,19 +1429,6 @@ void UdpSlot::readAck ( int32_t dgramNum, int64_t now ) {
m_queuedTime = now;
}
// to save memory in UdpSlot we only keep track of every 8th dgram time
//if ( (dgramNum & 0x07) == 0 ) {
// get when we sent this dgram
//int64_t start = getSendTime ( dgramNum >> 3 ) ;
// trip time
//int32_t tripTime = now - start;
// debug msg
//log("tripTime = %" PRId32, tripTime );
// . update host time
// . we should also stamp the host each time we re-send, too
// . this is now handled by g_hostdb::pingHost()
//g_hostdb.stampHost( m_hostId , tripTime, false/*timedOut?*/);
//}
// log msg
if ( g_conf.m_logDebugUdp ) {
//#ifdef _UDPDEBUG_