The idea is caching both snap infos and pending updates in snapclient.
The snapclient also tracks updates that are being committed, it applies
these commits to its cached snap infos. Steps to update snaptable are:
- mds.x acquire locks (xlock on snaplock of affected snaprealm inode)
- mds.x prepares snaptable update. (send preare to snapserver and waits
for 'agree' reply)
- snapserver sends notification about the update to all mds and waits
for ACKs. (not implemented by this patch)
- snapserver send 'agree' reply to mds.x
- mds.x journals corresponding
- mds.x commits the snaptable update and notifies all mds that it
commits that update. then mds drops locks.
When receiving committing notification, mds applies the committing
update to its cached snap infos. By this way, cached snap infos get
synchronized before snaplock become readable.