Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bytes_size for DeltaStoreCore's DeltaType #79

Merged
merged 1 commit into from
Dec 13, 2024
Merged

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
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.

2 participants