X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=blobdiff_plain;f=version2%2Fsrc%2FC%2FTable.cc;h=531337cc5336f1c69dac6aed68018b2899355c98;hp=15dee7683a05545c1c9f0aea98484ba4a0d114d3;hb=b7ed1849727b50e226f3b9d1c432d3071d739368;hpb=d0f7ade2b1b60015ff3cb6ada2071dfafaa656f5 diff --git a/version2/src/C/Table.cc b/version2/src/C/Table.cc index 15dee76..531337c 100644 --- a/version2/src/C/Table.cc +++ b/version2/src/C/Table.cc @@ -1988,6 +1988,7 @@ bool Table::compactArbitrationData() { bool gotNewCommit = false; uint numberToDelete = 1; + while (numberToDelete < pendingSendArbitrationRounds->size()) { ArbitrationRound *round = pendingSendArbitrationRounds->get(pendingSendArbitrationRounds->size() - numberToDelete - 1); @@ -2019,10 +2020,12 @@ bool Table::compactArbitrationData() { newSize += round->getAbortsCount(); if (newSize > ArbitrationRound_MAX_PARTS) { - // Cant compact since it would be too large + // Can't compact since it would be too large + if (lastRound->getCommit() != newCommit && + round->getCommit() != newCommit) + delete newCommit; break; } - // Set the new compacted part if (lastRound->getCommit() == newCommit) lastRound->setCommit(NULL); @@ -2121,7 +2124,6 @@ bool Table::updateCommittedTable() { SetIterator *> *liveit = getKeyIterator(liveCommitsTable); while (liveit->hasNext()) { int64_t arbitratorId = liveit->next(); - // Get all the commits for a specific arbitrator Hashtable *commitForClientTable = liveCommitsTable->get(arbitratorId); @@ -2146,7 +2148,6 @@ bool Table::updateCommittedTable() { for (uint i = 0; i < commitSequenceNumbers->size(); i++) { int64_t commitSequenceNumber = commitSequenceNumbers->get(i); Commit *commit = commitForClientTable->get(commitSequenceNumber); - // Special processing if a commit is not complete if (!commit->isComplete()) { if (i == (commitSequenceNumbers->size() - 1)) { @@ -2260,11 +2261,6 @@ bool Table::updateCommittedTable() { SetIterator *kvit = commit->getKeyValueUpdateSet()->iterator(); while (kvit->hasNext()) { KeyValue *kv = kvit->next(); - printf("Commited KeyValue Table update for %p\n", this); - kv->getKey()->print(); - printf("\n"); - kv->getValue()->print(); - printf("\n"); committedKeyValueTable->put(kv->getKey(), kv); liveCommitsByKeyTable->put(kv->getKey(), commit); }