CEPH filesystem development
 help / color / mirror / Atom feed
From: caifeng.zhu@uniswdc.com
To: ceph-devel@vger.kernel.org
Subject: incorrect object stat sum in PG info after pg split
Date: Tue, 10 Jan 2017 18:03:19 +0800	[thread overview]
Message-ID: <20170110100319.GA20556@T530I> (raw)

Hi, all

We find that after the number of pgs increased, the object stat sum
in pg info is incorrect. 

The following steps can reproduce the problem.
0 assume the object store is a filestore.
1 create a pool 'foo' with the number of pgs such as 64.
2 write data through clients(rbd, cephfs or rgw) into the pool 'foo'.
3 increase the number of pgs in the pool 'foo' to such as 128.
4 after pgs are settled, use 'ceph pg x.y query' to look at the field
  'num_objects'
5 find the osd shard where pg x.y resides by 'ceph pg map x.y' and
  count the number of objects in the osd shard by command like 
  'find /var/lib/ceph/osd/ceph-0/current/x.y_head/ -type f | wc -l'

The code flow to increase the pg number is as follows:
OSD::advance_pg
	-> OSD::split_pgs
		-> object_stat_sum::split
	-> ReplicatedPG::split_colls
		-> PG::_create
		-> ObjectStore::Transaction::split_collection
			/* indirectly call FileStore::_split_collection 
			 * when applying transaction into file system.
			 */
	-> PG::split_into

Compare object_stat_sum::split with FileStore::_split_collection, the splitting
logic is different and makes stat.sum different from the actual number of objects
in the collection. 

The question is that should we fix this difference? If so, how to fix? 
In current design, it seems very difficult to fix the problem.

A similar bug is reported as tracker.ceph.com/issues/16671, which will occur
if all the exitent data in pool 'foo' is deleted. 

Best Regards




             reply	other threads:[~2017-01-10 10:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 10:03 caifeng.zhu [this message]
2017-01-10 12:44 ` incorrect object stat sum in PG info after pg split Sage Weil
2017-01-11  8:08   ` caifeng.zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170110100319.GA20556@T530I \
    --to=caifeng.zhu@uniswdc.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox