fix sync interval failover bug

This commit is contained in:
CJ Cobb
2022-03-04 10:00:45 -05:00
parent 15004d80ee
commit b3948590f8

View File

@@ -695,7 +695,7 @@ public:
doFinishWrites() override doFinishWrites() override
{ {
if (!range || lastSync_ == 0 || if (!range || lastSync_ == 0 ||
ledgerSequence_ - syncInterval_ == lastSync_) ledgerSequence_ - syncInterval_ >= lastSync_)
{ {
// wait for all other writes to finish // wait for all other writes to finish
sync(); sync();
@@ -726,6 +726,14 @@ public:
<< std::to_string(ledgerSequence_); << std::to_string(ledgerSequence_);
lastSync_ = ledgerSequence_; lastSync_ = ledgerSequence_;
} }
else
{
BOOST_LOG_TRIVIAL(info)
<< __func__ << " Skipping commit. sync interval is "
<< std::to_string(syncInterval_) << " - last sync is "
<< std::to_string(lastSync_) << " - ledger sequence is "
<< std::to_string(ledgerSequence_);
}
return true; return true;
} }
void void