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

Close in stages - waiting for releases #411

Merged
merged 4 commits into from
Oct 3, 2023
Merged

Conversation

martinsumner
Copy link
Owner

@martinsumner martinsumner commented Sep 27, 2023

Related issue

Have a consistent approach to closing the inker and the penciller - so that the close can be interrupted by releasing of snapshots. Then any unreleased snapshots are closed before shutdown - with a 10s pause to give queries a short opportunity to finish.

This should address some issues, primarily seen (but very rarely) in test whereby post-rebuild destruction of parallel AAE keystores cause the crashing of aae_folds.

The primary benefit is to stop an attempt to release a snapshot that has in fact already finished, from causing a crash of the database on normal stop - which in Riak may prevent other closing actions from completing normally. This was primarily an issue when shutdown is delayed by an ongoing journal compaction job.

Have a consistent approach to closing the inker and the penciller - so that the close can be interrupted by releasing of snapshots.  Then any unreleased snapshots are closed before shutdown - with a 10s pause to give queries a short opportunity to finish.

This should address some issues, primarily seen (but very rarely) in test whereby post-rebuild destruction of parallel AAE keystores cause the crashing of aae_folds.

The primary benefit is to stop an attempt to release a snapshot that has in fact already finished does not cause a crash of the database on normal stop.  this was primarily an issue when shutdown is delayed by an ongoing journal compaction job.
Copy link
Contributor

@ThomasArts ThomasArts left a comment

Choose a reason for hiding this comment

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

Some "up to choice" comments, but have a serious look at pmanifest line 544

src/leveled_inker.erl Outdated Show resolved Hide resolved
%% @doc
%% Shutdown any snapshots before closing the store
shutdown_snapshots(Snapshots) ->
lists:foreach(fun({Snap, _TS, _SQN}) -> ok = ink_close(Snap) end,
Copy link
Contributor

Choose a reason for hiding this comment

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

This original code failed when a snapshot already was closed or did respond with something else than ok.
However, in a cleanup, what does it give you when you crash the gen_server loop because you cannot cleanup?

src/leveled_penciller.erl Outdated Show resolved Hide resolved
src/leveled_pmanifest.erl Outdated Show resolved Hide resolved
src/leveled_pmanifest.erl Show resolved Hide resolved
Avoid filtering out exited PIDs when closing snapshots by catching the exit exception when the Pid is down
@martinsumner martinsumner merged commit 1a66349 into develop-3.0 Oct 3, 2023
@martinsumner martinsumner deleted the mas-d30-i410 branch October 3, 2023 17:30
martinsumner added a commit that referenced this pull request Oct 4, 2023
* Close in stages - waiting for releases

Have a consistent approach to closing the inker and the penciller - so that the close can be interrupted by releasing of snapshots.  Then any unreleased snapshots are closed before shutdown - with a 10s pause to give queries a short opportunity to finish.

This should address some issues, primarily seen (but very rarely) in test whereby post-rebuild destruction of parallel AAE keystores cause the crashing of aae_folds.

The primary benefit is to stop an attempt to release a snapshot that has in fact already finished does not cause a crash of the database on normal stop.  this was primarily an issue when shutdown is delayed by an ongoing journal compaction job.

* Boost default test budget for EQC

* Update test to use correct type

* Update following review

Avoid filtering out exited PIDs when closing snapshots by catching the exit exception when the Pid is down
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.

2 participants