IP Library Granted Patent US 11,023,457
Granted Patent B1
US 11,023,457 · App. 16/287,525 · Granted Jun 1, 2021

Targeted sweep method for key-value data storage

Inventors: Grgur Petric Maretic (London, GB); James Baker (London, GB); Nathan Ziebart (Germantown, TN); Sandor Van Wassenhove (London, GB)
Assignee: Palantir Technologies Inc.
G06F16/2379G06F16/219G06F16/2322G06F16/2329G06F16/2365G06F16/24554
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,023,457
App. No.
16/287,525
Granted
Jun 1, 2021
Kind
B1
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 (73)

1. A computer-implemented method comprising:

writing an entry for each of one or more write commands of a write transaction to an end of a targeted sweep queue in a database having a key value store,

the entry for each of the one or more write commands comprising metadata including: data identifying a cell to which the one or more write commands relate, a start timestamp of the write transaction, and information identifying a type of the write transaction wherein writing the entry for each of the one or more write commands to the end of the targeted, sweep queue comprises:

partitioning a list of entries dependent on one or more parameters of a pre-defined targeted sweep strategy;

storing, as sweepable timestamp data of the targeted sweep queue, a fine partition timestamp derived from the start timestamp of the write transaction; and

storing, as sweepable cell data of the targeted sweep queue, for each entry within the partition, the metadata for each entry; and

performing the targeted sweep of the database by:

starting from a start of the targeted sweep queue,

selecting an entry from the targeted sweep queue based on a current sweep timestamp, and

using a single ranged tombstone to delete prior versions of a cell to which a write command of the entry relates.

2. The computer-implemented method of claim 1 , further comprising deleting the selected entry from the targeted sweep queue and selecting a next entry from the targeted sweep queue.

3. The computer-implemented method of claim 1 , further comprising committing the write transaction to the database and persisting each of the one or more write commands to the key value store.

4. The computer-implemented method of claim 3 , wherein performing the targeted sweep of the database comprises:

checking a commit timestamp of a write transaction associated with the write command of the entry; and

if the write transaction is not committed:

aborting the write transaction,

deleting the write command from the key value store,

popping the entry from the targeted sweep queue, and

selecting a next entry from the targeted sweep queue.

5. The computer-implemented method of claim 3 , wherein performing the targeted sweep of the database comprises:

checking a commit timestamp of a write transaction associated with the write command of the entry; and

if the commit timestamp is greater than or equal to the current sweep timestamp, pausing the targeted sweep.

6. The computer-implemented method of claim 3 , wherein performing the targeted sweep of the database comprises:

checking a commit timestamp of a write transaction associated with the write command of the entry; and

if the commit timestamp is less than the current sweep timestamp, using the single ranged tombstone to delete the prior versions of the cell.

7. The computer-implemented method of claim 1 , wherein the pre-defined targeted sweep strategy comprises a conservative strategy and performing the targeted sweep of the database having the conservative strategy comprises:

writing a deletion sentinel; and

using the single ranged tombstone to delete the prior versions of the cell without deleting the deletion sentinel or the write command.

8. The computer-implemented method of claim 1 , wherein the pre-defined targeted sweep strategy comprises a thorough strategy and performing the targeted sweep of the database having the thorough strategy comprises:

if the write command of the entry is a tombstone:

using the single ranged tombstone to delete the prior versions of the cell including any existing deletion sentinel and the write command.

9. The computer-implemented method of claim 1 , wherein the pre-defined targeted sweep strategy comprises a thorough strategy and performing the targeted sweep of the database having the thorough strategy comprises:

if the write command of the entry is not a tombstone:

using the single ranged tombstone to delete the prior versions of the cell including any existing deletion sentinel without deleting the write command.

10. The computer-implemented method of claim 1 , wherein performing the targeted sweep of the database further comprises:

when the current sweep timestamp is greater than a start timestamp of the entry, using the single ranged tombstone to delete the prior versions of the cell.

11. The computer-implemented method of claim 1 , wherein performing the targeted sweep of the database further comprises:

when the current sweep timestamp is less than or equal to a start timestamp of the entry, pausing the targeted sweep.

