From: Loic Dachary <loic@dachary.org>
To: Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: pg_missing_t::is_missing semantics
Date: Mon, 27 May 2013 21:11:15 +0200 [thread overview]
Message-ID: <51A3AFD3.3010205@dachary.org> (raw)
In-Reply-To: <51A37BD9.6080109@dachary.org>
[-- Attachment #1: Type: text/plain, Size: 2821 bytes --]
On 05/27/2013 05:29 PM, Loic Dachary wrote:
> Hi,
>
> When testing if a specific version of an object is missing with pg_missing_t::is_missing
> https://github.com/ceph/ceph/blob/master/src/osd/osd_types.cc#L2153
> if the version needed is greater than the version given in argument, false is returned.
>
> Each object in pg_missing_t *have* a version and *need* another and *have* is lower than *need*.
> https://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1470
>
> Here is what gets me confused:
>
> if (item.need > v)
> return false;
> return true;
>
> A version lower than *need* is considered to not be missing ( by is_missing )
> where a version greater than *need* is considered to be missing.
>
> This prototype of is_missing is used at
>
> https://github.com/ceph/ceph/blob/master/src/osd/ReplicatedPG.cc#L5910
>
> if (missing.is_missing(oid, v)) {
> dout(10) << "got missing " << oid << " v " << v << dendl;
> missing.got(oid, v);
> if (is_primary())
> missing_loc.erase(oid);
>
> If the version is greater than the one needed ( i.e. it is more recent ) then it is not considered missing and therefore not removed from missing ( which is what pg_missing_t::got does ).
>
> Does it mean that when an object version is in missing, it will always be removed because the PG will receive an object that is either of the same version or lower ? And never receive an object of a version greater than the one in missing ?
>
https://github.com/ceph/ceph/blob/master/src/osd/ReplicatedPG.cc#L5319
if (missing.is_missing(recovery_info.soid) &&
missing.missing[recovery_info.soid].need > recovery_info.version) {
assert(is_primary());
pg_log_entry_t *latest = log.objects[recovery_info.soid];
if (latest->op == pg_log_entry_t::LOST_REVERT &&
latest->reverting_to == recovery_info.version) {
dout(10) << " got old revert version " << recovery_info.version
<< " for " << *latest << dendl;
recovery_info.version = latest->version;
// update the attr to the revert event version
recovery_info.oi.prior_version = recovery_info.oi.version;
recovery_info.oi.version = latest->version;
bufferlist bl;
::encode(recovery_info.oi, bl);
t->setattr(coll, recovery_info.soid, OI_ATTR, bl);
}
}
recover_got(recovery_info.soid, recovery_info.version);
Before calling recover_got, if the pg_log_entry is a LOST_REVERT operation for an object which version is lower than *need*, then it is modified to spoof the pg_log_entry as if it was of the same version as the object currently in the logs.
/me still digging :-)
--
Loïc Dachary, Artisan Logiciel Libre
All that is necessary for the triumph of evil is that good people do nothing.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2013-05-27 19:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-27 15:29 pg_missing_t::is_missing semantics Loic Dachary
2013-05-27 19:11 ` Loic Dachary [this message]
2013-05-27 19:35 ` Loic Dachary
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=51A3AFD3.3010205@dachary.org \
--to=loic@dachary.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.