Skip to content

Commit

Permalink
Mas i370 deletepending (#378)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Missing commit

Co-authored-by: Thomas Arts <[email protected]>
  • Loading branch information
martinsumner and ThomasArts authored May 24, 2022
1 parent 2648c9a commit dcb6a24
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/leveled_penciller.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit dcb6a24

Please sign in to comment.