client: opportunistically update backtraces on files
I've seen a few reports that backtrace updates are causing issues due to the increased write load (and the bursty nature of the current implementation; see #8230).
Since most backtraces are simply set on creation and never updated, it should be possible for clients to write backtraces out if they're already touching the object and tell the MDS they've done so.
#1 Updated by Greg Farnum about 4 years ago
I think the steps to do this are:
1) Have MDS provide a bufferlist to the client whenever an inode is created (as an optional part of the InodeStat)
2) If the client ever writes to the first object, it writes this bufferlist to a known xattr.
3) Tell the MDS that the bufferlist was written as part of a caps update. (This is the part I'm divided on: should it be some kind of full cap, or just a boolean we set?)
4) In the MDS, call CInode::clear_dirty_parent() if we get a response from the client indicating they set the backtrace.