All of lore.kernel.org
 help / color / mirror / Atom feed
From: Loic Dachary <loic@dachary.org>
To: Samuel Just <sam.just@inktank.com>
Cc: Ceph Development <ceph-devel@vger.kernel.org>
Subject: caching get_chunk_size()
Date: Sun, 02 Feb 2014 16:06:14 +0100	[thread overview]
Message-ID: <52EE5EE6.7010904@dachary.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

[cc' ceph-devel]

Hi Sam,

Assuming https://github.com/ceph/ceph/pull/1144 gets merged, MONs can query the plugin for a given pool or crush ruleset conveniently:

https://github.com/dachary/ceph/blob/15c90fbf61445063967fc80ee1c916d70c593a54/src/mon/OSDMonitor.cc#L2803

      ErasureCodeInterfaceRef erasure_code;
      err = get_erasure_code(properties, &erasure_code, ss);
      if (err == 0)
         *size = erasure_code->get_chunk_count();

And OSDs can do something similar (and must whenever an erasure coded pool is instantiated). If I understood correctly, you would like the result of erasure_code->get_chunk_size(some_osd_config_opt_value_defining_the_stripe_size) to be set as a new value in pg_pool_t https://github.com/dachary/ceph/blob/15c90fbf61445063967fc80ee1c916d70c593a54/src/osd/osd_types.h#L700 when the pool is created. 

The benefit of having pg_pool_t::chunk_size would be 

a) the value is shared cluster wide and does not depend on the specific version of the OSD/MON
b) if the value is needed frequently in a context where the plugin would have to be loaded, this will improve performances

However, whenever an OSD instantiates a PG that belongs to a pool, it must assert that the get_chunk_count() returned by the plugin matches the value stored in pg_pool_t::chunk_size otherwise it will encode inconsistently. 

If my reasoning matches yours, I'll implement the change. Otherwise, please correct me :-)

Cheers

-- 
Loïc Dachary, Artisan Logiciel Libre


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

             reply	other threads:[~2014-02-02 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-02 15:06 Loic Dachary [this message]
2014-02-02 22:28 ` caching get_chunk_size() Samuel Just
2014-02-04 16:40   ` 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=52EE5EE6.7010904@dachary.org \
    --to=loic@dachary.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sam.just@inktank.com \
    /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.