Bobijam, is there a reason why the MDS must update the layout version on the OST object before the client RPC can complete? If the client has a newer layout version than the OST, it would make sense that the client knows the new layout still includes the OST object, and the OST could just update the layout version directly.
This is very different from the case where the client sends an RPC with old layout version and may need to update the layout in order to generate the correct RPC. That may mean the client is flushing old data without the layout lock being revoked, and it needs to contact the MDS to get the new file layout.
Not only would this avoid the requirement for the MDS to send an urgent RPC to the OSS to avoid the client IO being blocked, but it seems like the MDS may not need to send any RPC at all, or at least not a distributed transaction RPC, if the client is still actively writing to the object. That would also avoid the race condition between the file layout being changed on the MDT and it being updated on all of the OST objects (which may be up to 2000 objects for a very wide striped layout). If a client sends an RPC with a new layout version to the OST first, then it can immediately update the object version and continue, unlike the current case of the client being blocked and waiting for a long time for the OST object version to be updated.
Landed for 2.16