KVStore::force_checkpoint is not guaranteed to flush all the keys that have been taken.
BATT_REQUIRE_OK(this->deltas_size_->await_true([this](usize n) {
return n < 2;
}));``
The above statement highlights that force_checkpoint waits until there is one key left, so it may be the case we won't create a checkpoint if there is more than one key not flushed. We want to change this dependency from checking if keys are flushed to something correlated to the checkpoint's upper bound, verifying that the checkpoint has finished.
If this value is made to be less the one key, we fail in other cases, specifically if we attempt to take a checkpoint when there are no keys in the database.
KVStore::force_checkpoint is not guaranteed to flush all the keys that have been taken.
The above statement highlights that force_checkpoint waits until there is one key left, so it may be the case we won't create a checkpoint if there is more than one key not flushed. We want to change this dependency from checking if keys are flushed to something correlated to the checkpoint's upper bound, verifying that the checkpoint has finished.
If this value is made to be less the one key, we fail in other cases, specifically if we attempt to take a checkpoint when there are no keys in the database.