Increasing the number of PGs
Greetings,
I've been testing Ceph on a cluster where I have added new OSDs
several times, to the point where I now have 46 OSDs and only a total of 192 PGs per pool, which now seems rather far from what the documentation suggests (about 100 per OSD in each pool).
Some past messages on this list and some documentation suggest that
increasing pg_num on a cluster with data won't give good results and that PG splitting is not functional at this time.
Can anyone clarify if this is still the case as of v0.43 and/or v0.44,
or is it safe to increase pg_num on a pool with live data?
Thanks in advance
Best regards
Cláudio
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
2012/3/26 Cláudio Martins <[email protected]>:
Quoted 6 lines
Some past messages on this list and some documentation suggest that increasing
pg_numon a cluster with data won't give good results and that PG splitting is not functional at this time.Can anyone clarify if this is still the case as of v0.43 and/or v0.44, or is it safe to increase
pg_numon a pool with live data?
Sadly, that is still the current state of affairs.
Resources:
http://tracker.newdream.net/issues/1515
http://ceph.newdream.net/docs/master/ops/manage/grow/placement-groups/
http://ceph.newdream.net/wiki/Changing_the_number_of_PGs
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Tommi Virtanen
Quoted 2 lines
Can anyone clarify if this is still the case as of v0.43 and/or v0.44,
or is it safe to increasepg_numon a pool with live data?Sadly, that is still the current state of affairs.
Does the act of adding OSDs itself result in the PG count being increased?
This seems to be the behaviour I've just observed on my testing cluster (running 0.44) using an incantation like:
Quoted 6 lines
for i in
seq 14 27; do
ceph osd create $i
ceph osd crush add $i osd.$i 1.0 host=$hostname rack=$rack pool=default ceph-osd -i $i --mkfs --mkkey
ceph -i/etc/ceph/keyring.osd.$iauth add osd.$i osd "allow *" mon "allow rwx" done
The number of PGs seems to have roughly doubled, and half of my OSDs now assert in OSD::get_or_create_pg() with "FAILED assert(role == 0)".
This seems to be a similar failure-mode for others who report issues after PG-splitting; as in those cases, ceph -w also reports errors of the form:
[ERR] mkpg 1.1p23 up [5,12] != acting [12]
Have I done something wrong? Is there some alternate sequence of steps that avoids / suppresses PG splitting?
Cheers,
David
Signature · 2 lines
David McBride <[email protected]> Department of Computing, Imperial College, London
Quoted 2 lines · David McBride
Does the act of adding OSDs itself result in the PG count being increased?
Correction to my last: it doesn't, but changing the replica-count (e.g. from 2 -> 3 using ceph osd pool set rbd size 3) does.
That's somewhat easier to avoid, however.
Apologies for the noise.
Cheers,
David
Signature · 2 lines
David McBride <[email protected]> Department of Computing, Imperial College, London
Quoted 7 lines · David McBride
Quoted 2 lines · David McBride
Does the act of adding OSDs itself result in the PG count being increased?
Correction to my last: it doesn't, but changing the replica-count (e.g. from 2 -> 3 using
ceph osd pool set rbd size 3) does.
This shouldn't change the PG count either. If you do
ceph osd dump | grep ^pool
you'll see a pg_num value for each pool that should remain constant. Only the size should change (replica count)...
sage
Quoted 6 lines · Sage Weil
This shouldn't change the PG count either. If you do
ceph osd dump | grep ^pool
you'll see a
pg_numvalue for each pool that should remain constant. Only the size should change (replica count)...
Okay, that's what I was expecting. I earlier rebuilt the cluster and repeated my earlier results; however, I don't have the output of those commands to hand.
I'll quickly run through the process a third-time, verify the before and after counts, and report back.
Cheers,
David
Signature · 2 lines
David McBride <[email protected]> Department of Computing, Imperial College, London
Quoted 4 lines · David McBride
Quoted 2 lines · Sage Weil
This shouldn't change the PG count either. If you do
Quoted 8 lines
Quoted 4 lines
ceph osd dump | grep ^pool
you'll see a
pg_numvalue for each pool that should remain constant. Only the size should change (replica count)...Okay, that's what I was expecting. I earlier rebuilt the cluster and repeated my earlier results; however, I don't have the output of those commands to hand.
Hi,
Results are in. Something odd is going on; the results returned by ceph -s and ceph osd dump are inconsistent:
* ceph osd dump does indeed indicate that the pg_num values are remaining constant for each pool before and after changing the replica count.
* However, the total number of PGs being reported by ceph -s or ceph -w increases immediately after issuing the replica count change command for a pool. The increase in size is equal to the number of live OSDs; in this case, 28.
* This apparent (silent) increase in PG count will occur three times if the change is applied to all three pools, data, metadata, and rbd.
* Changing the replica count up and down again after the initial increase has no effect on the reported replica count.
* My steps for reproducing are:
- Mint a new cluster, with 14 OSDs stored on server A.
- Start the cluster.
- Add some data to the rbd pool using rados bench.
- Initialize 14 additional OSDs on server B.
- Add the server B OSDs to the cluster.
- Increase the replica count.
This process is probably not minimal. I can try to run some experiments to see what factors are significant.
(I'm pretty sure I could skip the rados bench step, for example.)
* In case it makes a difference, I'm using XFS, not BTRFS, for the OSD's backing-store.
Here's the output of ceph status commands during the various stages:
Prior to OSD addition:
======================
output from: ceph -s:
Quoted 5 lines
2012-03-28 12:30:25.086686 pg v133: 2772 pgs: 2772 active+clean; 13252 MB data, 55720 MB used, 1857 GB / 1911 GB avail
2012-03-28 12:30:25.101300 mds e1: 0/0/1 up
2012-03-28 12:30:25.101424 osd e11: 14 osds: 14 up, 14 in
2012-03-28 12:30:25.101689 log 2012-03-28 12:25:22.596734 mon.0 146.169.21.55:6789/0 16 : [INF] osd.8 146.169.1.13:6836/6339 boot
2012-03-28 12:30:25.101897 mon e1: 1 mons at {vm-cephhead=146.169.21.55:6789/0}output from: ceph osd dump | grep pg_num:
Quoted 3 lines
pool 0 'data' rep size 2
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 2crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0
Adding the second set of OSDs:
=============================
output from: ceph osd dump | grep pg_num:
Quoted 3 lines
pool 0 'data' rep size 2
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 2crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0
Changing rbd pool replica count:
=================================
output from: ceph -w:
Quoted 2 lines
2012-03-28 12:36:36.768714 pg v313: 2772 pgs: 2772 active+clean; 13252 MB data, 86002 MB used, 3739 GB / 3823 GB avail 2012-03-28 12:36:37.763292 pg v314: 2772 pgs: 2772 active+clean; 13252 MB data, 85163 MB used, 3740 GB / 3823 GB avail
(issued: ceph osd pool set rbd size 3)
Quoted 6 lines
2012-03-28 12:36:42.308575 pg v315: 2800 pgs: 28 creating, 2772 active+clean; 13252 MB data, 85163 MB used, 3740 GB / 3823 GB avail 2012-03-28 12:36:42.314124 osd e105: 28 osds: 28 up, 28 in 2012-03-28 12:36:43.399792 pg v316: 2800 pgs: 28 creating, 2772 active+clean; 13252 MB data, 85163 MB used, 3740 GB / 3823 GB avail 2012-03-28 12:36:43.402742 osd e106: 28 osds: 28 up, 28 in 2012-03-28 12:36:46.691598 pg v317: 2800 pgs: 28 creating, 2737 active+clean, 35 active+recovering; 13252 MB data, 84818 MB used, 3740 GB / 3823 GB avail; 274/6765 degraded (4.050%) 2012-03-28 12:36:47.596507 pg v318: 2800 pgs: 28 creating, 2709 active+clean, 63 active+recovering; 13252 MB data, 84819 MB used, 3740 GB / 3823 GB avail; 524/6890 degraded (7.605%)
output from: ceph osd dump | grep pg_num:
Quoted 3 lines
pool 0 'data' rep size 2
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 3crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change105 owner 0
Changing data pool replica count:
==================================
output from: ceph -w:
Quoted 1 line
2012-03-28 13:10:54.818447 pg v573: 2800 pgs: 14 creating, 2786 active+clean; 13252 MB data, 98329 MB used, 3727 GB / 3823 GB avail
(issued: ceph osd pool set data size 3)
Quoted 4 lines
2012-03-28 13:11:08.240605 pg v574: 2828 pgs: 42 creating, 2786 active+clean; 13252 MB data, 98329 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:11:08.245026 osd e114: 28 osds: 28 up, 28 in 2012-03-28 13:11:09.050371 pg v575: 2828 pgs: 42 creating, 2786 active+clean; 13252 MB data, 98329 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:11:09.051179 osd e115: 28 osds: 28 up, 28 in
output from: ceph osd dump | grep pg_num:
Quoted 3 lines
pool 0 'data' rep size 3
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change114 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 3crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change112 owner 0
Increase metadata pool
======================
output from ceph -w:
Quoted 1 line
2012-03-28 13:12:04.279557 pg v580: 2828 pgs: 28 creating, 2800 active+clean; 13252 MB data, 98338 MB used, 3727 GB / 3823 GB avail
(issued: ceph osd pool set metadata size 3)
Quoted 4 lines
2012-03-28 13:13:19.748554 pg v581: 2856 pgs: 56 creating, 2800 active+clean; 13252 MB data, 98338 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:13:19.753181 osd e116: 28 osds: 28 up, 28 in 2012-03-28 13:13:20.840151 pg v582: 2856 pgs: 56 creating, 2800 active+clean; 13252 MB data, 98338 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:13:20.842065 osd e117: 28 osds: 28 up, 28 in
output from: ceph osd dump | grep pg_num:
Quoted 3 lines
pool 0 'data' rep size 3
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change114 owner 0crash_replay_interval45 pool 1 'metadata' rep size 3crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change116 owner 0 pool 2 'rbd' rep size 3crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change112 owner 0
This sounds like it's probably defect. Should I mint a new bug ticket in the tracker?
Cheers,
David
Signature · 2 lines
David McBride <[email protected]> Department of Computing, Imperial College, London
Hi David-
Quoted 60 lines · David McBride
Quoted 4 lines · David McBride
Quoted 2 lines · Sage Weil
This shouldn't change the PG count either. If you do
Quoted 8 lines
Quoted 4 lines
ceph osd dump | grep ^pool
you'll see a
pg_numvalue for each pool that should remain constant. Only the size should change (replica count)...Okay, that's what I was expecting. I earlier rebuilt the cluster and repeated my earlier results; however, I don't have the output of those commands to hand.
Hi,
Results are in. Something odd is going on; the results returned by
ceph -sandceph osd dumpare inconsistent:*
ceph osd dumpdoes indeed indicate that thepg_numvalues are remaining constant for each pool before and after changing the replica count.* However, the total number of PGs being reported by
ceph -sorceph -wincreases immediately after issuing the replica count change command for a pool. The increase in size is equal to the number of live OSDs; in this case, 28.* This apparent (silent) increase in PG count will occur three times if the change is applied to all three pools,
data,metadata, andrbd.* Changing the replica count up and down again after the initial increase has no effect on the reported replica count.
* My steps for reproducing are:
- Mint a new cluster, with 14 OSDs stored on server A.
- Start the cluster.
- Add some data to therbdpool usingrados bench.
- Initialize 14 additional OSDs on server B.
- Add the server B OSDs to the cluster.
- Increase the replica count.This process is probably not minimal. I can try to run some experiments to see what factors are significant.
(I'm pretty sure I could skip therados benchstep, for example.)* In case it makes a difference, I'm using XFS, not BTRFS, for the OSD's backing-store.
Here's the output of ceph status commands during the various stages:
Prior to OSD addition:
======================output from:
ceph -s:
Quoted 11 lines
Quoted 5 lines
2012-03-28 12:30:25.086686 pg v133: 2772 pgs: 2772 active+clean; 13252 MB data, 55720 MB used, 1857 GB / 1911 GB avail 2012-03-28 12:30:25.101300 mds e1: 0/0/1 up 2012-03-28 12:30:25.101424 osd e11: 14 osds: 14 up, 14 in 2012-03-28 12:30:25.101689 log 2012-03-28 12:25:22.596734 mon.0 146.169.21.55:6789/0 16 : [INF] osd.8 146.169.1.13:6836/6339 boot 2012-03-28 12:30:25.101897 mon e1: 1 mons at {vm-cephhead=146.169.21.55:6789/0}output from:
ceph osd dump | grep pg_num:Quoted 3 lines
pool 0 'data' rep size 2
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 2crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0
Oh! lpg_num is > 0, which means a small number of "localized" pgs are created for every OSD. This aren't used by anything currently (they were originally added to support hadoop-style placement, but even there we don't use them).
I'm guessing the pg count jumped after you added OSDs, not when you adjusted the replica count. You can confirm by looking at
ceph pg dump
before and after, and you should see that the new pgs all have a 'p##' at the end (where the ## is the osd they are localized to).
We probably want to turn those off by default, since they are unused.
sage
Quoted 91 lines
Adding the second set of OSDs:
=============================output from:
ceph osd dump | grep pg_num:Quoted 3 lines
pool 0 'data' rep size 2
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 2crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0Changing
rbdpool replica count:
=================================output from:
ceph -w:Quoted 2 lines
2012-03-28 12:36:36.768714 pg v313: 2772 pgs: 2772 active+clean; 13252 MB data, 86002 MB used, 3739 GB / 3823 GB avail 2012-03-28 12:36:37.763292 pg v314: 2772 pgs: 2772 active+clean; 13252 MB data, 85163 MB used, 3740 GB / 3823 GB avail(issued:
ceph osd pool set rbd size 3)Quoted 6 lines
2012-03-28 12:36:42.308575 pg v315: 2800 pgs: 28 creating, 2772 active+clean; 13252 MB data, 85163 MB used, 3740 GB / 3823 GB avail 2012-03-28 12:36:42.314124 osd e105: 28 osds: 28 up, 28 in 2012-03-28 12:36:43.399792 pg v316: 2800 pgs: 28 creating, 2772 active+clean; 13252 MB data, 85163 MB used, 3740 GB / 3823 GB avail 2012-03-28 12:36:43.402742 osd e106: 28 osds: 28 up, 28 in 2012-03-28 12:36:46.691598 pg v317: 2800 pgs: 28 creating, 2737 active+clean, 35 active+recovering; 13252 MB data, 84818 MB used, 3740 GB / 3823 GB avail; 274/6765 degraded (4.050%) 2012-03-28 12:36:47.596507 pg v318: 2800 pgs: 28 creating, 2709 active+clean, 63 active+recovering; 13252 MB data, 84819 MB used, 3740 GB / 3823 GB avail; 524/6890 degraded (7.605%)output from:
ceph osd dump | grep pg_num:Quoted 3 lines
pool 0 'data' rep size 2
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 3crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change105 owner 0Changing
datapool replica count:
==================================output from:
ceph -w:Quoted 1 line
2012-03-28 13:10:54.818447 pg v573: 2800 pgs: 14 creating, 2786 active+clean; 13252 MB data, 98329 MB used, 3727 GB / 3823 GB avail(issued:
ceph osd pool set data size 3)Quoted 4 lines
2012-03-28 13:11:08.240605 pg v574: 2828 pgs: 42 creating, 2786 active+clean; 13252 MB data, 98329 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:11:08.245026 osd e114: 28 osds: 28 up, 28 in 2012-03-28 13:11:09.050371 pg v575: 2828 pgs: 42 creating, 2786 active+clean; 13252 MB data, 98329 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:11:09.051179 osd e115: 28 osds: 28 up, 28 inoutput from:
ceph osd dump | grep pg_num:Quoted 3 lines
pool 0 'data' rep size 3
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change114 owner 0crash_replay_interval45 pool 1 'metadata' rep size 2crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change1 owner 0 pool 2 'rbd' rep size 3crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change112 owner 0Increase metadata pool
======================output from
ceph -w:Quoted 1 line
2012-03-28 13:12:04.279557 pg v580: 2828 pgs: 28 creating, 2800 active+clean; 13252 MB data, 98338 MB used, 3727 GB / 3823 GB avail(issued:
ceph osd pool set metadata size 3)Quoted 4 lines
2012-03-28 13:13:19.748554 pg v581: 2856 pgs: 56 creating, 2800 active+clean; 13252 MB data, 98338 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:13:19.753181 osd e116: 28 osds: 28 up, 28 in 2012-03-28 13:13:20.840151 pg v582: 2856 pgs: 56 creating, 2800 active+clean; 13252 MB data, 98338 MB used, 3727 GB / 3823 GB avail 2012-03-28 13:13:20.842065 osd e117: 28 osds: 28 up, 28 inoutput from:
ceph osd dump | grep pg_num:Quoted 3 lines
pool 0 'data' rep size 3
crush_ruleset0object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change114 owner 0crash_replay_interval45 pool 1 'metadata' rep size 3crush_ruleset1object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change116 owner 0 pool 2 'rbd' rep size 3crush_ruleset2object_hashrjenkinspg_num896pgp_num896lpg_num2lpgp_num2last_change112 owner 0This sounds like it's probably defect. Should I mint a new bug ticket in the tracker?
Cheers,
DavidSignature · 7 lines
David McBride <[email protected]> Department of Computing, Imperial College, London -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
2012/3/27 David McBride <[email protected]>:
Quoted 16 lines
Does the act of adding OSDs itself result in the PG count being increased?
This seems to be the behaviour I've just observed on my testing cluster (running 0.44) using an incantation like:
Quoted 6 lines
for i in
seq 14 27; do
ceph osd create $i
ceph osd crush add $i osd.$i 1.0 host=$hostname rack=$rack pool=default ceph-osd -i $i --mkfs --mkkey
ceph -i/etc/ceph/keyring.osd.$iauth add osd.$i osd "allow *" mon "allow rwx" doneThe number of PGs seems to have roughly doubled, and half of my OSDs now assert in
OSD::get_or_create_pg()with "FAILED assert(role == 0)".
Quoted 7 lines
This seems to be a similar failure-mode for others who report issues after PG-splitting; as in those cases,
ceph -walso reports errors of the form:[ERR] mkpg 1.1p23 up [5,12] != acting [12]
Have I done something wrong? Is there some alternate sequence of steps that avoids / suppresses PG splitting?
As Sage said, the operations you mentioned should not have changed the number of PGs.
However, if you ever changed the number of PGs on a live system (on a non-empty pool), your cluster may be in some weird corrupt state, and that could cause all the symptoms you are seeing.
As far as I know, work on the PG splitting/joining feature is currently suspended in favor of the leveldb-based key-value store and improving commit latency. Hopefully Sam can get back to PG splits in the near future, I see regular demand for it.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html