# US 2021/0286804 A1 · Targeted sweep method for key-value data storage

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

- Number: US 2021/0286804 A1
- Document ID: US20210286804A1
- Status: Published application
- Kind: A1
- Application number: 17/334,286
- Filed: 2021-05-28
- Published: 2021-09-16
- Earliest claimed: 2018-10-19
- Assignees: Palantir Technologies Inc.
- Applicants: Palantir Technologies Inc.
- Inventors: Grgur Petric Maretic; James Baker; Nathan Ziebart; Sandor Van Wassenhove
- Web page: https://patentgrep.com/patent/US20210286804A1

## CPC

- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/219: {Managing data history or versioning (querying versioned data G06F16/2474; querying temporal data G06F16/2477)}
- G06F 16/2322: {using timestamps}
- G06F 16/2329: {using versioning}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 16/24554: {Unary operations; Data partitioning operations}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method for targeted sweep of a key-value data storage is provided. The method comprises before a write transaction to a database having a key value store commits, and before each of one or more write commands of the write transaction are persisted to the key value store, writing an entry for each of the one or more write commands to an end of a targeted sweep queue, the entry comprising metadata including: data identifying a cell to which the write command relates, a start timestamp of the write transaction, and information identifying a type of the write transaction.

## Claims

### Claim 1

A computer-implemented method comprising:
writing entries corresponding to write commands of a write transaction to a targeted sweep queue in a database, wherein each entry from the entries comprises metadata including:
data identifying a cell to which a write command of the write commands relate, and
a timestamp of the write transaction; and
performing the targeted sweep of the database by deleting previous versions of cells associated with second entries, the second entries being selected from the entries based on respective timestamps of the second entries.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising storing a progress of the targeted sweep to indicate a most recent timestamp associated with the second entries.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein write commands associated with the second entries have been persisted into the database; and further comprising:
refraining from deleting previous versions associated with third entries, out of the entries, wherein the third entries have not been persisted into the database.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the deletion of the previous versions includes writing sentinel values to the deleted previous versions and replacing the deleted previous versions of cells with a tombstone.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein the deletion of the previous versions includes retaining most recent cells corresponding to the second entries.

### Claim 6 (depends on 4)

The computer implemented method of claim 4, wherein the deletion of the previous versions includes retaining the sentinel values and the write commands.

### Claim 7 (depends on 6)

The computer implemented method of claim 6, further comprising:
receiving a read request to obtain the second entries; and indicating that the read request fails rather than displaying that no data is present.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, wherein the second entries have latest timestamps that are within a range; and further comprising:
in response to determining that all previous versions corresponding to the second entries have been deleted, deleting previous versions associated with third entries having a second range of timestamps;
in response to deleting previous versions associated with the third entries, determining whether an additional entry within the range of the timestamps has been written and persisted into the database; and
in response to determining that the additional entry has been persisted into the database, deleting any remaining entries prior to the additional entry.

### Claim 9 (depends on 1)

The computer-implemented method of claim 1, wherein the deletion of the second entries is dependent upon a determination of whether the write commands include a tombstone, as indicated by the metadata.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, wherein the deletion of the second entries includes deleting a cell corresponding to a most recent timestamp if the write commands include a tombstone and retaining a cell corresponding to a most recent timestamp otherwise.

### Claim 11 (depends on 1)

The computer-implemented method of claim 1, wherein the timestamps of the second entries indicate times at which previous and current values of associated cells have respective latest timestamps that indicate a same time or a time previous to a starting timestamp of a longest running write transaction of the database.

### Claim 12

A system comprising:
one or more physical processors;
a memory storing instructions that, when executed by the one or more physical processors, cause the system to:
write entries corresponding to write commands of a write transaction to a targeted sweep queue in a database, wherein each entry from the entries comprises metadata including:
data identifying a cell to which a write command of the write commands relate, and
a timestamp of the write transaction; and
perform the targeted sweep of the database by deleting previous versions of cells associated with second entries, the second entries being selected from the entries based on respective timestamps of the second entries.

### Claim 13 (depends on 12)

The system of claim 12, wherein the instructions further cause the system to:
storing a progress of the targeted sweep to indicate a most recent timestamp associated with the second entries.

### Claim 14 (depends on 12)

The system of claim 12, wherein write commands associated with the second entries have been persisted into the database; and the instructions further cause the system to:
refrain from deleting previous versions associated with third entries, out of the entries, wherein the third entries have not been persisted into the database.

### Claim 15 (depends on 12)

The system of claim 12, wherein the deletion of the previous versions includes writing sentinel values to the deleted previous versions and replacing the deleted previous versions of cells with a tombstone.

### Claim 16 (depends on 15)

The system of claim 15, wherein the deletion of the previous versions includes retaining most recent cells corresponding to the second entries.

### Claim 17 (depends on 15)

The system of claim 15, wherein the deletion of the previous versions includes retaining the sentinel values and the write commands.

### Claim 18 (depends on 17)

The system of claim 17, wherein the instructions further cause the system to:
receive a read request to obtain the second entries; and
indicate that the read request fails rather than displaying that no data is present.

### Claim 19 (depends on 12)

The system of claim 12, wherein the second entries have latest timestamps that are within a range; and the instructions further cause the system to:
in response to determining that all previous versions corresponding to the second entries have been deleted, deleting previous versions associated with third entries having a second range of timestamps;
in response to deleting previous versions associated with the third entries, determining whether an additional entry within the range of the timestamps has been written and persisted into the database; and
in response to determining that the additional entry has been persisted into the database, deleting any remaining entries prior to the additional entry.

### Claim 20

A non-transitory computer-readable storage medium including instructions that, when executed by at least one processor of a computing system, cause the computing system to perform a method comprising:
writing entries corresponding to write commands of a write transaction to a targeted sweep queue in a database, wherein each entry from the entries comprises metadata including:
data identifying a cell to which a write command of the write commands relate, and
a timestamp of the write transaction; and
performing the targeted sweep of the database by deleting previous versions of cells associated with second entries, the second entries being selected from the entries based on respective timestamps of the second entries.
