On Sun, Mar 22, 2020 at 3:40 PM Xinying Song <songxinying.ftd@xxxxxxxxx> wrote: > > Hi, everyone: > Could anybody give some tips about how `mdr->slave_commit` is called? > > As for `link_remote()`, steps are as follows: > 1. master mds sends OP_(UN)LINKPREP to salve mds. > 2. slave mds replys OP_LINKPREPACK to master mds after its journal has > been flushed. > 3. master mds continues to process the client request. > > I only find out there is a chance in MDCache::request_finish() that > `mdr->slave_commit` will be called. However, after a successful > journal flush, slave mds only sends an ACK to master mds and bypasses > MDCache::request_finish(). > So when or where is `mdr->slave_commit` called? > > Thanks! master calls MDCache::request_finsih(), MDCache::request_drop_foreign_locks() sends MMDSSlaveRequest::OP_FINISH message to slaves. slaves call MDCache::request_finsih() when receiving the message.