Add versioning - #15
Conversation
|
|
||
| void HMState::setStateVersion(uint32_t version) | ||
| { | ||
| m_stateVersion = version; |
There was a problem hiding this comment.
Can you also include a check for uintmax_t
| HMTimeStamp checkTime = it->second.nextCheckTime(ip, version); | ||
| HM_WORK_STATE query_state = it->second.getQueryState(ip); | ||
| uint32_t query_version = it->second.getQueryVersion(ip); | ||
| if ( query_version != version ) { |
There was a problem hiding this comment.
for formatting can we have the brackets ({) in new line
| AF_INET), | ||
| HMDataHostCheck(it->first.second.getType()), | ||
| it->first.second)); | ||
| dnslookup->setReschedule(false); |
There was a problem hiding this comment.
Can you explain why reschedule is set to false
| currentState->m_checkList.queueCheck(m_hostname, *iit, check, m_stateManager->m_workQueue, getStateVersion()); | ||
| } | ||
| else{ | ||
| // We will hit this path after a reload for hosts |
| \return true if the check is expired and needs to be run now. | ||
| */ | ||
| bool queryNeeded() const; | ||
| bool queryNeeded(uint32_t version=0) const; |
There was a problem hiding this comment.
Can you create a constant HM_DEFAULT_STATE_VERSION = 0 in HMConstants.h and use it
|
|
||
| HM_SCHEDULE_STATE | ||
| HMDataCheckList::checkNeeded(string& hostname, HMIPAddress& ip, HMDataHostCheck& hostCheck) | ||
| HMDataCheckList::checkNeeded(string& hostname, HMIPAddress& ip, HMDataHostCheck& hostCheck, uint32_t version) |
There was a problem hiding this comment.
can you add the default parameter like in header uint32_t version = HM_DEFAULT_STATE_VERSION / 0
| currentState->m_dnsCache.queueDNSQuery(data->m_hostname, | ||
| data->m_dnsHostCheck, | ||
| state->m_workQueue); | ||
| state->m_workQueue, |
There was a problem hiding this comment.
addDNSTimeout, addHealthCheckTimeout functions are not overloaded
| data->m_dnsHostCheck, | ||
| state->m_workQueue); | ||
| state->m_workQueue, | ||
| state->getStateVersion()); |
There was a problem hiding this comment.
state doesnn't have function getStateVersion() , did you mean currentState->getStateVersion()
| data->m_address, data->m_hostCheck, | ||
| state->m_workQueue); | ||
| state->m_workQueue, | ||
| state->getStateVersion()); |
uthiramohan
left a comment
There was a problem hiding this comment.
New tag ll be released once the reviews are addressed
This change adds versioning changes to the state
Description
After quick consecutive reloads, the workQueue gets filled up with multiple work orders for the same hostname( spawned by states belonging to previous reloads) . This change adds a version to each state and increments it on each reload. With this change, after every check is done, the version of the check is compared with the current state version to see if the check belongs to a previous state and is discarded if so.