# US 2025/0165195 A1 · Prefetching keys for garbage collection

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

- Number: US 2025/0165195 A1
- Document ID: US20250165195A1
- Status: Published application
- Kind: A1
- Application number: 19/029,599
- Filed: 2025-01-17
- Published: 2025-05-22
- Earliest claimed: 2022-04-28
- Assignees: NetApp, Inc.
- Applicants: NetApp, Inc.
- Inventors: Anil Paul Thoppil; Wei Sun; Meera Octugoudar; Szu-Wen Kuo; Santosh Selvaraj
- Web page: https://patentgrep.com/patent/US20250165195A1

## CPC

- G06F 3/067: {Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]}
- G06F 3/068: {Hybrid storage device}
- G06F 3/061: {Improving I/O performance}
- G06F 3/0638: {Organizing or formatting or addressing of data}
- G06F 3/0656: {Data buffering arrangements}
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 12/0862: with prefetch
- G06F 12/0868: Data transfer between cache memory and other subsystems, e.g. storage devices or host systems
- G06F 16/24552: {Database cache management}
- G06F 16/28: Databases characterised by their database models, e.g. relational or object models
- G06F 3/0602: {specifically adapted to achieve a particular effect}
- G06F 3/0652: {Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket}
- G06F 2201/885: Monitoring specific for caches
- G06F 2212/154: Networked environment
- G06F 2212/254: Distributed memory
- G06F 2212/261: Storage comprising a plurality of storage devices
- G06F 2212/284: being distributed
- G06F 2212/401: Compressed data
- G06F 2212/465: Structured object, e.g. database record
- G06F 2212/466: Metadata, control data
- G06F 2212/502: using adaptive policy
- G06F 2212/7205: Cleaning, compaction, garbage collection, erase control
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are provided for implementing a garbage collection process and a prediction read ahead mechanism to prefetch keys into memory to improve the efficiency and speed of the garbage collection process. A log structured merge tree is used to store keys of key-value pairs within a key-value store. If a key is no longer referenced by any worker nodes of a distributed storage architecture, then the key can be freed to store other data. Accordingly, garbage collection is performed to identify and free unused keys. The speed and efficiency of garbage collection is improved by dynamically adjusting the amount and rate at which keys are prefetched from disk and cached into faster memory for processing by the garbage collection process.

## Claims

### Claim 1

A method, comprising:
receiving, by a first worker node from a second worker node of a distributed storage architecture hosting a key value store, an indication of keys, within the key value store, that are in-use by the second worker node;
comparing the indication of the keys that are in-use by the second worker node to keys cached by the first worker node within memory to identify one or more keys that are not in-use by the first worker node and the second worker node;
identifying key value pairs associated with the one or more keys; and
removing the key value pairs from the key value store.

### Claim 2 (depends on 1)

The method of claim 1, comprising:
constructing a probabilistic structure to provide the indication of the keys that are in-use by the second worker node; and
populating the probabilistic structure with a bit vector of cells set to values indicative of the keys that are in-use by the second worker node.

### Claim 3 (depends on 1)

The method of claim 1, comprising:
constructing a probabilistic structure to provide the indication of the keys that are in-use by the second worker node; and
populating the probabilistic structure with a bit vector of cells set to values indicative of the keys that are in-use by the second worker node.

### Claim 4 (depends on 1)

The method of claim 1, comprising:
constructing a probabilistic structure to provide the indication of the keys that are in-use by the second worker node, wherein the probabilistic structure is constructed to block the first worker node from garbage collecting the keys indicated by the probabilistic structure as being in-use by the second worker node.

### Claim 5 (depends on 1)

The method of claim 1, comprising:
constructing a probabilistic structure to provide the indication of the keys that are in-use by the second worker node, wherein the probabilistic structure is constructed with a bit vector of cells;
in response to determining that a key is in-use, hashing the in-use keys one or more times to create hashes; and
setting bits in the bit vector to a first bit value at index values of the hashes.

### Claim 6 (depends on 1)

The method of claim 1, wherein a probabilistic structure provides the indication of the keys that are in-use by the second worker node, and wherein the method comprises:
prefetching and caching, by the first worker node, keys from distributed storage as cached keys; and
validating the probabilistic structure by comparing the probabilistic structure to cached keys.

