cephfs snapc writeback order
I'm taking a stab at converting ceph to use the netfs write helpers. One thing I'm seeing though is that the kclient takes great care to write back data to the OSDs in order of snap context age, such that an older snapc will get written back before a newer one. With the netfs helpers, that may not happen quite as naturally. We may end up with it trying to flush data for a newer snapc ahead of the older one.
My question is: is that necessarily a problem? We'd be sending along the correct info from the capsnap for each snapc, which seems like it should be sufficient to ensure that the writes get applied correctly. If we were to send these out of order, what would break and how?
Signature · 1 line
Jeff Layton <[email protected]>
A message that is not in the archive (sent off-list or not yet received): CAN0f57GxvOh4uyqrwkHz=WjS_fR0dunDFxMeeTPMP3Gu+AR5Cg@mail.gmail.com
Quoted 24 lines · Sage Weil
Hi Jeff!
Quoted 12 lines · Jeff Layton
I'm taking a stab at converting ceph to use the netfs write helpers. One
thing I'm seeing though is that the kclient takes great care to write
back data to the OSDs in order of snap context age, such that an older
snapc will get written back before a newer one. With the netfs helpers,
that may not happen quite as naturally. We may end up with it trying to
flush data for a newer snapc ahead of the older one.Quoted 7 lines
My question is: is that necessarily a problem? We'd be sending along the
correct info from the capsnap for each snapc, which seems like it should
be sufficient to ensure that the writes get applied correctly. If we were to send these out of order, what would break and how?
Quoted 9 lines
Writing back snapshotted data out of order would corrupt the snapshot content. The OSD can only create clone objects (snapshotted data) from the live/head/most recent version of the object it has, which means that a newer write followed by an older one will apply the old data to the newer object. Exactly how that shakes out depends on where the writes are relative to object boundaries (the cloning on the OSD is by object) and how the writes were ordered relative to the snapshots, but in any case the end result will not be correct.
Got it, thanks. Also thanks to Greg for his response.
Quoted 2 lines
:( Hopefully that doesn't make the netfs transition unworkable!
No, it doesn't make the transition unworkable, but we'll need to implement something in the netfs layer to ensure that things get written back in the correct order. David and I are still discussing what to do, but it should be doable.
Signature · 1 line
Jeff Layton <[email protected]>