Details
-
Bug
-
Resolution: Fixed
-
Critical
-
7.1.0
-
Triaged
-
1
-
Unknown
-
KV 2021-Oct-21
Description
cb::engine_errc KVBucket::setCheckpointMaxSize(size_t size) {
|
if (size > 0) {
|
checkpointMaxSize = size;
|
return cb::engine_errc::success;
|
}
|
|
// Note: This is NOT perfect in the general case.
|
// VBMap::getSize() returns the capacity of the VBMap, not the actual number
|
// of vbuckets in the map. For perfect sizing we would need to recompute
|
// at any vbmap size change (ie, bucket creation / deletion). @todo MB-48038
|
const auto numVBuckets = vbMap.getSize();
|
const auto& config = engine.getConfiguration();
|
const auto checkpointQuota = config.getMaxSize() * checkpointMemoryRatio;
|
const auto numCheckpointsPerVB = config.getMaxCheckpoints();
|
|
Expects(numVBuckets > 0);
|
Expects(numCheckpointsPerVB > 0);
|
checkpointMaxSize = (checkpointQuota / numVBuckets) / numCheckpointsPerVB;
|
|
return cb::engine_errc::success;
|
}
|