Repository navigation
Conversation
19c8958 to
057d1e3
Compare
|
Sorry about the delay -- I'll try to get to it this week after some prioritized work done. |
No problem:-) We've just fixed the staged fltree unittest case yesterday:-) |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
1e15222 to
f23b326
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
jenkins test make check |
|
I might need to prioritize reviewing the cleanups to the lba tree to get my memory back, probably also helpful to make lba related PR (such as this one) easier to review. If there are related cleanups in this PR or worth doing, feel free to split it out. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
b78c1ee to
e46409b
Compare
…it lba keys Signed-off-by: Xuehan Xu <[email protected]>
|
Hi @cyx1231st, I've divided the original 128 LBA implementation into two parts. This first part(this PR) updates the byte addressing laddr_t to block (4K) addressing using a 128-bit laddr_t. The next step is implementing deterministic operations for clone, rollback, and recovery scenarios. |
|
@zhscn thanks for keeping this PR rebased and make it smaller for review. This is a critical change but I've been prioritized to review the other PRs, sorry about that. I'll start to review this. |
cyx1231st
left a comment
There was a problem hiding this comment.
I'll keep on reviewing, let me know if there is a new version ready to push, so I can send out my pending comments before the original version is gone.
| struct ref_update_result_t { | ||
| extent_ref_count_t refcount = 0; | ||
| pladdr_t addr; | ||
| pladdr_t addr = L_ADDR_NULL; |
There was a problem hiding this comment.
Should this default to PL_ADDR_NULL?
There was a problem hiding this comment.
Yeah, PL_ADDR_NULL was removed by mistake, will update it in next push.
cyx1231st
left a comment
There was a problem hiding this comment.
Let's make the essential documentation accurate first to involve more reviewers.
| * and this offset is always 4KiB aligned. 15 bits indicate the hard limit of an | ||
| * object is 1 << (15 + 12) = 128 MiB. | ||
| * | ||
| * TODO: implement determinsitic allocation in LBAManager |
There was a problem hiding this comment.
TODO: implement determinisitic allocation in LBAManager, see get_next_hint(laddr).
| * laddr_t uses uint128_t to represent the logical address internally. | ||
| * The layout of laddr: | ||
| * | ||
| * [pool:8][shard:8][crush:32][random:31][metadata:1][recover:1][local_clone_id:32][offset:15] |
There was a problem hiding this comment.
As discussed, change to [is_metadata:1][random:31] for larger possible laddr space for object data/metadata.
There was a problem hiding this comment.
Probably an obvious question -- why place metadata, recover, local_clone_id after random?
edit: ah, to distinguish between metadata and clones of the same object, right? metadata is more significant than local_clone_id so that data for different clones of the same object will sort together?
There was a problem hiding this comment.
The random field is intended to distinguish between objects of different (pool, shard, crush, clone), right? We can't actually use it for both that and reserved, I think? Perhaps those should be split? metadata makes sense -- we might want to use different placement policy with anything with that bit set. I'm less sure about recover, though. There aren't currently any cases I can think of where we might want to have more than one temp object for a particular object, but I'm not sure we want to make that impossible.
For temp objects, it'll still be possible to enumerate temp objects, right?
There was a problem hiding this comment.
edit: ah, to distinguish between metadata and clones of the same object, right? metadata is more significant than local_clone_id so that data for different clones of the same object will sort together?
Yes, seems it's better to seperate them into different address space.
The
randomfield is intended to distinguish between objects of different (pool, shard, crush, clone), right? We can't actually use it for both that and reserved, I think?
You're right, comments here is wrong.
Perhaps those should be split?
Reserved bits seem reasonable, but it's not easy to determine where those bits should place, eg. reserve for gloabl bits or object local bits.
I'm less sure about
recover, though. There aren't currently any cases I can think of where we might want to have more than one temp object for a particular object, but I'm not sure we want to make that impossible.For temp objects, it'll still be possible to enumerate temp objects, right?
This bit is introduced due to static layout, please see the long documentation blow, currently it's not used.
There was a problem hiding this comment.
We can't actually use it for both that and reserved
My understanding is the [random:31] portion can shrink anytime to allow some bits to serve other purposes in the future.
For temp objects, it'll still be possible to enumerate temp objects, right?
The scope of such enumeration is a PG, right?
My understanding is if we want to enumerate/list temp objects efficiently within a PG, they might need to be arranged together there.
There was a problem hiding this comment.
For temp objects, it'll still be possible to enumerate temp objects, right?
I think the 128-bit lba key implementation doesn't affect objects enumeration, as we always to first list onodes from the onode tree and then access the objects' data/omaps in the enumeration, and no matter how the extents' laddr arranges, we can always get the right laddrs through onodes. Am I right?
| * the same crush, and if more fields need to be added in the future, take | ||
| * bits from this field. | ||
| * metadata: the extents with data_category_t::METADATA will set this bit. | ||
| * recover: the extents of TEMP_RECOVERING objects will set this bit. |
There was a problem hiding this comment.
As discussed, let's split out the optimization around the "recover" bit.
| * when a new clone object is created. | ||
| * offset: this field represents the extent of the offset relative to the onode base, | ||
| * and this offset is always 4KiB aligned. 15 bits indicate the hard limit of an | ||
| * object is 1 << (15 + 12) = 128 MiB. |
There was a problem hiding this comment.
Not sure if 15-bit (128MiB) is sufficient in case of RGW/CephFS ?
| * laddr_t uses uint128_t to represent the logical address internally. | ||
| * The layout of laddr: | ||
| * | ||
| * [pool:8][shard:8][crush:32][random:31][metadata:1][recover:1][local_clone_id:32][offset:15] |
There was a problem hiding this comment.
Not really sure if the 8-bit pool field is sufficient to prevent transaction conflicts, it depends on how many pools an OSD might contain possibly, and the complete pool field has 64 bits.
I know the 8-bit pool is taken from the original hint, but now we will have 128 bits.
There was a problem hiding this comment.
include/rados.h has a 32 bit pool in the ceph_pg type. I think it's 64 bit elsewhere without a particularly good reason. 8 bits is probably too small, but 12 bits is probably entirely safe as long as we're willing to remap pool ids. Even that probably won't be necessary any time soon as I don't think there's a way to force the creation of a pool with a large ID. Realistically, I think the only way for a cluster to have pools with large numeric pool ids would be a usage pattern that involved frequently creating and deleting pools.
There was a problem hiding this comment.
OK, 12-bit pool field seems better.
| * recover: the extents of TEMP_RECOVERING objects will set this bit. | ||
| * local_clone_id: monotonically increasing within the same object, increases | ||
| * when a new clone object is created. | ||
| * offset: this field represents the extent of the offset relative to the onode base, |
There was a problem hiding this comment.
Do you mean after this PR, the granularity of laddr will be changed from 1B to 4KB?
There was a problem hiding this comment.
Yes, that's also the reason that here exists loffset_t for 4KB unaligned logical address.
There was a problem hiding this comment.
I see, then all the calculations related to laddr +- size have to be adjusted.
| * object is 1 << (15 + 12) = 128 MiB. | ||
| * | ||
| * TODO: implement determinsitic allocation in LBAManager | ||
| */ |
There was a problem hiding this comment.
Let's make sure this part is accurately documented, so we can involve more reviewers to align on the general decisions and the scope.
The layout of the laddr fields should be designed carefully, shouldn't be changed very frequently.
|
Change log 2024/07/03:
Change log 2024/07/01:
@athanatos This PR is split from our full 128 laddr_t implementation, so some of the code may look very confusing, sorry for the inconvenience. After communicating with @cyx1231st, the code no longer reflects the latest design. The new design displays as following: existing laddr_t issuesCurrently allocating a laddr for an object/extent follows these steps:
However, this procedure have several problems:
introduce 128 bit laddr_t to solve these problemsWe have some methods to speed up laddr allocation:
Here we get the initial layout of 128bit laddr_t: optimization for 128 bit laddrThe introduction of the 128-bit laddr reduces the fan-out of LBA leaf nodes from 140 to 89, as the size of lba_map_val_t (pladdr_t 9 -> 17) grows from 21 to 29. Old layout of LBALeafNode: New layout of LBALeafNode: To further reduce space usage, we propose optimizing laddr_t with a static layout that introduces semantic information to each field. static layoutupdate on 2024/07/03: object prefixThe primary purpose of the static layout is to introduce object prefix. Each object has a unique object prefix on the lba tree, ensuring it never conflicts with other objects. With the object prefix and local clone id, laddr allocation for a clone object becomes deterministic, eliminating collision concerns. All clone onodes from one object share the same object prefix. 2024/07/03 udpate: OSD level metadata extents, RootBlock, CollectionNode and SeastoreNodeExtent, has constent prefix whose bits are all of zero, and the rest 48 bits are just random number. What's more, the lba_map_val_t struct doesn't need to store the complete 128-bit laddr, it can only keep the local clone id(less than 64 bits) relative to current lba key to represtent the real intermidate key. Now the layout of LBALeafNode becomes: Additionally, the static object prefix will be also require by LBC(logical bucket cache) in the future, we can trace the interested extents and their prefixes to build a LRU list for guiding the GC process to determine whether needs to evict an extent to the slower devices.
|
|
For global metadata (RootBlock, CollectionNode and SeastoreNodeExtent), L_ADDR_MIN would still be sufficient as before, so they are unrelated to the For per-object metadata, as I'm getting the concept of |
Is it related to the solution? |
Not fully understood this, will the current 64-bit implementation cause inconsistent ordering of the clones among OSDs? If not, why leveraging a local-clone-id as part of the laddr will cause the ordering problem. IIUC the laddr itself isn't related to the object ordering, right? |
It's not local-clone-id causing ordering problem. The issue is that the recovery order of clones/head are not deterministic, and in SeaStore, the corner cases can be significantly reduced if we can make sure that the order of local-clone-id and the order in which the clones are created are consistent. So we chose to encapsulate the local-clone-id in the object PUSH messages, so that the OSD being recovered can maintain the correct order of the clones. |
128-bit laddr doesn't solve this issue, listing it here is it causes the address exhaustion. |
Sounds the issue is related to the design of rados protocol, affecting classic/bluestore and crimson/alienstore as well, and we are planning to address it specifically in SeaStore by exposing the designing Does the indeterministic recovery order cause incorrectness or only cause performance issues? |
Not only a perf issue, we think that the logic within the SeaStore may become very complex and very error prune if we allow the inconsistency between the local-clone-id order and the clone creation order. Actually, we did allow this at first and the debug work went into chaos, which led us to this design. In practice, we added a new internal attribute Since we are adding new attr instead of changing existing attrs' semantic, I think only crimson + seastore need to worry about this modification, other components can simply ignore this change and remain untouched. |
I think it's not about rados protocol, it's not changing protocols, only adds some new payload in recovery related messages. |
Allowing object metadata to share Another property probably @xxhdx1985126 might be interested, if place both metadata/data under the same defined |
Looks reasonable, the details about metadata allocation and taking snapshots will be added into the documentation lately. |
Great! Thanks! Hah, we also wanted metadata extents of the same object to have the same prefix, but got stuck with how to allocate the medata extents' laddr, given your approach, we believe this is feasible. @zhscn will update the above document, and get down to implementing it once the discussion concludes:-) |
After the discussion with @cyx1231st , we'll change to the random local-clone-id allocation approach, which should simplify the design and avoid the need to touch layers above SeaStore. |
|
The design documentation #55291 (comment) is up to data. The summay of changes:
|
|
I don't see any further concerns looking at the design and scope. Just some nits:
Might look better like: Let's organize the commits to split pure-refactor/cleanup and core-modifications with clear messages. That would be helpful a lot in understanding the core changes and impacts more quickly. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e