From 4caf2df0c380a1281db9509b3feb342705512b58 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 25 May 2017 22:32:01 -0700 Subject: [PATCH] osd: do not default-abort on leaked pg refs Signed-off-by: Greg Farnum --- qa/clusters/extra-client.yaml | 5 +++++ qa/clusters/fixed-1.yaml | 4 ++++ qa/clusters/fixed-2.yaml | 5 +++++ qa/clusters/fixed-3-cephfs.yaml | 5 +++++ qa/clusters/fixed-3.yaml | 5 +++++ qa/clusters/fixed-4.yaml | 5 +++++ src/common/config_opts.h | 1 + src/osd/OSD.cc | 4 +++- 8 files changed, 33 insertions(+), 1 deletion(-) diff --git a/qa/clusters/extra-client.yaml b/qa/clusters/extra-client.yaml index 2b495374f3d3d..33fa505b71408 100644 --- a/qa/clusters/extra-client.yaml +++ b/qa/clusters/extra-client.yaml @@ -7,3 +7,8 @@ openstack: - volumes: # attached to each instance count: 3 size: 10 # GB +overrides: + ceph: + conf: + osd: + osd shutdown pgref assert: true \ No newline at end of file diff --git a/qa/clusters/fixed-1.yaml b/qa/clusters/fixed-1.yaml index 38725b0864284..d8e5898b99f4a 100644 --- a/qa/clusters/fixed-1.yaml +++ b/qa/clusters/fixed-1.yaml @@ -6,5 +6,9 @@ overrides: osd crush chooseleaf type: 0 osd pool default pg num: 128 osd pool default pgp num: 128 + ceph: + conf: + osd: + osd shutdown pgref assert: true roles: - [mon.a, mgr.x, osd.0, osd.1, osd.2, client.0] diff --git a/qa/clusters/fixed-2.yaml b/qa/clusters/fixed-2.yaml index 6886d1701b8a9..3b08e287d5165 100644 --- a/qa/clusters/fixed-2.yaml +++ b/qa/clusters/fixed-2.yaml @@ -5,3 +5,8 @@ openstack: - volumes: # attached to each instance count: 3 size: 10 # GB +overrides: + ceph: + conf: + osd: + osd shutdown pgref assert: true \ No newline at end of file diff --git a/qa/clusters/fixed-3-cephfs.yaml b/qa/clusters/fixed-3-cephfs.yaml index 7e2e5f05c7651..2d2112f9f6496 100644 --- a/qa/clusters/fixed-3-cephfs.yaml +++ b/qa/clusters/fixed-3-cephfs.yaml @@ -9,3 +9,8 @@ openstack: log-rotate: ceph-mds: 10G ceph-osd: 10G +overrides: + ceph: + conf: + osd: + osd shutdown pgref assert: true \ No newline at end of file diff --git a/qa/clusters/fixed-3.yaml b/qa/clusters/fixed-3.yaml index 3ed30b94ff082..cd4f4e8ec2ec9 100644 --- a/qa/clusters/fixed-3.yaml +++ b/qa/clusters/fixed-3.yaml @@ -6,3 +6,8 @@ openstack: - volumes: # attached to each instance count: 3 size: 10 # GB +overrides: + ceph: + conf: + osd: + osd shutdown pgref assert: true \ No newline at end of file diff --git a/qa/clusters/fixed-4.yaml b/qa/clusters/fixed-4.yaml index 86eb2c63439ea..df767f35710ec 100644 --- a/qa/clusters/fixed-4.yaml +++ b/qa/clusters/fixed-4.yaml @@ -3,3 +3,8 @@ roles: - [mon.b, osd.1, osd.5, osd.9, osd.13] - [mon.c, osd.2, osd.6, osd.10, osd.14] - [mgr.x, osd.3, osd.7, osd.11, osd.15, client.0] +overrides: + ceph: + conf: + osd: + osd shutdown pgref assert: true \ No newline at end of file diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 13e1a558441ce..fc430e61d8d8c 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -974,6 +974,7 @@ OPTION(osd_recovery_op_warn_multiple, OPT_U32, 16) // Max time to wait between notifying mon of shutdown and shutting down OPTION(osd_mon_shutdown_timeout, OPT_DOUBLE, 5) +OPTION(osd_shutdown_pgref_assert, OPT_BOOL, false) // crash if the OSD has stray PG refs on shutdown OPTION(osd_max_object_size, OPT_U64, 100*1024L*1024L*1024L) // OSD's maximum object size OPTION(osd_max_object_name_len, OPT_U32, 2048) // max rados object name len diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 40a7c685875db..190e98991472d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3233,7 +3233,9 @@ int OSD::shutdown() #ifdef PG_DEBUG_REFS p->second->dump_live_ids(); #endif - ceph_abort(); + if (cct->_conf->osd_shutdown_pgref_assert) { + ceph_abort(); + } } p->second->unlock(); p->second->put("PGMap"); -- 2.39.5