12. The computer-implemented method of claim 1 , wherein selecting the entry from the targeted sweep queue comprises:

selecting a stored sweep progress timestamp;

identifying a batch of entries from the targeted sweep queue having a first start timestamp greater than the stored sweep progress timestamp and a second start time less than the current sweep timestamp;

partitioning entries from the identified batch of entries based on a cell to which a write command of each entry relates; and

for each partition:

determining an entry having a greatest start timestamp of write transactions to the cell, and

determining the single ranged tombstone based on the greatest start timestamp.

13. The computer-implemented method of claim 12 , further comprising, after performing the targeted sweep of the database, updating the stored sweep progress timestamp.

14. The computer-implemented method of claim 1 , wherein the current sweep timestamp is lesser of: a start timestamp of a longest running write transaction and an earliest readable time.

15. The computer-implemented method of claim 1 , wherein the fine partition timestamp comprises an integer division of the start timestamp by a first pre-determined value.

16. The computer-implemented method of claim 1 , wherein the coarse partition timestamp comprises an integer division of the start timestamp by a second pre-determined value, the second pre-determined value greater than the first pre-determined value.

17. The computer-implemented method of claim 1 , comprising, for each write command, determining a shared number from a hash identifying the cell.

18. The computer-implemented method of claim 1 , wherein the fine partition timestamp is indexed by the one or more parameters and by a coarse partition timestamp derived from the start timestamp of the write transaction, and wherein the metadata is indexed by the one or more parameters and by the fine partition timestamp.

19. 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 an entry for each of one or more write commands of a write transaction to an end of a targeted sweep queue in a database having a key value store,

the entry for each of the one or more write commands comprising metadata including: data identifying a cell to which the one or more write commands relate, a start timestamp of the write transaction, and information identifying a type of the write transaction, wherein writing the entry for each of the one or more write commands to the end of the targeted sweep queue comprises:

partitioning a list of entries dependent on one or more parameters of a pre-defined targeted sweep strategy;

storing, as sweepable timestamp data of the targeted sweep queue, a fine partition timestamp derived from the start timestamp of the write transaction; and

storing, as sweepable cell data of the targeted sweep queue, for each entry within the partition, the metadata for each entry; and

performing the targeted sweep of the database by:

starting from a start of the targeted sweep queue,

selecting an entry from the targeted sweep queue based on a current sweep timestamp, and

using a single ranged tombstone to delete prior versions of a cell to which a write command of the entry relates.

20. 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 perform a method comprising:

writing an entry for each of one or more write commands of a write transaction to an end of a targeted sweep queue in a database having a key value store,

the entry for each of the one or more write commands comprising metadata including: data identifying a cell to which the one or more write commands relate, a start timestamp of the write transaction, and information identifying a type of the write transaction, wherein writing the entry for each of the one or more write commands to the end of the targeted sweep queue comprises:

partitioning a list of entries dependent on one or more parameters of a pre-defined targeted sweep strategy;

storing, as sweepable timestamp data of the targeted sweep queue, a fine partition timestamp derived from the start timestamp of the write transaction; and

storing, as sweepable cell data of the targeted sweep queue, for each entry within the partition, the metadata for each entry; and

performing the targeted sweep of the database by:

starting from a start of the targeted sweep queue,

selecting an entry from the targeted sweep queue based on a current sweep timestamp, and

using a single ranged tombstone to delete prior versions of a cell to which a write command of the entry relates.

Assignments (2)
SECURITY INTEREST Recorded Jul 3, 2022
From: PALANTIR TECHNOLOGIES INC.
To: WELLS FARGO BANK, N.A.
Reel/Frame 060572/0506 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 22, 2019
From: MARETIC, GRGUR PETRIC; BAKER, JAMES; ZIEBART, NATHAN; WASSENHOVE, SANDOR VAN
To: PALANTIR TECHNOLOGIES INC.
Reel/Frame 048679/0782 →
Continuity (1)
Provisional Application 62748133 · Oct 19, 2018
Cited By (2)
US 12,373,440 US 12,554,692