Leases: An Efficient Fault Tolerant
Mechanism for Distributed File
Presented by Lingxiang Tai
Part I - Problem With Distributed
System Caching
Background
Caching is mechanism to improve the speed and
performance of the system by replicating copies of
frequently accessed data.
● Complexity of ensuring consistency
○ with reams of clients, one can modify data
without consent of the others, cause the stale
data reading for the others.
● Complication of communication and host failtures
(Non-Byzantine failure)
○ Message lost due to these failures
Part II- Lease
Lease
● General Meaning
○ A lease is a contract that give its holder specified right
over property for a limited period of time.
● Caching Meaning
○ A lease is promise by the server that it will not conduct
any writes to the datum covered by your lease before
asking you for consent or waiting for the lease’s expiry
a granted period of time
Read And Write under Lease
● Read
○ First access will get the copy and a term of lease(eg: 10 seconds)
○ Latter read (within 10s) use the cached copy
○ Latter read (beyond 10s) require server to refresh data and Lease
● Write (here only consider write through)
○ client send write to server directly.
○ server defer the request until all the files’ leaseholder granted
approvals or all these leases expired
client
(cache)
server
Read Write
Short Term Lease
● Main Prons
○ Deferring write request, server will wait for a failed client to grant approval,
short term lease expiring fast.
○ When a server crashed, recovery work should wait all those leases granted
before to expire, short term lease make make it quick.
○ Short term lease can minimize the overhead callback in False Sharing cases.
(False Sharing means a client holds a relative long lease, while it’s not currently
accessing it)
Long Term Lease
● Main Prons
○ better for the files accessed repeatedly and have relatively little
write-sharing.
○ Especially, for the read-only file, you can take the lease as a infinite value.
Part III- Lease Analysis
How to chose a lease term
● It is a trade off between minimizing the lease extension overhead versus
minimizing false sharing
● If we can build a function with lease term (variable X) and other target
Metric (variable Y), we can distinguish it much easier.
○ y = Y(x)
Performance parameters
● N number of clients
● R rate of reads for each client
● W rate of writes for each client
● mprop
propagation delay for a message
● mproc
time to process a message (send or receive)
● ε allowance for uncertainty in clocks
● ts
lease term at server
● tc
lease term at client
Server load
● define the Y1
as the observable server load
○ Y1
=
Average latency
● define the Y2
as the observable average latency
○ Y2
=
Average latency(under a delay of network)
● base on average latency,we added 100ms
to the network latency
Conclusion
● Lease have the benefit of increasing the ratio of clients to servers (by reducing the
consistency overhead), thereby reducing the cost (or improving the performance ) of
large-scale systems.
Part IV - Others
Options for lease management
● Separate the files apart according to file’s characteristics, with the different leases to
manage them (improve the both performance for R&W)
● Group a batch of files managed with a same lease (can reduce the number of lease, server
lease overload and so on)
● Let the server multicast the lease extension periodically to all clients, rather client’s
fetching. (reduce the traffic to contact with every client & reduce the server’s track work of
every leaseholder)
Fault Tolerance
● Client Failure
○ No impact to READ,short delay for other client WRITE
● Server Failure
○ Client with old lease can still be accessed to READ but lease extension is shortly
delayed;
○ WRITE operation will be shortly delayed untill server is recovered from crash.
● Physical Clock drift
○ see next sheet...
Physical Clock Drift
● Server clock advances
○ server may allow a WRITE before the term of
a lease held by a previous client has expired
at that client.
● Client clock slows
○ client may still use a lease which the server regards as having expired.
● Server clock slows
○ no inconsistency, but generate extra traffic(sever always gives clients a “expired
lease”)
● Client clock advances
○ no inconsistency, but generate extra traffic (sever always gives clients a “expired
lease”)
Server
Client
Reading Source
Thank You !

