SlideShare a Scribd company logo
Soumya Koduri
Poornima G
Lease Locks and
Caching
Gluster design Summit
May. 2015
05/17/16 2GlusterFS Meetup
Agenda
● Quick intro to Lease locks
● Why implement in Gluster
● Design
● Network Partitions
● Challenges / limitations
● Future enhancements
● Client side caching with leases
05/17/16 3GlusterFS Meetup
● Locking mechanism, which guarentees the
client, certain semantics with respect to the
sharing of the file/directory with other clients.
● Granted on regular files (file/directory).
● Protocol for cache consistency and aggressive
caching.
● Enhances performance.
Quick intro to Lease locks
05/17/16 4GlusterFS Meetup
Quick intro to Lease locks
Client 1
Server
 Request for 
lease on file1
file1
file1
 Granted,
cache file1
Client 2
  Request for 
access to file1
  Lease Break file1
Flush all the 
cached data
  Flush file1,
Unlock lease
6.Granted access
to file1
1
2
6
4
3
5
05/17/16 5GlusterFS Meetup
Why support it in Gluster
● NFS-Ganesha/Samba applications
● Multi-protocol access on Gluster
● A new client side caching xlator based on leases
– File data
– Directory entries (+ readdirplus)
– Metadata
05/17/16 6GlusterFS Meetup
Lease locks and its
manifestations
● Linux lease locks:
- Read lease
- Write lease
- Process based
● NFS V4 delegations:
- Read delegations
- Write delegations
- Directory delegations
- Client based
05/17/16 7GlusterFS Meetup
Lease locks and its
manifestations
● SMB
- Oplocks (opurtunistic locking)
Level 1 (exclusive lock)
Level 2 (Read lock)
Batch (handle caching +
exclusive lock)
Fd based
Leases introduced in SMB 2.1
Read
Read/Handle
Read/Write
Read/Write/handles
Client based
05/17/16 8GlusterFS Meetup
On Gluster
● Currently supported
- Read Lease
- Write Lease
- fd based
● Plan is to support a super set of all standards:
- Handle Lease, Read handle, Read Write Handle Lease
- Lease Key support i.e. client based.
- Lease upgrade/downgrade.
- Directory Lease
05/17/16 9GlusterFS Meetup
Design
Gluster Server
Locks xlator
Lease xlator
libgfapi
Protocol clnt
Protocol server
glfs_adv_lock()
Lk Request
Lk Response
Recall Lease
Uses Upcall
Infra
- Stores the lease info
- Check conflict,grant/
Recall lease
- Timer based recall
05/17/16 10GlusterFS Meetup
Design
● New API introduced in libgfapi to request lease locks.
int glfs_*advanced*_lock ();
● Lease xlator on server side above Posix locks:
- Maintains the lease state of a file
- Checks for conflicts, Grants, Recall, lease locks
● Recall lease is implemented using Gluster file system
notifications.
● Timer based recall
05/17/16 11GlusterFS Meetup
Network Parition
● Gluster Server disconnects:
➢ Replica brick will serve the lease state.
➢ Non-replica - the lease state is lost forever.
● Gluster Client disconnects:
➢ All the locks held by this client will be unlocked.
● Gluster Server/Client Reconnects:
➢
The client will replay all the lease locks it has held.
05/17/16 12GlusterFS Meetup
Challenges / Limitations
● Rebalance/Tiering
● Self-Heal
● Client lock replay not enabled.
● Inconsistency when used along with
performance xlators
● Delegation throttling
● Tracking non fd based fops and the actual
client associated
05/17/16 13GlusterFS Meetup
Future Enhancements
● Super set of all leases
● Upgrade and downgrade leases
● Heuristics based lease grant
– Conflict frequency
– Limit on leases granted
– Quota limits
● Migrate/heal lease state
● Locks recovery during network disconnects
05/17/16 14GlusterFS Meetup
Client side caching
05/17/16 15GlusterFS Meetup
Common challenges of
caching
● Challenges with caching
➢ Mostly in memory hence less aggressive
➢ Not distributed cache coherent
➢ Performance hit with cache-validation
requests
➢ Not tolerant with file-system notification
failures
05/17/16 16GlusterFS Meetup
Benifits of using leases
● Cache Coherency
● Aggressive persistent data caching
● Reduces application-level response time
● Suitable for distributed systems of larger
scale with their larger ratio of processor
speed to network delay
● Performance improvement in the workloads
with little write-sharing
05/17/16 17GlusterFS Meetup
Benifits of using leases
● Directory leases will help in caching readdir and
readdirplus coherently
● Well suited for home directory use cases
● Decreases file creation latency
05/17/16 18GlusterFS Meetup
Client cache based on leases
Gluster Server
Locks xlator
Lease xlator
Libgfapi/FUSE
Protocol clnt
Protocol server
Open file1
Open + Lease req
Lease Granted rsp
Lease Cache
Open
Open+
lease
Cache file1
if lease granted
Gluster Client
05/17/16 19GlusterFS Meetup
Thank You!

