# US 10,481,986 B2 · Automatic adoption of parallelized database garbage collection

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

- Number: US 10,481,986 B2
- Document ID: US10481986B2
- Status: Granted
- Kind: B2
- Application number: 15/647,045
- Filed: 2017-07-11
- Published: 2019-01-17
- Granted: 2019-11-19
- Earliest claimed: 2017-07-11
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Dirk Thomsen; Christoph Roterring; Thorsten Glebe
- Web page: https://patentgrep.com/patent/US10481986B2

## CPC

- G06F 11/1474: in transactions (updating of structured data in databases G06F16/23)
- G06F 11/1448: {Management of the data involved in backup or backup restore}
- G06F 11/1471: involving logging of persistent data for recovery
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 11/2094: {Redundant storage or storage space (G06F11/2056 takes precedence)}
- G06F 11/2097: {maintaining the standby controller/processing unit updated (initialisation or re-synchronisation thereof G06F11/1658 and subgroups)}
- G06F 2201/80: Database-specific techniques
- G06F 2201/805: Real-time
- G06F 2201/81: Threshold
- G06F 2201/82: Solving problems relating to consistency
- G06F 2212/1032: Reliability improvement, data loss prevention, degraded operation etc
- G06F 2212/1044: Space efficiency improvement
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Recovery of a database system by taking the database system offline is initiated. Thereafter, recovery operations specified by a redo log of the database system are replayed. A cleanup log is generated that identifies cleanup operations occurring during the replay of the recovery operations for garbage collection. Concurrent with the startup of the database, garbage collection of the cleanup operations as specified in the database savepoint is initiated. In addition, concurrent with the replay of the recovery operations, garbage collection of the cleanup operations specified by the cleanup log is initiated. The amount of parallelization of the garbage collection can be varied based on utilized processor resources. The database system is later brought online after all of the recovery operations are replayed.

## Claims

### Claim 1

A computer-implemented method comprising:
initiating recovery of a database system by taking the database system offline;
replaying recovery operations specified by a redo log of the database system;
generating a cleanup log identifying cleanup operations occurring during the replay of the recovery operations requiring garbage collection;
initiating, concurrent with at least one of the startup of the database or the replay of the recovery operations, garbage collection of the cleanup operations as specified in a last database savepoint or by the cleanup log, the garbage collection being implemented by a plurality of garbage collection threads;
monitoring processor usage of the database system in connection with and during the garbage collection;
adding, during the garbage collection, more garbage collector threads if the monitored processor usage is below a first pre-defined threshold;
decreasing, during the garbage collection, a current number of garbage collector threads if the monitored processor usage is above a second threshold; and
bringing the database system online after all of the recovery operations are replayed;
wherein:
the replay operations are executed by recovery threads and the cleanup operations are executed by garbage collection threads; and
the database system comprises a plurality of programmable processor cores and the threads are striped such that each core executes a maximum of one recovery thread and one garbage collection thread.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1 further comprising:
maintaining the current number of garbage collector threads if an amount of garbage for collection is below a pre-defined amount.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, further comprising:
maintaining the current number of garbage collector threads if an amount of garbage for collection is not increasing.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the cleanup log is passed to a history manager after it is generated and the history manager subsequently initiates the garbage collection of the cleanup operations specified by the cleanup log.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the garbage collection of the cleanup operations continues subsequent to the database system being brought online.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein at least one core prioritizes execution of the corresponding recovery thread over the corresponding garbage collection thread.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the database system comprises an in-memory database storing data in main memory.

### Claim 8

A system comprising:
at least one data processor; and
memory storing instructions, which when executed by the at least one data processor, result in operations comprising:
initiating recovery of a database system by taking the database system offline;
replaying recovery operations specified by a redo log of the database system;
generating a cleanup log identifying cleanup operations occurring during the replay of the recovery operations requiring garbage collection;
initiating, concurrent with at least one of the startup of the database or the replay of the recovery operations, garbage collection of the cleanup operations as specified in a last database savepoint or by the cleanup log, the garbage collection being implemented by a plurality of garbage collection threads;
monitoring, during garbage collection, processor usage of the database system in connection with the garbage collection;
adding, during garbage collection, more garbage collector threads if the monitored processor usage is below a first pre-defined threshold;
decreasing, during garbage collection, a current number of garbage collector threads if the monitored processor usage is above a second threshold; and
bringing the database system online after all of the recovery operations are replayed;
wherein:
the replay operations are executed by recovery threads and the cleanup operations are executed by garbage collection threads; and
the database system comprises a plurality of programmable processor cores and the threads are striped such that each core executes a maximum of one recovery thread and one garbage collection thread.

### Claim 9 (depends on 8)

The system of claim 8, wherein the operations further comprise:
maintaining the current number of garbage collector threads if an amount of garbage for collection is below a pre-defined amount.

### Claim 10 (depends on 8)

The system of claim 8, wherein the operations further comprise:
maintaining the current number of garbage collector threads if an amount of garbage for collection is not increasing.

### Claim 11 (depends on 8)

The system of claim 8, wherein the cleanup log is passed to a history manager after it is generated and the history manager subsequently initiates the garbage collection of the cleanup operations specified by the cleanup log.

### Claim 12 (depends on 8)

The system of claim 8, wherein the garbage collection of the cleanup operations continues subsequent to the database system being brought online.

### Claim 13 (depends on 8)

The system of claim 8, wherein at least one core prioritizes execution of the corresponding recovery thread over the corresponding garbage collection thread.

### Claim 14 (depends on 8)

The system of claim 8 further comprising the database system, wherein the database system comprises an in-memory database storing data in main memory.

### Claim 15

A non-transitory computer program product storing instructions, which when executed by at least one data processor, result in operations comprising:
initiating recovery of a database system by taking the database system offline;
replaying recovery operations specified by a redo log of the database system;
generating a cleanup log identifying cleanup operations occurring during the replay of the recovery operations requiring garbage collection;
initiating, concurrent with at least one of the startup of the database or the replay of the recovery operations, garbage collection of the cleanup operations as specified in a last database savepoint or by the cleanup log, the garbage collection being implemented by a plurality of garbage collection threads;
monitoring, during garbage collection, processor usage of the database system in connection with the garbage collection;
adding, during garbage collection, more garbage collector threads if the monitored processor usage is below a first pre-defined threshold;
decreasing, during garbage collection, a current number of garbage collector threads if the monitored processor usage is above a second threshold; and
bringing the database system online after all of the recovery operations are replayed,
wherein:
the replay operations are executed by recovery threads and the cleanup operations are executed by garbage collection threads; and
the database system comprises a plurality of programmable processor cores and the threads are striped such that each core executes a maximum of one recovery thread and one garbage collection thread.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the operations further comprise:
maintaining the current number of garbage collector threads if an amount of garbage for collection is below a pre-defined amount.

### Claim 17 (depends on 15)

The computer program product of claim 15, wherein the operations further comprise:
maintaining the current number of garbage collector threads if an amount of garbage for collection is not increasing.

### Claim 18 (depends on 15)

The computer program product of claim 15, wherein the cleanup log is passed to a history manager after it is generated and the history manager subsequently initiates the garbage collection of the cleanup operations specified by the cleanup log.

### Claim 19 (depends on 15)

The computer program product of claim 15, wherein the garbage collection of the cleanup operations continues subsequent to the database system being brought online.

### Claim 20 (depends on 15)

The computer program product of claim 15, wherein at least one core prioritizes execution of the corresponding recovery thread over the corresponding garbage collection thread.
