-
Notifications
You must be signed in to change notification settings - Fork 412
feat: Make MonitorUpdatingPersister change persist type based on size #3834
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
base: main
Are you sure you want to change the base?
feat: Make MonitorUpdatingPersister change persist type based on size #3834
Conversation
👋 Thanks for assigning @tnull as a reviewer! |
/// For small channel monitors (below `minimum_monitor_size_for_updates` bytes when serialized), | ||
/// this persister will always write the full monitor instead of individual updates. This avoids | ||
/// the overhead of managing update files and later compaction for tiny monitors that don't benefit | ||
/// from differential updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still not clear to me how much the gain is of this in practice. Also worried that disabling the incremental path initially allow certain bugs to linger for longer, just because the path isn't hit as much, or rarely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, but can we add some test coverage for the new behavior?
Additionally, benchmarks would indeed very helpful to evaluate what a reasonable threshold value would be.
@@ -458,6 +465,7 @@ where | |||
kv_store: K, | |||
logger: L, | |||
maximum_pending_updates: u64, | |||
minimum_monitor_size_for_updates: usize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please specify the unit of size
in the variable name if possible.
/// in full rather than using update-based persistence. | ||
/// | ||
/// For other parameters, see [`MonitorUpdatingPersister::new`]. | ||
pub fn new_with_default_threshold( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, should we rather leave new
the one applying the default threshold and rather add a new_with_monitor_size_threshold
or similar constructor?
fixes #3770
minimum_monitor_size_for_updates
to specify the minimum size for full persistence to be activatednew_with_default_threshold
function to setupMonitorUpdatingPersister
with a defaultminimum_monitor_size_for_updates
value