### Claim 7 (depends on 6)

The method of claim 6, comprising:
selecting an amount of keys to pre-fetch based upon a time to validate the probabilistic structure.

### Claim 8

A system, comprising:
a distributed storage architecture including a plurality of worker nodes managing distributed storage comprised of storage devices hosted by the plurality of worker nodes; and
a first worker node of the distributed storage architecture owning key value pairs of a key value store hosted within the distributed storage, wherein the first worker node:
receives, from a second worker node, probabilistic structure providing an indication of keys, within the key value store, that are in-use by the second worker node;
compares the probabilistic structure to keys cached by the first worker node within memory to identify one or more keys that are not in-use by the first worker node and the second worker node;
identifies key value pairs associated with the one or more keys; and
removes the key value pairs from the key value store.

### Claim 9 (depends on 8)

The system of claim 8, wherein the first worker node:
performs, by a garbage collection process, a first garbage collection round to remove the key value pairs from the key value storage using the probabilistic structure from the second work node and one or more additional probabilistic structures from other worker nodes of the distributed storage architecture.

### Claim 10 (depends on 9)

The system of claim 9, wherein the first worker node:
monitors a rate at which probabilistic structures are being received by the garbage collection process; and
selects an amount of keys to pre-fetch and cache based upon the rate at which the probabilistic structures are being received by the garbage collection process.

### Claim 11 (depends on 8)

The system of claim 8, wherein the first worker node:
selects an amount of keys to pre-fetch and cache based upon disk latency of the storage devices.

### Claim 12 (depends on 8)

The system of claim 8, wherein the first worker node:
collects, using a feedback loop, operational statistics associated with performing garbage collection of the key value store; and
compares the operational statistics to a rate of prefetching and caching keys into memory in order to select an amount of keys to pre-fetch and cache.

### Claim 13 (depends on 8)

The system of claim 8, wherein the first worker node:
implements a predictive read ahead mechanism to identify a set of keys that will be evaluated during a second garbage collection round subsequent a first garbage collection round that removed the key value pairs from the key value store, wherein the set of keys are pre-fetched from the storage devices and are cached into memory for evaluation during the second garbage collection round.

### Claim 14 (depends on 13)

The system of claim 13, wherein the first worker node:
in response to determining that a rate at which delete operations are being processed that result in an amount of unused keys exceeding a threshold, selects an amount of keys as the set of keys that is larger than an amount of the keys cached by the first worker node.

### Claim 15

A non-transitory machine readable medium comprising instructions, which when executed by a machine, causes the machine to:
receive, by a first worker node from a second worker node of a distributed storage architecture hosting a key value store, bit vector providing an indication of keys, within the key value store, that are in-use by the second worker node;
compare bit vector to keys cached by the first worker node within memory to identify one or more keys that are not in-use by the first worker node and the second worker node;
identify key value pairs associated with the one or more keys; and
remove the key value pairs from the key value store.

### Claim 16 (depends on 15)

The non-transitory machine readable medium of claim 15, wherein the instructions cause the machine to:
construct the bit vector with values to block the first worker node from garbage collecting the keys indicated by the bit vector as being in-use by the second worker node.

### Claim 17 (depends on 15)

The non-transitory machine readable medium of claim 15, wherein the instructions cause the machine to:
in response to determining that a key is in-use, hash the in-use key one or more times to create hashes; and
set bits in the bit vector to a firs bit value at index values of the hashes.

### Claim 18 (depends on 15)

The non-transitory machine readable medium of claim 15, wherein the instructions cause the machine to:
cache, by the first worker node, keys from distributed storage as cached keys; and
validate the bit vector by comparing the bit vector to cached keys.

### Claim 19 (depends on 18)

The non-transitory machine readable medium of claim 18, wherein the instructions cause the machine to:
select and cache an amount of keys based upon a time to validate the bit vector.

### Claim 20 (depends on 19)

The non-transitory machine readable medium of claim 19, wherein the instructions cause the machine to:
monitor a rate of delete operations being performed upon the key value store; and
selects an amount of keys to represent using the bit vector based upon the rate of the delete operations being performed.
