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
Add smoosh queue persistence #3766
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iilyak
reviewed
Oct 12, 2021
iilyak
reviewed
Oct 12, 2021
iilyak
reviewed
Oct 12, 2021
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
4 times, most recently
from
October 18, 2021 21:21
91a1ae6
to
3aa3b7f
Compare
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
iilyak
reviewed
Oct 19, 2021
jaydoane
reviewed
Oct 19, 2021
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
3 times, most recently
from
October 29, 2021 18:55
e94e35e
to
ec15331
Compare
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
4 times, most recently
from
October 30, 2021 00:00
0f2be02
to
33e997d
Compare
iilyak
reviewed
Nov 1, 2021
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
from
November 5, 2021 21:42
4de8200
to
36619fe
Compare
iilyak
reviewed
Feb 15, 2022
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
2 times, most recently
from
February 15, 2022 23:19
51ca470
to
f850a5b
Compare
Logs of
The priority queue was successfully restored on smoosh restart and the compaction job was started. |
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
from
February 17, 2022 19:53
978430c
to
d62b02e
Compare
iilyak
reviewed
Feb 28, 2022
iilyak
reviewed
Feb 28, 2022
iilyak
reviewed
Feb 28, 2022
iilyak
reviewed
Feb 28, 2022
iilyak
reviewed
Feb 28, 2022
iilyak
reviewed
Feb 28, 2022
iilyak
reviewed
Mar 7, 2022
iilyak
reviewed
Mar 7, 2022
iilyak
reviewed
Mar 7, 2022
iilyak
reviewed
Mar 8, 2022
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
from
March 14, 2022 17:30
0d08fdb
to
8e28c7d
Compare
iilyak
approved these changes
Mar 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Great work!!!
❯ make eunit apps=smoosh
==> smoosh (compile)
==> rel (compile)
==> couchdb (compile)
==> couchdb (setup_eunit)
Writing tmp/etc/default_eunit.ini
Writing tmp/etc/local_eunit.ini
Writing tmp/etc/eunit.ini
Writing tmp/etc/vm.args
==> smoosh (eunit)
Compiled src/smoosh_utils.erl
Compiled src/smoosh.erl
Compiled src/smoosh_priority_queue.erl
Compiled src/smoosh_sup.erl
Compiled src/smoosh_app.erl
/Users/iilyak@ca.ibm.com/dev/couchdb/src/smoosh/test/smoosh_priority_queue_tests.erl:0: Warning: function prop_inverse_test_/0 already exported
Compiled test/smoosh_priority_queue_tests.erl
Compiled src/smoosh_channel.erl
Compiled test/smoosh_tests.erl
/Users/iilyak@ca.ibm.com/dev/couchdb/src/smoosh/src/smoosh_server.erl:261: Warning: erlang:get_stacktrace/0 is deprecated and will be removed in OTP 24; use use the new try/catch syntax for retrieving the stack backtrace
Compiled src/smoosh_server.erl
======================== EUnit ========================
module 'smoosh_priority_queue'
module 'smoosh_priority_queue_tests'
smoosh priority queue test
smoosh_priority_queue_tests: fun.prop_inverse_test_...ok
smoosh_priority_queue_tests: fun.no_halt_on_corrupted_file_test...ok
smoosh_priority_queue_tests: fun.no_halt_on_missing_file_test...ok
[done in 0.009 s]
smoosh_priority_queue_tests:38: prop_inverse_test_...ok
smoosh_priority_queue_tests: no_halt_on_corrupted_file_test...ok
smoosh_priority_queue_tests: no_halt_on_missing_file_test...ok
[done in 1.920 s]
[done in 1.920 s]
module 'smoosh_utils'
module 'smoosh_server'
Test config updates
smoosh_server:515: t_restart_config_listener...[0.110 s] ok
[done in 0.114 s]
smoosh_server:530: t_ratio_view...ok
smoosh_server:540: t_slack_view...ok
smoosh_server:550: t_no_data_view...ok
smoosh_server:560: t_below_min_priority_view...ok
smoosh_server:570: t_below_min_size_view...ok
smoosh_server:580: t_timeout_view...ok
smoosh_server:590: t_missing_view...ok
smoosh_server:598: t_invalid_view...ok
[done in 1.630 s]
module 'smoosh_app'
module 'smoosh_sup'
module 'smoosh'
module 'smoosh_tests'
Testing smoosh
Should persist queue state
smoosh_tests:94: should_persist_queue...[0.045 s] ok
[done in 0.048 s]
Various channels tests
smoosh_tests:82: should_enqueue...[0.091 s] ok
[done in 0.094 s]
[done in 0.416 s]
[done in 0.682 s]
[done in 0.682 s]
module 'smoosh_channel'
=======================================================
All 17 tests passed.
==> rel (eunit)
==> couchdb (eunit)
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
2 times, most recently
from
March 14, 2022 20:41
85b155a
to
f587f35
Compare
noahshaw11
force-pushed
the
add-smoosh-queue-persistence
branch
from
March 14, 2022 21:17
f587f35
to
5ed8d54
Compare
4 tasks
This was referenced Jul 7, 2022
Closed
Closed
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
When smoosh is started, it starts with an empty queue and no knowledge of previously ongoing and potentially resumable compaction jobs. Frequently, this causes difficulties when a node spontaneously reboots or is intentionally rebooted and the node is experiencing a high disk usage situation.
This PR periodically saves the state for smoosh to a file (every 3 minutes by default) and reloads it on (re)start.
Testing recommendations
On an abrupt shutdown or crash, smoosh should resume compaction from where it left off.
Related Issues or Pull Requests
Checklist
rel/overlay/etc/default.ini