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

osd: add osd_fast_shutdown option (default true) #31677

Merged
merged 3 commits into from Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions qa/suites/fs/verify/validater/valgrind.yaml
Expand Up @@ -17,6 +17,8 @@ overrides:
mds heartbeat grace: 60
mon:
mon osd crush smoke test: false
osd:
osd fast shutdown: false
valgrind:
mon: [--tool=memcheck, --leak-check=full, --show-reachable=yes]
osd: [--tool=memcheck]
Expand Down
2 changes: 2 additions & 0 deletions qa/suites/rados/singleton-flat/valgrind-leaks.yaml
Expand Up @@ -23,6 +23,8 @@ overrides:
osd max object namespace len: 64
mon:
mon osd crush smoke test: false
osd:
osd fast shutdown: false
valgrind:
mon: [--tool=memcheck, --leak-check=full, --show-reachable=yes]
osd: [--tool=memcheck]
Expand Down
2 changes: 2 additions & 0 deletions qa/suites/rados/verify/validater/valgrind.yaml
Expand Up @@ -13,6 +13,8 @@ overrides:
debug refs: 5
mon:
mon osd crush smoke test: false
osd:
osd fast shutdown: false
log-whitelist:
- overall HEALTH_
# valgrind is slow.. we might get PGs stuck peering etc
Expand Down
2 changes: 2 additions & 0 deletions qa/suites/rgw/multisite/valgrind.yaml
Expand Up @@ -11,6 +11,8 @@ overrides:
osd heartbeat grace: 40
mon:
mon osd crush smoke test: false
osd:
osd fast shutdown: false
valgrind:
mon: [--tool=memcheck, --leak-check=full, --show-reachable=yes]
osd: [--tool=memcheck]
Expand Down
2 changes: 2 additions & 0 deletions qa/suites/rgw/verify/validater/valgrind.yaml
Expand Up @@ -12,6 +12,8 @@ overrides:
osd heartbeat grace: 40
mon:
mon osd crush smoke test: false
osd:
osd fast shutdown: false
valgrind:
mon: [--tool=memcheck, --leak-check=full, --show-reachable=yes]
osd: [--tool=memcheck]
Expand Down
1 change: 1 addition & 0 deletions src/common/legacy_config_opts.h
Expand Up @@ -764,6 +764,7 @@ OPTION(osd_op_history_slow_op_size, OPT_U32) // Max number of slow ops
OPTION(osd_op_history_slow_op_threshold, OPT_DOUBLE) // track the op if over this threshold
OPTION(osd_target_transaction_size, OPT_INT) // to adjust various transactions that batch smaller items
OPTION(osd_failsafe_full_ratio, OPT_FLOAT) // what % full makes an OSD "full" (failsafe)
OPTION(osd_fast_shutdown, OPT_BOOL)
OPTION(osd_fast_fail_on_connection_refused, OPT_BOOL) // immediately mark OSDs as down once they refuse to accept connections

OPTION(osd_pg_object_context_cache_count, OPT_INT)
Expand Down
5 changes: 5 additions & 0 deletions src/common/options.cc
Expand Up @@ -3498,6 +3498,11 @@ std::vector<Option> get_global_options() {
.set_default(.97)
.set_description(""),

Option("osd_fast_shutdown", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(true)
.set_description("Fast, immediate shutdown")
.set_long_description("Setting this to false makes the OSD do a slower teardown of all state when it receives a SIGINT or SIGTERM or when shutting down for any other reason. That slow shutdown is primarilyy useful for doing memory leak checking with valgrind."),

Option("osd_fast_fail_on_connection_refused", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(true)
.set_description(""),
Expand Down
6 changes: 6 additions & 0 deletions src/osd/OSD.cc
Expand Up @@ -4016,6 +4016,12 @@ void OSD::create_recoverystate_perf()

int OSD::shutdown()
{
if (cct->_conf->osd_fast_shutdown) {
derr << "*** Immediate shutdown (osd_fast_shutdown=true) ***" << dendl;
cct->_log->flush();
_exit(0);
}

if (!service.prepare_to_stop())
return 0; // already shutting down
osd_lock.lock();
Expand Down
1 change: 1 addition & 0 deletions src/vstart.sh
Expand Up @@ -710,6 +710,7 @@ $DAEMONOPTS
osd class dir = $OBJCLASS_PATH
osd class load list = *
osd class default list = *
osd fast shutdown = false

filestore wbthrottle xfs ios start flusher = 10
filestore wbthrottle xfs ios hard limit = 20
Expand Down