Mas i370 deletepending (#378)

* All confirmed deletions to complete when manifest is not lockable

Previously if there was ongoing work (i.e. the clerk had control over the manifest), the penciller could not confirm deletions.  Now it may confirm, and defer the required manifest update to a later date (prompted by another delete confirmation request).

* Refactor to update manifest even without on return of manifest

Rather than waiting on next delete confirmation request

* Update src/leveled_pmanifest.erl

Co-authored-by: Thomas Arts <thomas.arts@quviq.com>

* Missing commit

Co-authored-by: Thomas Arts <thomas.arts@quviq.com>
This commit is contained in:
Martin Sumner 2022-05-24 09:53:27 +01:00
parent 234e0066e8
commit 28d3701f6e

View file

@ -1002,7 +1002,7 @@ handle_cast({manifest_change, Manifest}, State) ->
UpdManifest1 =
leveled_pmanifest:clear_pending(
UpdManifest0,
State#state.pending_removals,
lists:usort(State#state.pending_removals),
State#state.maybe_release),
{noreply,
State#state{
@ -1038,11 +1038,10 @@ handle_cast({confirm_delete, PDFN, FilePid}, State=#state{is_snapshot=Snap})
ok = leveled_sst:sst_deleteconfirmed(FilePid),
case State#state.work_ongoing of
true ->
UpdRemovals =
lists:usort([PDFN|State#state.pending_removals]),
{noreply,
State#state{
pending_removals = UpdRemovals}};
pending_removals =
[PDFN|State#state.pending_removals]}};
false ->
UpdManifest =
leveled_pmanifest:clear_pending(