mirror of https://gitee.com/bigwinds/arangodb
fixed compaction bug
This commit is contained in:
parent
2062e84ceb
commit
0221f2582c
|
@ -239,8 +239,6 @@ bool Agent::recvAppendEntriesRPC(term_t term,
|
|||
|
||||
MUTEX_LOCKER(mutexLocker, _ioLock);
|
||||
|
||||
// index_t lastPersistedIndex = _lastCommitIndex;
|
||||
|
||||
if (this->term() > term) {
|
||||
LOG_TOPIC(WARN, Logger::AGENCY) << "I have a higher term than RPC caller.";
|
||||
return false;
|
||||
|
@ -258,11 +256,12 @@ bool Agent::recvAppendEntriesRPC(term_t term,
|
|||
<< " entries to state machine.";
|
||||
/* bool success = */
|
||||
_state.log(queries, term, prevIndex, prevTerm);
|
||||
_spearhead.apply(_state.slices(_lastCommitIndex + 1, leaderCommitIndex));
|
||||
_readDB.apply(_state.slices(_lastCommitIndex + 1, leaderCommitIndex));
|
||||
_lastCommitIndex = leaderCommitIndex;
|
||||
}
|
||||
|
||||
_spearhead.apply(_state.slices(_lastCommitIndex + 1, leaderCommitIndex));
|
||||
_readDB.apply(_state.slices(_lastCommitIndex + 1, leaderCommitIndex));
|
||||
_lastCommitIndex = leaderCommitIndex;
|
||||
|
||||
if (_lastCommitIndex >= _nextCompationAfter) {
|
||||
|
||||
_state.compact(_lastCommitIndex);
|
||||
|
|
|
@ -185,7 +185,7 @@ void State::removeConflicts (query_t const& transactions) {
|
|||
if (idx-_cur < _log.size()) {
|
||||
LOG_TOPIC(DEBUG, Logger::AGENCY)
|
||||
<< "Removing " << _log.size()-idx+_cur
|
||||
<< " entries from log starting with " << idx;
|
||||
<< " entries from log starting with " << idx << "=" << _log.at(idx-_cur).index;
|
||||
|
||||
// persisted logs
|
||||
std::stringstream aql;
|
||||
|
@ -203,7 +203,7 @@ void State::removeConflicts (query_t const& transactions) {
|
|||
// volatile logs
|
||||
{
|
||||
MUTEX_LOCKER(mutexLocker, _logLock);
|
||||
_log.erase(_log.begin()+idx-1);
|
||||
_log.erase(_log.begin()+idx-_cur-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ if [[ $(( $NRAGENTS % 2 )) == 0 ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
MINP=1.0
|
||||
MAXP=5.0
|
||||
MINP=0.5
|
||||
MAXP=2.0
|
||||
SFRE=2.5
|
||||
COMP=1000
|
||||
COMP=10
|
||||
BASE=4001
|
||||
|
||||
rm -rf agency
|
||||
#rm -rf agency
|
||||
mkdir -p agency
|
||||
echo -n "Starting agency ... "
|
||||
if [ $NRAGENTS -gt 1 ]; then
|
||||
|
|
Loading…
Reference in New Issue