Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions fdbserver/KeyValueStoreMemory.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ class KeyValueStoreMemory : public IKeyValueStore, NonCopyable {
int64_t uncommittedBytes = queue.totalSize() + transactionSize;

//Check that we have enough space in memory and on disk
int64_t availableSize = std::min(getAvailableSize(), diskQueueBytes.free / 4 - uncommittedBytes);
int64_t freeSize = std::min(getAvailableSize(), diskQueueBytes.free / 4 - uncommittedBytes);
int64_t availableSize = std::min(getAvailableSize(), diskQueueBytes.available / 4 - uncommittedBytes);
int64_t totalSize = std::min(memoryLimit, diskQueueBytes.total / 4 - uncommittedBytes);

return StorageBytes(std::max((int64_t)0, availableSize), std::max((int64_t)0, totalSize), diskQueueBytes.used, diskQueueBytes.available);
return StorageBytes(std::max((int64_t)0, freeSize), std::max((int64_t)0, totalSize), diskQueueBytes.used,
std::max((int64_t)0, availableSize));
}

void semiCommit() {
Expand Down