Skip to content

Commit 17bcc85

Browse files
authored
Fix stats bug in StorageManager (#4708)
I just stumbled across the fact that Serializer::size() returns semantically different values depending on whether its in size computing mode vs serialization mode. In size computing mode, it returns the number of bytes "written" which is the required buffer size. In actual serializing stuff mode, it returns how much of the buffer is left to be written, so generally should return 0 after a complete serialization. Just to see if anyone was misusing that I moved size() to the size computing serializer and lo and behold, there was a single case where we had buggy behavior. Fix is to just record the size calculated by the size computing serializer. --- TYPE: BUG DESC: Fix stats bug in StorageManager
1 parent 645f285 commit 17bcc85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tiledb/sm/storage_manager/storage_manager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ Status StorageManagerCanonical::store_metadata(
13761376
Serializer serializer(tile.data(), tile.size());
13771377
metadata->serialize(serializer);
13781378

1379-
stats()->add_counter("write_meta_size", serializer.size());
1379+
stats()->add_counter("write_meta_size", size_computation_serializer.size());
13801380

13811381
// Create a metadata file name
13821382
URI metadata_uri = metadata->get_uri(uri);

0 commit comments

Comments
 (0)