📄 nqnfs.me
字号:
Using leases permits the server to remain "stateless," since the softstate information, which consists of the set of current leases, ismoot after one minute, when all the leases expire..ppWhenever a client wishes to access a file's data it must hold one ofthree types of lease: read-caching, write-caching or non-caching.The latter type requires that all file operations be done synchronously withthe server via the appropriate RPCs..ppA read-caching lease allows for client data caching but no modificationsmay be done.It may, however, be shared between multiple clients. Diagram 1 shows a typicalread-caching scenario. The vertical solid black lines depict the lease records.Note that the time lines are nowhere near to scale, since a client/serverinteraction will normally take less than one hundred milliseconds, whereas thenormal lease duration is thirty seconds.Every lease includes a \fImodrev\fR value, which changes upon every modificationof the file. It may be used to check to see if data cached on the client isstill current..ppA write-caching lease permits delayed write caching,but requires that all data be pushed to the server when the lease expiresor is terminated by an eviction callback.When a write-caching lease has almost expired, the client will attempt toextend the lease if the file is still open, but is required to push the delayed writes to the serverif renewal fails (as depicted by diagram 2).The writes may not arrive at the server until after the write lease hasexpired on the client, but this does not result in a consistency problem,so long as the write lease is still valid on the server.Note that, in diagram 2, the lease record on the server remains current afterthe expiry time, due to the conditions mentioned in section 5.If a write RPC is done on the server after the write lease has expired onthe server, this could be considered an error since consistency could belost, but it is not handled as such by NQNFS..ppDiagram 3 depicts how read and write leases are replaced by a non-cachinglease when there is the potential for write sharing..(z.sp.PS.ps.ps 50line from 0.738,5.388 to 1.238,5.388.ps.ps 10dashwid = 0.050iline dashed from 1.488,10.075 to 1.488,5.450line dashed from 2.987,10.075 to 2.987,5.450line dashed from 4.487,10.075 to 4.487,5.450.ps.ps 50line from 4.487,7.013 to 4.487,5.950line from 2.987,7.700 to 2.987,5.950 to 2.987,6.075line from 1.488,7.513 to 1.488,5.950line from 2.987,9.700 to 2.987,8.325line from 1.488,9.450 to 1.488,8.325.ps.ps 10line from 2.987,6.450 to 4.487,6.200line from 4.385,6.192 to 4.487,6.200 to 4.393,6.241line from 4.487,6.888 to 2.987,6.575line from 3.080,6.620 to 2.987,6.575 to 3.090,6.571line from 2.987,7.263 to 4.487,7.013line from 4.385,7.004 to 4.487,7.013 to 4.393,7.054line from 4.487,7.638 to 2.987,7.388line from 3.082,7.429 to 2.987,7.388 to 3.090,7.379line from 2.987,6.888 to 1.488,6.575line from 1.580,6.620 to 1.488,6.575 to 1.590,6.571line from 1.488,7.200 to 2.987,6.950line from 2.885,6.942 to 2.987,6.950 to 2.893,6.991line from 2.987,7.700 to 1.488,7.513line from 1.584,7.550 to 1.488,7.513 to 1.590,7.500line from 1.488,8.012 to 2.987,7.763line from 2.885,7.754 to 2.987,7.763 to 2.893,7.804line from 2.987,9.012 to 1.488,8.825line from 1.584,8.862 to 1.488,8.825 to 1.590,8.813line from 1.488,9.325 to 2.987,9.137line from 2.885,9.125 to 2.987,9.137 to 2.891,9.175line from 2.987,9.637 to 1.488,9.450line from 1.584,9.487 to 1.488,9.450 to 1.590,9.438line from 1.488,9.887 to 2.987,9.700line from 2.885,9.688 to 2.987,9.700 to 2.891,9.737.ps.ps 12.ft.ft R"Lease valid on machine" at 1.363,5.296 ljust"with same modrev" at 1.675,7.421 ljust"miss)" at 2.612,9.233 ljust"(cache" at 2.300,9.358 ljust.ps.ps 14"Diagram #1: Read Caching Leases" at 0.738,5.114 ljust"Client B" at 4.112,10.176 ljust"Server" at 2.612,10.176 ljust"Client A" at 0.925,10.176 ljust.ps.ps 12"from cache" at 4.675,6.546 ljust"Read syscalls" at 4.675,6.796 ljust"Reply" at 3.737,6.108 ljust"(cache miss)" at 3.675,6.421 ljust"Read req" at 3.737,6.608 ljust"to lease" at 3.112,6.796 ljust"Client B added" at 3.112,6.983 ljust"Reply" at 3.237,7.296 ljust"Read + lease req" at 3.175,7.671 ljust"Read syscall" at 4.675,7.608 ljust"Reply" at 1.675,6.796 ljust"miss)" at 2.487,7.108 ljust"Read req (cache" at 1.675,7.233 ljust"from cache" at 0.425,6.296 ljust"Read syscalls" at 0.425,6.546 ljust"cache" at 0.425,6.858 ljust"so can still" at 0.425,7.108 ljust"Modrev same" at 0.425,7.358 ljust"Reply" at 1.675,7.671 ljust"Get lease req" at 1.675,8.108 ljust"Read syscall" at 0.425,7.983 ljust"Lease times out" at 0.425,8.296 ljust"from cache" at 0.425,9.046 ljust"Read syscalls" at 0.425,9.296 ljust"for Client A" at 3.112,9.296 ljust"Read caching lease" at 3.112,9.483 ljust"Reply" at 1.675,8.983 ljust"Read req" at 1.675,9.358 ljust"Reply" at 1.675,9.608 ljust"Read + lease req" at 1.675,9.921 ljust"Read syscall" at 0.425,9.921 ljust.ps.ft.PE.sp.)z.(z.sp.PS.ps.ps 50line from 1.175,5.700 to 1.300,5.700line from 0.738,5.700 to 1.175,5.700line from 2.987,6.638 to 2.987,6.075.ps.ps 10dashwid = 0.050iline dashed from 2.987,6.575 to 2.987,5.950line dashed from 1.488,6.575 to 1.488,5.888.ps.ps 50line from 2.987,9.762 to 2.987,6.638line from 1.488,9.450 to 1.488,7.700.ps.ps 10line from 2.987,6.763 to 1.488,6.575line from 1.584,6.612 to 1.488,6.575 to 1.590,6.563line from 1.488,7.013 to 2.987,6.825line from 2.885,6.813 to 2.987,6.825 to 2.891,6.862line from 2.987,7.325 to 1.488,7.075line from 1.582,7.116 to 1.488,7.075 to 1.590,7.067line from 1.488,7.700 to 2.987,7.388line from 2.885,7.383 to 2.987,7.388 to 2.895,7.432line from 2.987,8.575 to 1.488,8.325line from 1.582,8.366 to 1.488,8.325 to 1.590,8.317line from 1.488,8.887 to 2.987,8.637line from 2.885,8.629 to 2.987,8.637 to 2.893,8.679line from 2.987,9.637 to 1.488,9.450line from 1.584,9.487 to 1.488,9.450 to 1.590,9.438line from 1.488,9.887 to 2.987,9.762line from 2.886,9.746 to 2.987,9.762 to 2.890,9.796line dashed from 2.987,10.012 to 2.987,6.513line dashed from 1.488,10.012 to 1.488,6.513.ps.ps 12.ft.ft R"write" at 4.237,5.921 ljust"Lease valid on machine" at 1.425,5.733 ljust.ps.ps 14"Diagram #2: Write Caching Lease" at 0.738,5.551 ljust"Server" at 2.675,10.114 ljust"Client A" at 1.113,10.114 ljust.ps.ps 12"seconds after last" at 3.112,5.921 ljust"Expires write_slack" at 3.112,6.108 ljust"due to write activity" at 3.112,6.608 ljust"Expiry delayed" at 3.112,6.796 ljust"Lease times out" at 3.112,7.233 ljust"Lease renewed" at 3.175,8.546 ljust"Lease for client A" at 3.175,9.358 ljust"Write caching" at 3.175,9.608 ljust"Reply" at 1.675,6.733 ljust"Write req" at 1.988,7.046 ljust"Reply" at 1.675,7.233 ljust"Write req" at 1.675,7.796 ljust"Lease expires" at 0.487,7.733 ljust"Close syscall" at 0.487,8.108 ljust"lease granted" at 1.675,8.546 ljust"Get write lease" at 1.675,8.921 ljust"before expiry" at 0.487,8.608 ljust"Lease renewal" at 0.487,8.796 ljust"syscalls" at 0.487,9.046 ljust"Delayed write" at 0.487,9.233 ljust"lease granted" at 1.675,9.608 ljust"Get write lease req" at 1.675,9.921 ljust"Write syscall" at 0.487,9.858 ljust.ps.ft.PE.sp.)z.(z.sp.PS.ps.ps 50line from 0.613,2.638 to 1.238,2.638line from 1.488,4.075 to 1.488,3.638line from 2.987,4.013 to 2.987,3.575line from 4.487,4.013 to 4.487,3.575.ps.ps 10line from 2.987,3.888 to 4.487,3.700line from 4.385,3.688 to 4.487,3.700 to 4.391,3.737line from 4.487,4.138 to 2.987,3.950line from 3.084,3.987 to 2.987,3.950 to 3.090,3.938line from 2.987,4.763 to 4.487,4.450line from 4.385,4.446 to 4.487,4.450 to 4.395,4.495.ps.ps 50line from 4.487,4.438 to 4.487,4.013.ps.ps 10line from 4.487,5.138 to 2.987,4.888line from 3.082,4.929 to 2.987,4.888 to 3.090,4.879.ps.ps 50line from 4.487,6.513 to 4.487,5.513line from 4.487,6.513 to 4.487,6.513 to 4.487,5.513line from 2.987,5.450 to 2.987,5.200line from 1.488,5.075 to 1.488,4.075line from 2.987,5.263 to 2.987,4.013line from 2.987,7.700 to 2.987,5.325line from 4.487,7.575 to 4.487,6.513line from 1.488,8.512 to 1.488,8.075line from 2.987,8.637 to 2.987,8.075line from 2.987,9.637 to 2.987,8.825line from 1.488,9.450 to 1.488,8.950.ps.ps 10line from 2.987,4.450 to 1.488,4.263line from 1.584,4.300 to 1.488,4.263 to 1.590,4.250line from 1.488,4.888 to 2.987,4.575line from 2.885,4.571 to 2.987,4.575 to 2.895,4.620line from 2.987,5.263 to 1.488,5.075line from 1.584,5.112 to 1.488,5.075 to 1.590,5.063line from 4.487,5.513 to 2.987,5.325line from 3.084,5.362 to 2.987,5.325 to 3.090,5.313line from 2.987,5.700 to 4.487,5.575line from 4.386,5.558 to 4.487,5.575 to 4.390,5.608line from 4.487,6.013 to 2.987,5.825line from 3.084,5.862 to 2.987,5.825 to 3.090,5.813line from 2.987,6.200 to 4.487,6.075line from 4.386,6.058 to 4.487,6.075 to 4.390,6.108line from 4.487,6.450 to 2.987,6.263line from 3.084,6.300 to 2.987,6.263 to 3.090,6.250line from 2.987,6.700 to 4.487,6.513line from 4.385,6.500 to 4.487,6.513 to 4.391,6.550line from 1.488,6.950 to 2.987,6.763line from 2.885,6.750 to 2.987,6.763 to 2.891,6.800line from 2.987,7.700 to 4.487,7.575line from 4.386,7.558 to 4.487,7.575 to 4.390,7.608line from 4.487,7.950 to 2.987,7.763line from 3.084,7.800 to 2.987,7.763 to 3.090,7.750line from 2.987,8.637 to 1.488,8.512line from 1.585,8.546 to 1.488,8.512 to 1.589,8.496line from 1.488,8.887 to 2.987,8.700line from 2.885,8.688 to 2.987,8.700 to 2.891,8.737line from 2.987,9.637 to 1.488,9.450line from 1.584,9.487 to 1.488,9.450 to 1.590,9.438line from 1.488,9.950 to 2.987,9.762line from 2.885,9.750 to 2.987,9.762 to 2.891,9.800dashwid = 0.050iline dashed from 4.487,10.137 to 4.487,2.825line dashed from 2.987,10.137 to 2.987,2.825line dashed from 1.488,10.137 to 1.488,2.825.ps.ps 12.ft.ft R"(not cached)" at 4.612,3.858 ljust.ps.ps 14"Diagram #3: Write sharing case" at 0.613,2.239 ljust.ps.ps 12"Write syscall" at 4.675,7.546 ljust"Read syscall" at 0.550,9.921 ljust.ps.ps 14"Lease valid on machine" at 1.363,2.551 ljust.ps.ps 12"(can still cache)" at 1.675,8.171 ljust"Reply" at 3.800,3.858 ljust"Write" at 3.175,4.046 ljust"writes" at 4.612,4.046 ljust"synchronous" at 4.612,4.233 ljust"write syscall" at 4.675,5.108 ljust"non-caching lease" at 3.175,4.296 ljust"Reply " at 3.175,4.483 ljust"req" at 3.175,4.983 ljust"Get write lease" at 3.175,5.108 ljust"Vacated msg" at 3.175,5.483 ljust"to the server" at 4.675,5.858 ljust"being flushed to" at 4.675,6.046 ljust"Delayed writes" at 4.675,6.233 ljust.ps.ps 16"Server" at 2.675,10.182 ljust"Client B" at 3.925,10.182 ljust"Client A" at 0.863,10.182 ljust.ps.ps 12
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -