mds: directories pinned keep being replicated back and forth between exporting mds and importing mds
Recently, when developing the rstat propagation function, we found that when pinning some directory to a specific rank, there exists chances that the directory pinned keep being replicated back and forth between exporting mds and importing mds.
After a series of debugging, we believe this is due to the fact that exporting mds put the inode into "export_pin_queue" before the journaling of "setattr" request and, during the migration, "projected inode" is not replicated. So, when the migration happens before the completion of the "setattr" request's journaling, the importing mds would receive an inode whose export_pin is -1. So, when the importing mds does MDBalancer::tick, it would find that the inode just imported should be pinned to the rank that some of its parent belongs to, which is the exporting mds by a large chance. So there goes a export back from the importing mds to the exporting mds.