[Paper Reading] Leases: An Efficient Fault-Tolerant Mechanism for Distributed File Cache Consistency

  • 1.
    Leases: An EfficientFault Tolerant Mechanism for Distributed File Presented by Lingxiang Tai
  • 2.
    Part I -Problem With Distributed System Caching
  • 3.
    Background Caching is mechanismto improve the speed and performance of the system by replicating copies of frequently accessed data. ● Complexity of ensuring consistency ○ with reams of clients, one can modify data without consent of the others, cause the stale data reading for the others. ● Complication of communication and host failtures (Non-Byzantine failure) ○ Message lost due to these failures
  • 4.
  • 5.
    Lease ● General Meaning ○A lease is a contract that give its holder specified right over property for a limited period of time. ● Caching Meaning ○ A lease is promise by the server that it will not conduct any writes to the datum covered by your lease before asking you for consent or waiting for the lease’s expiry a granted period of time
  • 6.
    Read And Writeunder Lease ● Read ○ First access will get the copy and a term of lease(eg: 10 seconds) ○ Latter read (within 10s) use the cached copy ○ Latter read (beyond 10s) require server to refresh data and Lease ● Write (here only consider write through) ○ client send write to server directly. ○ server defer the request until all the files’ leaseholder granted approvals or all these leases expired client (cache) server Read Write
  • 7.
    Short Term Lease ●Main Prons ○ Deferring write request, server will wait for a failed client to grant approval, short term lease expiring fast. ○ When a server crashed, recovery work should wait all those leases granted before to expire, short term lease make make it quick. ○ Short term lease can minimize the overhead callback in False Sharing cases. (False Sharing means a client holds a relative long lease, while it’s not currently accessing it)
  • 8.
    Long Term Lease ●Main Prons ○ better for the files accessed repeatedly and have relatively little write-sharing. ○ Especially, for the read-only file, you can take the lease as a infinite value.
  • 9.
  • 10.
    How to chosea lease term ● It is a trade off between minimizing the lease extension overhead versus minimizing false sharing ● If we can build a function with lease term (variable X) and other target Metric (variable Y), we can distinguish it much easier. ○ y = Y(x)
  • 11.
    Performance parameters ● Nnumber of clients ● R rate of reads for each client ● W rate of writes for each client ● mprop propagation delay for a message ● mproc time to process a message (send or receive) ● ε allowance for uncertainty in clocks ● ts lease term at server ● tc lease term at client
  • 12.
    Server load ● definethe Y1 as the observable server load ○ Y1 =
  • 13.
    Average latency ● definethe Y2 as the observable average latency ○ Y2 =
  • 14.
    Average latency(under adelay of network) ● base on average latency,we added 100ms to the network latency
  • 15.
    Conclusion ● Lease havethe benefit of increasing the ratio of clients to servers (by reducing the consistency overhead), thereby reducing the cost (or improving the performance ) of large-scale systems.
  • 16.
    Part IV -Others
  • 17.
    Options for leasemanagement ● Separate the files apart according to file’s characteristics, with the different leases to manage them (improve the both performance for R&W) ● Group a batch of files managed with a same lease (can reduce the number of lease, server lease overload and so on) ● Let the server multicast the lease extension periodically to all clients, rather client’s fetching. (reduce the traffic to contact with every client & reduce the server’s track work of every leaseholder)
  • 18.
    Fault Tolerance ● ClientFailure ○ No impact to READ,short delay for other client WRITE ● Server Failure ○ Client with old lease can still be accessed to READ but lease extension is shortly delayed; ○ WRITE operation will be shortly delayed untill server is recovered from crash. ● Physical Clock drift ○ see next sheet...
  • 19.
    Physical Clock Drift ●Server clock advances ○ server may allow a WRITE before the term of a lease held by a previous client has expired at that client. ● Client clock slows ○ client may still use a lease which the server regards as having expired. ● Server clock slows ○ no inconsistency, but generate extra traffic(sever always gives clients a “expired lease”) ● Client clock advances ○ no inconsistency, but generate extra traffic (sever always gives clients a “expired lease”) Server Client
  • 20.
  • 21.