Repository navigation
fuse: flush dirty times when a whole-file DLM revoke drops the write … - #277
Conversation
…grant Under DLM with the writeback cache, a write takes a write grant, which holds the sattr lock in CW, and file_update_time() only marks the inode's times dirty. When another request needs sattr PR, for example a stat on this or another node, fuse_reverse_inval_inode() writes back and drops the pages, but the dirty times survive the revoke. Close or the flusher sends them later as a WRITEBACK SETATTR. By then this node may hold sattr PR again, and the server has to revoke this node's own PR to grant the SETATTR's CW. In RED-52104 that revoke queued on the node's invalidation thread behind a stuck page-cache invalidation, and the SETATTR hung for more than ten minutes holding an RPC credit. A sattr revoke always reaches the kernel as a whole-file invalidation. Times are dirtied only under a write grant, so dirty times at a whole-file revoke mean the CW being revoked is this node's. Send them with sync_inode_metadata() after the pages are written back and dropped, while the range lock is still held. The server still sees this node's CW as granted, so the SETATTR's CW is granted past the pending conflicting lock instead of waiting for it, and the node that asked for PR sees this node's times. Signed-off-by: Hai Zhong Zhou <hazhou@ddn.com>
|
interesting hack ... I'm not convinced we need it. What we need is a clear design for meta data. So this can only be a temporary fix. |
Horst, actually the design for metadata was clear for write-back -- that is the mtime should be cached from fuse kernel, and this is the only metadata is updated in fuse kernel. However, the code change like this was missed... So I'm just adding it back. In summary, for metadata, all metadata should be still responsible by the redfs server, except for mtime from cache writes, and dirtied mtime should be flushed back to redfs server when losing the sattr CW/PW lock -- that should be done in invalidation path for the whole file (whole file invalidation means the sattr CW/PW lock is being revoked). |
hbirth
left a comment
There was a problem hiding this comment.
Can't do anything about it ... so here we go.
9973e48
into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1
Under DLM with the writeback cache, a write takes a write grant, which holds the sattr lock in CW, and file_update_time() only marks the inode's times dirty. When another request needs sattr PR, for example a stat on this or another node, fuse_reverse_inval_inode() writes back and drops the pages, but the dirty times survive the revoke. Close or the flusher sends them later as a WRITEBACK SETATTR. By then this node may hold sattr PR again, and the server has to revoke this node's own PR to grant the SETATTR's CW. In RED-52104 that revoke queued on the node's invalidation thread behind a stuck page-cache invalidation, and the SETATTR hung for more than ten minutes holding an RPC credit.
A sattr revoke always reaches the kernel as a whole-file invalidation. Times are dirtied only under a write grant, so dirty times at a whole-file revoke mean the CW being revoked is this node's. Send them with sync_inode_metadata() after the pages are written back and dropped, while the range lock is still held. The server still sees this node's CW as granted, so the SETATTR's CW is granted past the pending conflicting lock instead of waiting for it, and the node that asked for PR sees this node's times.