More Related Content

ODP
20160401 Gluster-roadmap
ODP
GlusterFs Architecture & Roadmap - LinuxCon EU 2013
ODP
GlusterD 2.0 - Managing Distributed File System Using a Centralized Store
ODP
Introduction to highly_availablenfs_server_on_scale-out_storage_systems_based...
ODP
Software defined storage
ODP
Gluster technical overview
PDF
Gluster wireshark niels_de_vos
PDF
20160401 guster-roadmap
20160401 Gluster-roadmap
GlusterFs Architecture & Roadmap - LinuxCon EU 2013
GlusterD 2.0 - Managing Distributed File System Using a Centralized Store
Introduction to highly_availablenfs_server_on_scale-out_storage_systems_based...
Software defined storage
Gluster technical overview
Gluster wireshark niels_de_vos
20160401 guster-roadmap

What's hot (20)

PDF
Qemu gluster fs
ODP
20160130 Gluster-roadmap
PDF
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
PDF
Gluster intro-tdose
PDF
Sdc 2012-challenges
PDF
Gluster fs current_features_and_roadmap
ODP
Gluster intro-tdose
PDF
Integrating gluster fs,_qemu_and_ovirt-vijay_bellur-linuxcon_eu_2013
ODP
Integrating gluster fs,_qemu_and_ovirt-vijay_bellur-linuxcon_eu_2013
ODP
Glusterfs for sysadmins-justin_clift
ODP
Lisa 2015-gluster fs-hands-on
PDF
Smb gluster devmar2013
PDF
Gluster d2
ODP
Scale out backups-with_bareos_and_gluster
PDF
Debugging with-wireshark-niels-de-vos
ODP
Developing apps and_integrating_with_gluster_fs_-_libgfapi
ODP
Gluster fs hadoop_fifth-elephant
PDF
Gluster for sysadmins
ODP
Red Hat Gluster Storage : GlusterFS
ODP
Tiering barcelona
Qemu gluster fs
20160130 Gluster-roadmap
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
Gluster intro-tdose
Sdc 2012-challenges
Gluster fs current_features_and_roadmap
Gluster intro-tdose
Integrating gluster fs,_qemu_and_ovirt-vijay_bellur-linuxcon_eu_2013
Integrating gluster fs,_qemu_and_ovirt-vijay_bellur-linuxcon_eu_2013
Glusterfs for sysadmins-justin_clift
Lisa 2015-gluster fs-hands-on
Smb gluster devmar2013
Gluster d2
Scale out backups-with_bareos_and_gluster
Debugging with-wireshark-niels-de-vos
Developing apps and_integrating_with_gluster_fs_-_libgfapi
Gluster fs hadoop_fifth-elephant
Gluster for sysadmins
Red Hat Gluster Storage : GlusterFS
Tiering barcelona
Ad

Viewers also liked (17)

ODP
Lcna example-2012
ODP
YDAL Barcelona
ODP
Accessing gluster ufo_-_eco_willson
PDF
On demand file-caching_-_gustavo_brand
ODP
Sdc challenges-2012
PDF
State of the_gluster_-_lceu
ODP
Gluster d thread_synchronization_using_urcu_lca2016
ODP
Bug triage in_gluster
ODP
Join the super_colony_-_feb2013
ODP
Gdeploy 2.0
ODP
Lcna tutorial-2012
ODP
Gsummit apis-2013
ODP
Dedupe nmamit
ODP
Introduction to Open Source
PDF
Disperse xlator ramon_datalab
ODP
GlusterFS Containers
ODP
Responsibilities of gluster_maintainers
Lcna example-2012
YDAL Barcelona
Accessing gluster ufo_-_eco_willson
On demand file-caching_-_gustavo_brand
Sdc challenges-2012
State of the_gluster_-_lceu
Gluster d thread_synchronization_using_urcu_lca2016
Bug triage in_gluster
Join the super_colony_-_feb2013
Gdeploy 2.0
Lcna tutorial-2012
Gsummit apis-2013
Dedupe nmamit
Introduction to Open Source
Disperse xlator ramon_datalab
GlusterFS Containers
Responsibilities of gluster_maintainers
Ad

Similar to Leases and-caching final (20)

PDF
Gluster fs current_features_and_roadmap
PDF
GlusterFS : un file system open source per i big data di oggi e domani - Robe...
PDF
GlusterFs: a scalable file system for today's and tomorrow's big data
PDF
Storage as a Service with Gluster
PDF
Gluster fs architecture_&_roadmap_atin_punemeetup_2015
ODP
20160401 guster-roadmap
PDF
Gluster overview & future directions vault 2015
ODP
GlusterFS Architecture - June 30, 2011 Meetup
PDF
Life as a GlusterFS Consultant with Ivan Rossi
PDF
Gluster fs for_storage_admins_glusterfs_meetup_07_feb
ODP
Gluster 3.3 deep dive
PDF
Marian Marinov Clusters With Glusterfs
ODP
Gluster fs architecture_future_directions_tlv
PDF
Gluster fs architecture_future_directions_tlv
PDF
Gluster fs architecture_&_roadmap-vijay_bellur-linuxcon_eu_2013
ODP
The Future of GlusterFS and Gluster.org
PPT
Lustre And Nfs V4
PDF
GlusterFS And Big Data
PDF
Challenges with Gluster and Persistent Memory with Dan Lambright
PDF
Gluster Webinar May 25: Whats New in GlusterFS 3.2
Gluster fs current_features_and_roadmap
GlusterFS : un file system open source per i big data di oggi e domani - Robe...
GlusterFs: a scalable file system for today's and tomorrow's big data
Storage as a Service with Gluster
Gluster fs architecture_&_roadmap_atin_punemeetup_2015
20160401 guster-roadmap
Gluster overview & future directions vault 2015
GlusterFS Architecture - June 30, 2011 Meetup
Life as a GlusterFS Consultant with Ivan Rossi
Gluster fs for_storage_admins_glusterfs_meetup_07_feb
Gluster 3.3 deep dive
Marian Marinov Clusters With Glusterfs
Gluster fs architecture_future_directions_tlv
Gluster fs architecture_future_directions_tlv
Gluster fs architecture_&_roadmap-vijay_bellur-linuxcon_eu_2013
The Future of GlusterFS and Gluster.org
Lustre And Nfs V4
GlusterFS And Big Data
Challenges with Gluster and Persistent Memory with Dan Lambright
Gluster Webinar May 25: Whats New in GlusterFS 3.2

More from Gluster.org (20)

PDF
Automating Gluster @ Facebook - Shreyas Siravara
PDF
nfusr: a new userspace NFS client based on libnfs - Shreyas Siravara
PDF
Facebook’s upstream approach to GlusterFS - David Hasson
PDF
Throttling Traffic at Facebook Scale
PDF
GlusterFS w/ Tiered XFS
PDF
Gluster Metrics: why they are crucial for running stable deployments of all s...
PDF
Up and Running with Glusto & Glusto-Tests in 5 Minutes (or less)
PDF
Data Reduction for Gluster with VDO
PDF
Releases: What are contributors responsible for
PDF
RIO Distribution: Reconstructing the onion - Shyamsundar Ranganathan
PDF
Gluster and Kubernetes
PDF
Native Clients, more the merrier with GFProxy!
PDF
Gluster: a SWOT Analysis
PDF
GlusterD-2.0: What's Happening? - Kaushal Madappa
PDF
Scalability and Performance of CNS 3.6
PDF
What Makes Us Fail
PDF
Gluster as Native Storage for Containers - past, present and future
PDF
Heketi Functionality into Glusterd2
PDF
Hands On Gluster with Jeff Darcy
PDF
Architecture of the High Availability Solution for Ganesha and Samba with Kal...
Automating Gluster @ Facebook - Shreyas Siravara
nfusr: a new userspace NFS client based on libnfs - Shreyas Siravara
Facebook’s upstream approach to GlusterFS - David Hasson
Throttling Traffic at Facebook Scale
GlusterFS w/ Tiered XFS
Gluster Metrics: why they are crucial for running stable deployments of all s...
Up and Running with Glusto & Glusto-Tests in 5 Minutes (or less)
Data Reduction for Gluster with VDO
Releases: What are contributors responsible for
RIO Distribution: Reconstructing the onion - Shyamsundar Ranganathan
Gluster and Kubernetes
Native Clients, more the merrier with GFProxy!
Gluster: a SWOT Analysis
GlusterD-2.0: What's Happening? - Kaushal Madappa
Scalability and Performance of CNS 3.6
What Makes Us Fail
Gluster as Native Storage for Containers - past, present and future
Heketi Functionality into Glusterd2
Hands On Gluster with Jeff Darcy
Architecture of the High Availability Solution for Ganesha and Samba with Kal...

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Per capita expenditure prediction using model stacking based on satellite ima...
Dropbox Q2 2025 Financial Results & Investor Presentation
Chapter 3 Spatial Domain Image Processing.pdf
A Presentation on Artificial Intelligence
Digital-Transformation-Roadmap-for-Companies.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Monthly Chronicles - July 2025
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Leases and-caching final

  • 1. Soumya Koduri Poornima G Lease Locks and Caching Gluster design Summit May. 2015
  • 2. 05/17/16 2GlusterFS Meetup Agenda ● Quick intro to Lease locks ● Why implement in Gluster ● Design ● Network Partitions ● Challenges / limitations ● Future enhancements ● Client side caching with leases
  • 3. 05/17/16 3GlusterFS Meetup ● Locking mechanism, which guarentees the client, certain semantics with respect to the sharing of the file/directory with other clients. ● Granted on regular files (file/directory). ● Protocol for cache consistency and aggressive caching. ● Enhances performance. Quick intro to Lease locks
  • 4. 05/17/16 4GlusterFS Meetup Quick intro to Lease locks Client 1 Server  Request for  lease on file1 file1 file1  Granted, cache file1 Client 2   Request for  access to file1   Lease Break file1 Flush all the  cached data   Flush file1, Unlock lease 6.Granted access to file1 1 2 6 4 3 5
  • 5. 05/17/16 5GlusterFS Meetup Why support it in Gluster ● NFS-Ganesha/Samba applications ● Multi-protocol access on Gluster ● A new client side caching xlator based on leases – File data – Directory entries (+ readdirplus) – Metadata
  • 6. 05/17/16 6GlusterFS Meetup Lease locks and its manifestations ● Linux lease locks: - Read lease - Write lease - Process based ● NFS V4 delegations: - Read delegations - Write delegations - Directory delegations - Client based
  • 7. 05/17/16 7GlusterFS Meetup Lease locks and its manifestations ● SMB - Oplocks (opurtunistic locking) Level 1 (exclusive lock) Level 2 (Read lock) Batch (handle caching + exclusive lock) Fd based Leases introduced in SMB 2.1 Read Read/Handle Read/Write Read/Write/handles Client based
  • 8. 05/17/16 8GlusterFS Meetup On Gluster ● Currently supported - Read Lease - Write Lease - fd based ● Plan is to support a super set of all standards: - Handle Lease, Read handle, Read Write Handle Lease - Lease Key support i.e. client based. - Lease upgrade/downgrade. - Directory Lease
  • 9. 05/17/16 9GlusterFS Meetup Design Gluster Server Locks xlator Lease xlator libgfapi Protocol clnt Protocol server glfs_adv_lock() Lk Request Lk Response Recall Lease Uses Upcall Infra - Stores the lease info - Check conflict,grant/ Recall lease - Timer based recall
  • 10. 05/17/16 10GlusterFS Meetup Design ● New API introduced in libgfapi to request lease locks. int glfs_*advanced*_lock (); ● Lease xlator on server side above Posix locks: - Maintains the lease state of a file - Checks for conflicts, Grants, Recall, lease locks ● Recall lease is implemented using Gluster file system notifications. ● Timer based recall
  • 11. 05/17/16 11GlusterFS Meetup Network Parition ● Gluster Server disconnects: ➢ Replica brick will serve the lease state. ➢ Non-replica - the lease state is lost forever. ● Gluster Client disconnects: ➢ All the locks held by this client will be unlocked. ● Gluster Server/Client Reconnects: ➢ The client will replay all the lease locks it has held.
  • 12. 05/17/16 12GlusterFS Meetup Challenges / Limitations ● Rebalance/Tiering ● Self-Heal ● Client lock replay not enabled. ● Inconsistency when used along with performance xlators ● Delegation throttling ● Tracking non fd based fops and the actual client associated
  • 13. 05/17/16 13GlusterFS Meetup Future Enhancements ● Super set of all leases ● Upgrade and downgrade leases ● Heuristics based lease grant – Conflict frequency – Limit on leases granted – Quota limits ● Migrate/heal lease state ● Locks recovery during network disconnects
  • 15. 05/17/16 15GlusterFS Meetup Common challenges of caching ● Challenges with caching ➢ Mostly in memory hence less aggressive ➢ Not distributed cache coherent ➢ Performance hit with cache-validation requests ➢ Not tolerant with file-system notification failures
  • 16. 05/17/16 16GlusterFS Meetup Benifits of using leases ● Cache Coherency ● Aggressive persistent data caching ● Reduces application-level response time ● Suitable for distributed systems of larger scale with their larger ratio of processor speed to network delay ● Performance improvement in the workloads with little write-sharing
  • 17. 05/17/16 17GlusterFS Meetup Benifits of using leases ● Directory leases will help in caching readdir and readdirplus coherently ● Well suited for home directory use cases ● Decreases file creation latency
  • 18. 05/17/16 18GlusterFS Meetup Client cache based on leases Gluster Server Locks xlator Lease xlator Libgfapi/FUSE Protocol clnt Protocol server Open file1 Open + Lease req Lease Granted rsp Lease Cache Open Open+ lease Cache file1 if lease granted Gluster Client

Editor's Notes

  • #8: Oplocks was introduced in SMB 2? Leases were introduced in SMB 2.1 – considered as oplocks done right. Major differences being: - Introduction of new typrs of leases - Introduction of lease Key
  • #9: Doesn't adhere to the Posix standard of one unlock per process.
  • #10: Command to enable Lease lock support for a volume: Gluster volume set <volname> leaeses on Recall Lease implemented via the file system notification feature in Gluster The lease lock requests are not sent to the Posix locks xlator, and hence it should be placed above the Posix locks, for it to function right.
  • #11: Command to enable Lease lock support for a volume: Gluster volume set <volname> leaeses on Recall Lease implemented via the file system notification feature in Gluster The lease lock requests are not sent to the Posix locks xlator, and hence it should be placed above the Posix locks, for it to function right.
  • #12: Command to enable Lease lock support for a volume: Gluster volume set <volname> leaeses on Recall Lease implemented via the file system notification feature in Gluster The lease lock requests are not sent to the Posix locks xlator, and hence it should be placed above the Posix locks, for it to function right.
  • #16: architectures; this work relies on reliable, synchronous broadcast communication as provided by the system bus. A distributed system, however, can experience partial fail- ures: a host may crash or messages may be lost. Existing approaches to consistency for file caches fall into two cat- egories: those that assume reliable broadcast, and so do not tolerate communication failures, and those that require a consistency check for every read, and so fail to deliver good performance.
  • #17: architectures; this work relies on reliable, synchronous broadcast communication as provided by the system bus. A distributed system, however, can experience partial fail- ures: a host may crash or messages may be lost. Existing approaches to consistency for file caches fall into two cat- egories: those that assume reliable broadcast, and so do not tolerate communication failures, and those that require a consistency check for every read, and so fail to deliver good performance.
  • #19: Command to enable Lease lock support for a volume: Gluster volume set <volname> leaeses on Recall Lease implemented via the file system notification feature in Gluster The lease lock requests are not sent to the Posix locks xlator, and hence it should be placed above the Posix locks, for it to function right.