Merge pull request #11683 from rook/mergify/bp/release-1.10/pr-11673
object: RGW metadata pg count reduction on 16.2.11 (backport #11673)
This commit is contained in:
2 files changed
+26
-3
No files matched your search
@@ -68,8 +68,9 @@ var (
|
||||
dataPoolName = "rgw.buckets.data"
|
||||
|
||||
// An user with system privileges for dashboard service
|
||||
DashboardUser = "dashboard-admin"
|
||||
cephVersionRGWRadosPoolPgNumRemoved = cephver.CephVersion{Major: 17, Minor: 2, Extra: 2}
|
||||
DashboardUser = "dashboard-admin"
|
||||
rgwPgNumRemovedQuincyVersion = cephver.CephVersion{Major: 17, Minor: 2, Extra: 2}
|
||||
rgwPgNumRemovedPacificVersion = cephver.CephVersion{Major: 16, Minor: 2, Extra: 11}
|
||||
)
|
||||
|
||||
type idType struct {
|
||||
@@ -741,7 +742,7 @@ func CreatePools(context *Context, clusterSpec *cephv1.ClusterSpec, metadataPool
|
||||
// get the default PG count for rgw metadata pools
|
||||
var err error
|
||||
var metadataPoolPGs string
|
||||
if context.clusterInfo.CephVersion.IsAtLeast(cephVersionRGWRadosPoolPgNumRemoved) {
|
||||
if rgwRadosPGNumIsNew(context.clusterInfo.CephVersion) {
|
||||
metadataPoolPGs = rgwRadosPoolPgNum
|
||||
} else {
|
||||
metadataPoolPGs, err = config.GetMonStore(context.Context, context.clusterInfo).Get("mon.", "rgw_rados_pool_pg_num_min")
|
||||
@@ -762,6 +763,19 @@ func CreatePools(context *Context, clusterSpec *cephv1.ClusterSpec, metadataPool
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check if this is a recent release of ceph where the legacy rgw_rados_pool_pg_num_min
|
||||
// is no longer available.
|
||||
func rgwRadosPGNumIsNew(cephVer cephver.CephVersion) bool {
|
||||
if cephVer.IsPacific() && cephVer.IsAtLeast(rgwPgNumRemovedPacificVersion) {
|
||||
return true
|
||||
}
|
||||
if cephVer.IsAtLeast(rgwPgNumRemovedQuincyVersion) {
|
||||
return true
|
||||
}
|
||||
// the legacy setting should still be checked
|
||||
return false
|
||||
}
|
||||
|
||||
// configurePoolsConcurrently checks if operator pod resources are set or not
|
||||
func configurePoolsConcurrently() bool {
|
||||
// if operator resources are specified return false as it will lead to operator pod killed due to resource limit
|
||||
|
||||
@@ -237,6 +237,15 @@ func TestGetObjectBucketProvisioner(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestRGWPGNumVersion(t *testing.T) {
|
||||
assert.False(t, rgwRadosPGNumIsNew(cephver.CephVersion{Major: 15, Minor: 2, Extra: 9}))
|
||||
assert.False(t, rgwRadosPGNumIsNew(cephver.CephVersion{Major: 16, Minor: 2, Extra: 10}))
|
||||
assert.True(t, rgwRadosPGNumIsNew(cephver.CephVersion{Major: 16, Minor: 2, Extra: 11}))
|
||||
assert.False(t, rgwRadosPGNumIsNew(cephver.CephVersion{Major: 17, Minor: 2, Extra: 1}))
|
||||
assert.True(t, rgwRadosPGNumIsNew(cephver.CephVersion{Major: 17, Minor: 2, Extra: 2}))
|
||||
assert.True(t, rgwRadosPGNumIsNew(cephver.CephVersion{Major: 18, Minor: 0, Extra: 0}))
|
||||
}
|
||||
|
||||
func TestCheckDashboardUser(t *testing.T) {
|
||||
storeName := "myobject"
|
||||
executor := &exectest.MockExecutor{
|
||||
|
||||
Reference in new issue
Block a user