Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

More Pending Validation #1059

Merged
merged 16 commits into from
Feb 28, 2019
Merged

More Pending Validation #1059

merged 16 commits into from
Feb 28, 2019

Conversation

lucksus
Copy link
Collaborator

@lucksus lucksus commented Feb 27, 2019

  • I have added a summary of my changes to the changelog

Immediate follow-ups of the pending link validation merge

Builds on the work of #1054
screenshot from 2019-02-27 18-59-31

Pending because of validation package

I couldn't easily write a test for pending link validations because having a node fake a link entry without actually validating it will also break the generation of validation packages.

That pointed me to the fact that validation can also fail early because we couldn't get the validation package from the source, usually because the source is offline.

I think we should store validation packages in the DHT to circumvent this long-term. For now, retrying validation of any entry in this case is the bare minimum we need to not break the DHT's consistency (nodes online during authoring can validate, future ones won't if source is offline).

Removing pending entries from pending list

We have to make sure that entries are removed from the pending list not only when validation succeeds, but also when it finally fails. Therefore added HolochainError::ValidationPending to tell pending cases apart from other failures. The scheduled background task now removes a processed item from the list unless it returns HolochainError::ValidationPending.

Memory management

Entries to be validated are now Arced. The map of these Arcs gets copied out of the state so we can drop the state lock immediately to not block the instance while running pending validations.

@lucksus lucksus added the review label Feb 27, 2019
EntryType::LinkRemove => retry_validation(boxed.clone(), context.clone()),
_ => panic!("Pending validations are (currently) only implemented for links"),
});
.clone();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We get this clone of a HashMap<Arc<...>> so we can drop the state lock immediately.

@lucksus lucksus marked this pull request as ready for review February 27, 2019 19:39
@lucksus lucksus requested review from maackle, thedavidmeister and zippy and removed request for maackle February 27, 2019 19:41
Copy link
Member

@zippy zippy left a comment

Choose a reason for hiding this comment

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

one minor change in test. and questions, but general approval

core/src/workflows/hold_entry.rs Outdated Show resolved Hide resolved
core/src/workflows/hold_link.rs Outdated Show resolved Hide resolved
@lucksus
Copy link
Collaborator Author

lucksus commented Feb 27, 2019

All addressed, @zippy.

@lucksus lucksus merged commit e39129a into develop Feb 28, 2019
@lucksus lucksus removed the review label Feb 28, 2019
@zippy zippy deleted the pending-link-validation branch July 4, 2019 20:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants