# US 2022/0027242 A1 · Methods, systems, and media for controlling append-only file rewrites

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

- Number: US 2022/0027242 A1
- Document ID: US20220027242A1
- Status: Published application
- Kind: A1
- Application number: 17/493,366
- Filed: 2021-10-04
- Published: 2022-01-27
- Earliest claimed: 2017-06-30
- Assignees: Redis Ltd.
- Applicants: Redis Ltd.
- Inventors: Yiftach Shoolman; Yoav Steinberg; Yossi Gottlieb; Oran Agra
- Web page: https://patentgrep.com/patent/US20220027242A1

## CPC

- G06F 11/1469: {Backup restoration techniques}
- G06F 11/3419: {by assessing time}
- G06F 11/1461: {Backup scheduling policy}
- G06F 11/3034: {where the computing system component is a storage system, e.g. DASD based or network based (digital input from or digital output to record carriers G06F3/06; digital recording or reproducing G11B20/18; 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], H04L67/1097)}
- G06F 11/3409: {for performance assessment}
- G06F 16/1805: {Append-only file systems, e.g. using logs or journals to store data}
- G06F 2201/80: Database-specific techniques
- G06F 2201/81: Threshold
- G06F 2201/84: Using snapshots, i.e. a logical point-in-time copy of the data
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, and media for controlling append-only file rewrites are provided. In accordance with some embodiments, the methods comprising: determining a utilization of a shard of a database; determining whether the utilization exceeds a persistent storage utilization threshold; determining a recovery time to recover the shard from an append-only file; determining whether the recovery time exceeds a recovery time threshold; and when the utilization is determined to exceed the utilization threshold or when the recovery time is determined to exceed the recovery time threshold, causing an append-only-file rewrite to be performed.

## Claims

### Claim 1

A method for controlling append-only-file (AOF) rewrites, comprising:
prior to an AOF rewrite being performed, determining a recovery time that is an estimate of a time to recover a shard from an AOF when performing the AOF rewrite by at least adding write times for each of a plurality of write operations to the shard;
determining whether the recovery time exceeds a recovery time threshold; and
when the recovery time is determined to exceed the recovery time threshold, causing the AOF rewrite to be performed.

### Claim 2 (depends on 1)

The method of claim 1, wherein the recovery time threshold is based on a maximum downtime specified in a service level agreement.

### Claim 3 (depends on 1)

The method of claim 1, wherein determining the recovery time includes:
determining an initial estimated loading time of a snapshot part of the AOF;
for each write operation of a plurality of write operations to the AOF, determining an amount of time required to complete the write operation; and
summing the determined amounts of time for the plurality of write operations with the initial estimate loading time.

### Claim 4 (depends on 3)

The method of claim 3, wherein the initial estimated loading time is based on a number of keys in the shard.

### Claim 5 (depends on 3)

The method of claim 3, wherein determining the amount of time required to complete the write operation includes measuring an execution time of a write operation to the AOF.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
determining a current total persistent storage utilization;
determining whether the current total persistent storage utilization exceeds a total persistent storage utilization threshold; and
when the current total persistent storage utilization exceeds the total persistent storage utilization threshold, causing an AOF rewrite to be performed.

### Claim 7

A system for controlling append-only-file (AOF) rewrites, comprising:
determine whether the AOF utilization exceeds an AOF utilization threshold;
prior to an AOF rewrite being performed, determine a recovery time that is an estimate of a time to recover a shard from an AOF when performing the AOF rewrite by at least adding write times for each of a plurality of write operations to the shard;
determine whether the recovery time exceeds a recovery time threshold; and
when the recovery time is determined to exceed the recovery time threshold, cause the AOF rewrite to be performed.

### Claim 8 (depends on 7)

The system of claim 7, wherein the recovery time threshold is based on a maximum downtime specified in a service level agreement.

### Claim 9 (depends on 7)

The system of claim 7, wherein the at least one hardware processor determines the recovery time by at least:
determining an initial estimated loading time of a snapshot part of the AOF;
for each write operation of a plurality of write operations to the AOF, determining an amount of time required to complete the write operation; and
summing the determined amounts of time for the plurality of write operations with the initial estimated loading time.

### Claim 10 (depends on 9)

The system of claim 9, wherein the initial estimated loading time is based on a number of keys in the shard.

### Claim 11 (depends on 9)

The system of claim 9, wherein determining the amount of time required to complete the write operation includes measuring an execution time of a write operation to the AOF.

### Claim 12 (depends on 7)

The system of claim 7, wherein the at least one hardware processor is also configured to:
determine a current total persistent storage utilization;
determine whether the current total persistent storage utilization exceeds a total persistent storage utilization threshold; and
when the current total persistent storage utilization exceeds the total persistent storage utilization threshold, cause an AOF rewrite to be performed.

### Claim 13

A non-transitory computer-readable medium containing computer executable instructions that, when executed by a processor, cause the processor to perform a method for controlling append-only-file (AOF) rewrites, the method comprising:
prior to an AOF rewrite being performed, determining a recovery time that is an estimate of a time to recover a shard from an AOF when performing the AOF rewrite by at least adding write times for each of a plurality of write operations to the shard;
determining whether the recovery time exceeds a recovery time threshold; and
when the recovery time is determined to exceed the recovery time threshold, causing the AOF rewrite to be performed.

### Claim 14 (depends on 13)

The non-transitory computer-readable medium of claim 13, wherein the recovery time threshold is based on a maximum downtime specified in a service level agreement.

### Claim 15 (depends on 13)

The non-transitory computer-readable medium of claim 13, wherein determining the recovery time includes:
determining an initial estimated loading time of a snapshot part of the AOF;
for each write operation of a plurality of write operations to the AOF, determining an amount of time required to complete the write operation; and
summing the determined amounts of time for the plurality of write operations with the initial estimated loading time.

### Claim 16 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the initial estimated loading time is based on a number of keys in the shard.

### Claim 17 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein determining the amount of time required to complete the write operation includes measuring an execution time of a write operation to the AOF.

### Claim 18 (depends on 13)

The non-transitory computer-readable medium of claim 13, wherein the method further comprises:
determining a current total persistent storage utilization;
determining whether the current total persistent storage utilization exceeds a total persistent storage utilization threshold; and
when the current total persistent storage utilization exceeds the total persistent storage utilization threshold, causing an AOF rewrite to be performed.
