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

Document monitor archival idempotency requirement (#3276 followup) #3329

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

arik-so
Copy link
Contributor

@arik-so arik-so commented Sep 19, 2024

Followup to #3276, addressing #3122.

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.89%. Comparing base (66fb520) to head (268675a).
Report is 83 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3329      +/-   ##
==========================================
+ Coverage   89.66%   90.89%   +1.23%     
==========================================
  Files         126      127       +1     
  Lines      102676   115304   +12628     
  Branches   102676   115304   +12628     
==========================================
+ Hits        92062   104805   +12743     
+ Misses       7894     7861      -33     
+ Partials     2720     2638      -82     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -162,6 +162,13 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
///
/// Archiving the data in a backup location (rather than deleting it fully) is useful for
/// hedging against data loss in case of unexpected failure.
///
/// Note that if a crash occurs during the archiving process, a state may emerge where the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Persist trait doesn't mandate any specific I/O pattern/features, so talking about it being "copied" to a "path" or seeing the monitor in both places isn't really appropriate here. We should instead phrase this in terms of the requirements (it being idempotent and be explicit that this can be async/fail and LDK will just call it again on restart).

@@ -162,6 +162,12 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
///
/// Archiving the data in a backup location (rather than deleting it fully) is useful for
/// hedging against data loss in case of unexpected failure.
///
/// Note that if a crash occurs during the archiving process, a state may emerge with the
/// archival operation only being partially complete. In that scenario, the monitor may still be
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean this is still only true if the Persist implementation allows for it. The Persist implementation may make this atomic, or it may not. We should phrase this around how it doesn't strictly need to be atomic, but then of course if its not the implementation has to handle it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be either atomic or idempotent since it is retried on startup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I added that in the form of a caveat

@TheBlueMatt
Copy link
Collaborator

Sure, feel free to squash.

@arik-so arik-so force-pushed the monitor_archive_docs_followup branch from 8d0dda5 to 268675a Compare October 11, 2024 16:44
@G8XSU G8XSU merged commit 0db051b into lightningdevkit:main Oct 15, 2024
20 of 21 checks passed
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