parent xattrs on file objects
Hi Greg,
In this case where an inode is created on mds.a and exported to mds.b, there is a potential race on mds.b between a subsequent lookup-by-ino and the primary link actually making it into the inode container.
Our tentative solution was to rely on the way InoTable breaks up the range of inode numbers based on mds nodeid. So when a lookup on the inode container fails, we can determine which mds would have allocated that inode number and attempt to find the inode there. The originating mds.a should always find the inode in its cache while it's pinned for export. Depending on whether the inode is found on mds.a, the lookup-by-ino on mds.b either returns failure or waits for the import to finish.
Casey
----- Original Message -----
From: "Gregory Farnum" <[email protected]>
To: "Casey Bodley" <[email protected]>
Cc: "Matt W. Benjamin" <[email protected]>, [email protected], "aemerson" <[email protected]>, "peter honeyman" <[email protected]>, "Sage Weil" <[email protected]>
Sent: Wednesday, October 17, 2012 4:18:04 PM
Subject: Re: parent xattrs on file objects
Quoted 7 lines · Casey Bodley
To expand on what Matt said, we're also trying to address this issue of lookups by inode number for use with NFS.
The design we've been exploring is to create a single system inode, designated the 'inode container' directory, which stores the primary links to all inodes in the filesystem. These links are named by their inode number to satisfy lookups and obviate the need for an anchor table. This design allows the inode container to make use of existing directory fragmentation and load balancing to distribute the inodes over the MDS cluster.
When a new file is created, it then adds two links: a primary link into the inode container, and a remote link into the filesystem namespace. In the case where the parent directory fragment's authority is different than the corresponding inode container fragment's, it is created in the parent directory then exported to the inode container via an asynchronous slave request.
We welcome additional discussion, both on this design specifically and on the general topic of scalable ino lookups.
So if the primary link isn't always in the "inode container", you must be preserving the anchor table for this setup. Am I understanding that correctly? Or is there some other mechanism for linking them that's less expensive?
-Greg
I still don't get it. Putting every inode's primary link in a lookup directory and then patching the lookup code to go there makes sense to me. But if you have to go the other way (from the inode directory's secondary link to some other location as the primary link), you need an up-to-date path for that primary link, right? How do you handle it when the path changes — do you have a two-phase commit on the lookup directory attributes?
Quoted 22 lines · Casey Bodley
Hi Greg,
In this case where an inode is created on mds.a and exported to mds.b, there is a potential race on mds.b between a subsequent lookup-by-ino and the primary link actually making it into the inode container.
Our tentative solution was to rely on the way InoTable breaks up the range of inode numbers based on mds nodeid. So when a lookup on the inode container fails, we can determine which mds would have allocated that inode number and attempt to find the inode there. The originating mds.a should always find the inode in its cache while it's pinned for export. Depending on whether the inode is found on mds.a, the lookup-by-ino on mds.b either returns failure or waits for the import to finish.
Casey
----- Original Message -----
From: "Gregory Farnum" <[email protected]>
To: "Casey Bodley" <[email protected]>
Cc: "Matt W. Benjamin" <[email protected]>, [email protected], "aemerson" <[email protected]>, "peter honeyman" <[email protected]>, "Sage Weil" <[email protected]>
Sent: Wednesday, October 17, 2012 4:18:04 PM
Subject: Re: parent xattrs on file objectsQuoted 6 lines · Casey Bodley
To expand on what Matt said, we're also trying to address this issue of lookups by inode number for use with NFS.
The design we've been exploring is to create a single system inode, designated the 'inode container' directory, which stores the primary links to all inodes in the filesystem. These links are named by their inode number to satisfy lookups and obviate the need for an anchor table. This design allows the inode container to make use of existing directory fragmentation and load balancing to distribute the inodes over the MDS cluster.
When a new file is created, it then adds two links: a primary link into the inode container, and a remote link into the filesystem namespace. In the case where the parent directory fragment's authority is different than the corresponding inode container fragment's, it is created in the parent directory then exported to the inode container via an asynchronous slave request.
Quoted 7 lines
Quoted 1 line
We welcome additional discussion, both on this design specifically and on the general topic of scalable ino lookups.
So if the primary link isn't always in the "inode container", you must be preserving the anchor table for this setup. Am I understanding that correctly? Or is there some other mechanism for linking them that's less expensive?
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Mr. Farnum,
Quoted 8 lines · Gregory Farnum
I still don't get it. Putting every inode's primary link in a lookup directory and then patching the lookup code to go there makes sense to me. But if you have to go the other way (from the inode directory's secondary link to some other location as the primary link), you need an up-to-date path for that primary link, right? How do you handle it when the path changes — do you have a two-phase commit on the lookup directory attributes?
Our idea isn't to have the inode directory contain links back to the primary. Our idea is to have a structure managed by MDSs that is looked up by inode number and spread across the MDSs in a cluster similarly to the way CRUSH maps files across OSDs. This structure contains all the information currently in the inode that's now incorporated into the dirent.
The dirents would then contain mappings from mappings from names to inodes and possibly cache (but not be the primary for) inode content. We were also planning to change directory fragmentation to distribute fragments across MDSs based on a function of the filename, also similarly to how CRUSH maps objects to OSDs.
Respectfully yours,
Adam C. Emerson <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 19 lines · Adam C. Emerson
Mr. Farnum,
Quoted 8 lines · Gregory Farnum
I still don't get it. Putting every inode's primary link in a lookup directory and then patching the lookup code to go there makes sense to me. But if you have to go the other way (from the inode directory's secondary link to some other location as the primary link), you need an up-to-date path for that primary link, right? How do you handle it when the path changes ? do you have a two-phase commit on the lookup directory attributes?
Our idea isn't to have the inode directory contain links back to the primary. Our idea is to have a structure managed by MDSs that is looked up by inode number and spread across the MDSs in a cluster similarly to the way CRUSH maps files across OSDs. This structure contains all the information currently in the inode that's now incorporated into the dirent.
Quoted 5 lines
The dirents would then contain mappings from mappings from names to inodes and possibly cache (but not be the primary for) inode content. We were also planning to change directory fragmentation to distribute fragments across MDSs based on a function of the filename, also similarly to how CRUSH maps objects to OSDs.
I think this basic approach is viable. However, I'm hesitant to give up on embedded inodes because of the huge performance wins in the common cases; I'd rather have a more expensive lookup-by-ino in the rare cases where nfs filehandles are out of cache and be smokin' fast the rest of the time.
Are there reasons you're attached to your current approach? Do you see problems with a generalized "find this ino" function based on the file objects? I like the latter because it
- means we can scrap the anchor table, which needs additional work anyway if it is going to scale
- is generallly useful for fsck
- solves the NFS fh issue
The only real downsides I see to this approach are:
- more OSD ops (setxattrs.. if we're smart, they'll be cheap)
- lookup-by-ino for resolving hard links may be slower than the anchor table, which gives you *all* ancestors in one lookup, vs this, which may range from 1 lookup to (depth of tree) lookups (or possibly more, in rare cases). For all the reasons that the anchor table was acceptable for hard links, though (hard link rarity, parallel link patterns), I can live with it.
There are also lots of people who seem to be putting BackupPC (or whatever is it) on Ceph, which is creating huge messes of hard links, so it will be really good to solve/avoid teh current anchor table scaling problems.
sage