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

Persistent get delta #173

Merged
merged 8 commits into from
Oct 4, 2020
Merged

Persistent get delta #173

merged 8 commits into from
Oct 4, 2020

Conversation

songweijia
Copy link
Contributor

New Feature:

  • Persistent::getDelta(version_t ver) allows efficient handling of a delta log entry instead of reconstructing the whole state at version 'ver'. This feature is useful for efficiently tracking versions of a Key in Cascade.

Improvements and bugfixes:

  • Rewritten Persistent documentation
  • Bugfixes for zero-copy version of Persistent::get(), which didn't work.
  • Minor fixes for RVO warnings with GCC-9

If the T in Persistent<T> implements IDeltaSupport interface, Persistent<T>::get() will reconstruct the states by applying the delta from the first log entry to a given version. This is a heavy operation. However, many applications may just want the delta value instead of the reconstructed state. Persistent<T>::getDelta... calls allows the application to retreive this delta value only.
The default behavior of Persistent<T>::get(ver) will return the state of T at version 'ver'. If there is no log exists for 'ver', its latest state before version 'ver' will be returned, which represents the state of the object at a virtual virtual 'ver'. However, although Persistent<T>::getDelta(ver) share a lot of logic with Persistent<T>::get(ver), it has a different semantic: it needs to return the delta at exact 'ver', which does not exists in the given example. This patch introduced a boolean 'exact' flag in the parameter list of PersistLog::getEntry() and PersistLog::getVersionIndex(), so that the Persistent<T>::getDelta(ver) will throw an exception on an invalid version by enforcing the flag.
@songweijia
Copy link
Contributor Author

I want to merge the pull request I made about 10 days ago. This feature is required for efficient Cascade LINQ API. I verified with regression test that this update will not change the performance of core derecho performance. Please let me know if you guys agree this merge. @sagarjha @mpmilano @etremel

@etremel
Copy link
Contributor

etremel commented Oct 2, 2020

Yes, this looks good to me.

@songweijia
Copy link
Contributor Author

Thanks, Edward! I guess should merge it this weekend if there is no more feedback.

@songweijia songweijia merged commit f18b0e5 into master Oct 4, 2020
@songweijia songweijia deleted the persistent_get_delta branch July 7, 2021 14:39
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