Fix bad merge of D16791 and D16767

Summary: A bad Auto-Merge caused log buffer is flushed twice. Remove the unintended one.

Test Plan: Should already be tested (the code looks the same as when I ran unit tests).

Reviewers: haobo, igor

Reviewed By: haobo

CC: ljin, yhchiang, leveldb

Differential Revision: https://reviews.facebook.net/D16821
This commit is contained in:
sdong
2014-03-11 18:00:46 -07:00
parent 86ba3e24e3
commit 839c8ecfcd
5 changed files with 107 additions and 32 deletions

View File

@@ -67,8 +67,21 @@ static void ReplicationThreadBody(void* arg) {
}
}
fprintf(stderr, "Refreshing iterator\n");
for(;iter->Valid(); iter->Next(), t->no_read++, currentSeqNum++) {
for (; !iter->IsObsolete(); iter->Next()) {
if (!iter->Valid()) {
if (t->stop.Acquire_Load() == nullptr) {
return;
}
// need to wait for new rows.
continue;
}
BatchResult res = iter->GetBatch();
if (!iter->status().ok()) {
fprintf(stderr, "Corruption reported when reading seq no. b/w %ld",
static_cast<uint64_t>(currentSeqNum));
exit(1);
}
if (res.sequence != currentSeqNum) {
fprintf(stderr,
"Missed a seq no. b/w %ld and %ld\n",
@@ -76,6 +89,8 @@ static void ReplicationThreadBody(void* arg) {
(long)res.sequence);
exit(1);
}
t->no_read++;
currentSeqNum++;
}
}
}