Skip to content

Commit bfd9d96

Browse files
committed
[fix] collect blob files size in rocksUsedDbSize
1 parent dbb6431 commit bfd9d96

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/ctrip_swap_rocks.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,14 @@ static uint64_t rocksUsedDbSize(rocks *rocks) {
962962
continue;
963963
}
964964
total_used_db_size += used_db_size;
965+
966+
/* Also include blob file size for this CF, which is not
967+
* accounted for by rocksdb_approximate_sizes_cf. */
968+
uint64_t blob_size = 0;
969+
if (!rocksdb_property_int_cf(rocks->db, handle,
970+
"rocksdb.total-blob-file-size", &blob_size)) {
971+
total_used_db_size += blob_size;
972+
}
965973
}
966974

967975
return total_used_db_size;

0 commit comments

Comments
 (0)