Skip to content

Commit 5e6655f

Browse files
Added temp space to StorageBytes.
1 parent 5074ac6 commit 5e6655f

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

fdbclient/FDBTypes.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -866,27 +866,34 @@ struct TLogSpillType {
866866

867867
// Contains the amount of free and total space for a storage server, in bytes
868868
struct StorageBytes {
869+
// Free space on the filesystem
869870
int64_t free;
871+
// Total space on the filesystem
870872
int64_t total;
871-
int64_t used; // Used by *this* store, not total-free
872-
int64_t available; // Amount of disk space that can be used by data structure, including free disk space and
873-
// internally reusable space
873+
// Used by *this* store, not total - free
874+
int64_t used;
875+
// Amount of space available for use by the store, which includes free space on the filesystem
876+
// and internal free space within the store data that is immediately reusable.
877+
int64_t available;
878+
// Amount of space that could eventually be available for use after garbage collection
879+
int64_t temp;
874880

875881
StorageBytes() {}
876-
StorageBytes(int64_t free, int64_t total, int64_t used, int64_t available)
877-
: free(free), total(total), used(used), available(available) {}
882+
StorageBytes(int64_t free, int64_t total, int64_t used, int64_t available, int64_t temp = 0)
883+
: free(free), total(total), used(used), available(available), temp(temp) {}
878884

879885
template <class Ar>
880886
void serialize(Ar& ar) {
881887
serializer(ar, free, total, used, available);
882888
}
883889

884890
std::string toString() const {
885-
return format("{%.2f MB total, %.2f MB free, %.2f MB available, %.2f MB used}",
891+
return format("{%.2f MB total, %.2f MB free, %.2f MB available, %.2f MB used, %.2f MB temp}",
886892
total / 1e6,
887893
free / 1e6,
888894
available / 1e6,
889-
used / 1e6);
895+
used / 1e6,
896+
temp / 1e6);
890897
}
891898
};
892899
struct LogMessageVersion {

fdbserver/VersionedBTree.actor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2111,8 +2111,9 @@ class DWALPager : public IPager2 {
21112111
// known, if each commit delayed entries that were freeable were shuffled from the delayed free queue to the
21122112
// free queue, but this doesn't seem necessary.
21132113
int64_t reusable = (freeList.numEntries + delayedFreeList.numEntries) * physicalPageSize;
2114+
int64_t temp = remapQueue.numEntries * physicalPageSize;
21142115

2115-
return StorageBytes(free, total, pagerSize - reusable, free + reusable);
2116+
return StorageBytes(free, total, pagerSize - reusable, free + reusable, temp);
21162117
}
21172118

21182119
ACTOR static Future<Void> getUserPageCount_cleanup(DWALPager* self) {

0 commit comments

Comments
 (0)