bool gotNewCommit = false;
uint numberToDelete = 1;
+
while (numberToDelete < pendingSendArbitrationRounds->size()) {
ArbitrationRound *round = pendingSendArbitrationRounds->get(pendingSendArbitrationRounds->size() - numberToDelete - 1);
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);
SetIterator<int64_t, Hashtable<int64_t, Commit *> *> *liveit = getKeyIterator(liveCommitsTable);
while (liveit->hasNext()) {
int64_t arbitratorId = liveit->next();
-
// Get all the commits for a specific arbitrator
Hashtable<int64_t, Commit *> *commitForClientTable = liveCommitsTable->get(arbitratorId);
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)) {
SetIterator<KeyValue *, KeyValue *, uintptr_t, 0> *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);
}