Skip to content

Conversation

@etremel
Copy link
Contributor

@etremel etremel commented Dec 12, 2024

While testing my CascadeChain code I saw that the "DeltaType::bytes_size should not be called" warning was being printed by the servers every time I called a function that used Persistent's getDelta, like get() with a specific version. It turns out this is because getDelta passes the DeltaType object to mutils's deserialize_and_run, which internally calls bytes_size after calling from_bytes on its arguments. So DeltaType does have its bytes_size function called during normal operation, even though it is never serialized using to_bytes.

I implemented bytes_size to compute the same size as currentDeltaSize and currentDeltaToBytes would use (size of a size_t plus size of each object in the objects map), and it works for me. This is a cherry-pick of the change I made on cascade_chain, so it can be merged into the main branch independently of CascadeChain.

It turns out the bytes_size() function is called during normal
operation, even though the DeltaType is not being serialized using
to_bytes, so the servers print warning messages every time a delta is
accessed. This is probably because deltas are passed to mutils's
deserialize_and_run, which internally calls bytes_size after calling
from_bytes. I implemented bytes_size to compute the same size as
currentDeltaSize and currentDeltaToBytes would use (size of a size_t
plus size of each object in the objects map).
@tgarr tgarr merged commit ad9cd03 into master Dec 13, 2024
1 check failed
@etremel etremel deleted the delta_core_fix branch April 22, 2025 14:08
timLouie01 pushed a commit to timLouie01/cascade that referenced this pull request Jun 8, 2025
…_fix

Implement bytes_size for DeltaStoreCore's DeltaType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants