# US 2021/0286802 A1 · Scalable locking techniques

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0286802 A1
- Document ID: US20210286802A1
- Status: Published application
- Kind: A1
- Application number: 16/816,905
- Filed: 2020-03-12
- Published: 2021-09-16
- Earliest claimed: 2020-03-12
- Assignees: Vast Data Ltd.
- Applicants: Vast Data Ltd.
- Inventors: Avi GOREN; Oren ASHKENAZI; Asaf LEVY
- Web page: https://patentgrep.com/patent/US20210286802A1

## CPC

- G06F 16/9027: {Trees}
- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- H04L 67/1001: for accessing one among a plurality of replicated servers
- H04L 67/1097: for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Systems and methods for scalable locking. A method includes adding a first lock entry representing a pending lock to a first tree, the first lock entry indicating a range to be locked; checking at least a portion of at least one second tree to determine whether a conflicting lock exists for the first lock entry among at least one second lock entry based on the range to be locked, wherein each of the first tree and the at least one second tree is a data structure including a plurality of nodes representing at least a plurality of attributes, wherein the plurality of attributes of the at least one second tree includes the at least one second lock entry; committing the pending lock when no conflicting lock exists; and resolving the pending lock based on a resolution of the conflicting lock when a conflicting lock exists.

## Claims

### Claim 1

A method for scalable locking, comprising:
adding a first lock entry representing a pending lock to a first tree, the first lock entry indicating a range to be locked;
checking at least a portion of at least one second tree to determine whether a conflicting lock exists for the first lock entry among at least one second lock entry based on the range to be locked, wherein each of the first tree and the at least one second tree is a data structure including a plurality of nodes, wherein the plurality of nodes of each tree represents at least a plurality of attributes, wherein the plurality of attributes of the at least one second tree includes the at least one second lock entry;
committing the pending lock when it is determined that no conflicting lock exists; and
resolving the pending lock based on a resolution of the conflicting lock when it is determined that a conflicting lock exists.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first lock entry indicates a first range of data, wherein each of the at least one second lock entry indicates a respective second range of data, wherein checking the at least a portion of the tree further comprises:
querying each of the at least one second lock entry indicating a respective second range of data that is within the first range of data.

### Claim 3 (depends on 1)

The method of claim 1, wherein the range to be locked is a first range, wherein each of the at least one second lock entry has a second range, wherein checking the at least a portion of the at least one second tree includes querying each of the plurality of attributes of the at least one second tree including one of the at least one second lock entry having a second range within the first range.

### Claim 4 (depends on 1)

The method of claim 1, wherein the at least one second tree is a plurality of second trees having a plurality of granularities, wherein the checking of the at least a portion of the at least one second tree is based further on the plurality of granularities.

### Claim 5 (depends on 4)

The method of claim 4, wherein a subset of the at least one second lock entry is checked, wherein the subset is determined based on the plurality of granularities and the range to be locked.

### Claim 6 (depends on 1)

The method of claim 1, wherein the conflicting lock is pending concurrently with the pending lock, wherein resolving the pending lock further comprises:
waiting for the conflicting lock to resolve, wherein the pending lock is resolved when the conflicting lock has been resolved.

### Claim 7 (depends on 1)

The method of claim 1, wherein resolving the pending lock further comprises:
cancelling the pending lock when the resolution of the conflicting lock is a commitment of the conflicting lock; and
committing the pending lock when the resolution of the conflicting lock is a cancellation of the conflicting lock.

### Claim 8

A non-transitory computer readable medium having stored thereon instructions for causing a processing circuitry to execute a process, the process comprising:
adding a first lock entry representing a pending lock to a first tree, the first lock entry indicating a range to be locked;
checking at least a portion of at least one second tree to determine whether a conflicting lock exists for the first lock entry among at least one second lock entry based on the range to be locked, wherein each of the first tree and the at least one second tree is a data structure including a plurality of nodes, wherein the plurality of nodes of each tree represents at least a plurality of attributes, wherein the plurality of attributes of the at least one second tree includes the at least one second lock entry;
committing the pending lock when it is determined that no conflicting lock exists; and
resolving the pending lock based on a resolution of the conflicting lock when it is determined that a conflicting lock exists.

### Claim 9

A system for scalable locking, comprising:
a processing circuitry; and
a memory, the memory containing instructions that, when executed by the processing circuitry, configure the system to:
add a first lock entry representing a pending lock to a first tree, the first lock entry indicating a range to be locked;
check at least a portion of at least one second tree to determine whether a conflicting lock exists for the first lock entry among at least one second lock entry based on the range to be locked, wherein each of the first tree and the at least one second tree is a data structure including a plurality of nodes, wherein the plurality of nodes of each tree represents at least a plurality of attributes, wherein the plurality of attributes of the at least one second tree includes the at least one second lock entry;
commit the pending lock when it is determined that no conflicting lock exists; and
resolve the pending lock based on a resolution of the conflicting lock when it is determined that a conflicting lock exists.

### Claim 10 (depends on 9)

The system of claim 9, wherein the first lock entry indicates a first range of data, wherein each of the at least one second lock entry indicates a respective second range of data, wherein the system is further configured to:
query each of the at least one second lock entry indicating a respective second range of data that is within the first range of data.

### Claim 11 (depends on 9)

The system of claim 9, wherein the range to be locked is a first range, wherein each of the at least one second lock entry has a second range, wherein checking the at least a portion of the at least one second tree includes querying each of the plurality of attributes of the at least one second tree including one of the at least one second lock entry having a second range within the first range.

### Claim 12 (depends on 9)

The system of claim 9, wherein the at least one second tree is a plurality of second trees having a plurality of granularities, wherein the checking of the at least a portion of the at least one second tree is based further on the plurality of granularities.

### Claim 13 (depends on 12)

The system of claim 12, wherein a subset of the at least one second lock entry is checked, wherein the subset is determined based on the plurality of granularities and the range to be locked.

### Claim 14 (depends on 9)

The system of claim 9, wherein the conflicting lock is pending concurrently with the pending lock, wherein the system is further configured to:
wait for the conflicting lock to resolve, wherein the pending lock is resolved when the conflicting lock has been resolved.

### Claim 15 (depends on 9)

The system of claim 9, wherein the system is further configured to:
cancel the pending lock when the resolution of the conflicting lock is a commitment of the conflicting lock; and
commit the pending lock when the resolution of the conflicting lock is a cancellation of the conflicting lock.

### Claim 16

A distributed storage system, comprising:
a plurality of storage nodes (DNodes), wherein the plurality of DNodes is configured to store at least one tree and a plurality of data blocks, wherein the at least one tree includes a plurality of attributes, wherein the plurality of attributes includes at least one lock entry; and
a plurality of compute nodes (CNodes), wherein each CNode has access to each of the DNodes, wherein each CNode is configured to receive an access command and to execute the access command based on the at least one tree, wherein each CNode is further configured to resolve pending locks based on the at least one lock entry.

### Claim 17 (depends on 16)

The distributed storage system of claim 16, wherein the at least one tree is a plurality of trees, wherein each of the plurality of trees has a distinct granularity with respect to locks stored in the tree.

### Claim 18 (depends on 17)

The distributed storage system of claim 17, wherein each CNode is further configured to:
scan the plurality of trees for at least one overlapping range based on the distinct granularity of each of the plurality of trees.

### Claim 19 (depends on 18)

The distributed storage system of claim 18, wherein the plurality of trees is scanned in parallel.

### Claim 20 (depends on 17)

The distributed storage system of claim 17, wherein each of the plurality of trees is organized with respect to starting offset ranges, wherein each of the plurality of trees is scanned from highest starting offset range to lowest starting offset range.

### Claim 21 (depends on 16)

The distributed storage system of claim 16, wherein each tree is a data structure including a plurality of elements, wherein each element is a persistent metadata structure, wherein the plurality of elements includes the plurality of attributes and a plurality of pointers.
