# US 10,503,699 B2 · Metadata synchronization in a distrubuted database

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

- Number: US 10,503,699 B2
- Document ID: US10503699B2
- Status: Granted
- Kind: B2
- Application number: 15/137,648
- Filed: 2016-04-25
- Published: 2017-10-26
- Granted: 2019-12-10
- Earliest claimed: 2016-04-25
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Gaurav Kumar Gupta; Souvik Pal; Amit Pathak; Jay Sudrik
- Web page: https://patentgrep.com/patent/US10503699B2

## CPC

- G06F 16/178: Techniques for file synchronisation in file systems
- G06F 16/182: Distributed file systems
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed herein are system, method, and computer program product embodiments for synchronizing an unsynchronized distributed database system. An embodiment operates by locking, by a second node, partitions in the second node based on first information received from, a first node responsive to execution of partition utility based on a first query received by the first node. Blocking, by the second node, a second query to a data portion of the partitions in the second node based on the first information. Locking, by the second node, second node object metadata based on second information received from the first node. Receiving, by the second node, changes to first node object metadata and applying the changes to the second node object metadata. Unlocking, by the second node, the partitions in the second node and the second node object metadata while unblocking the second query.

## Claims

### Claim 1

A computer implemented method, comprising:
locking, by a second node, a partition in the second node responsive to a partition utility command executed by a utility node and affecting the partition handled by the utility node, and responsive to a query received at the second node, wherein the utility node and the second node are part of a cluster;
blocking, by the second node, the query to a data portion of the partition in the second node responsive to the partition utility command;
locking, by the second node, object metadata from the second node based on a cluster-wide lock issued responsive to the partition utility command;
receiving, by the second node, changes to object metadata of the utility node and applying the changes to the object metadata of the second node; and
unlocking, by the second node, the partition and the object metadata of the second node and unblocking the query, once the changes to the object metadata of the utility node are applied to the object metadata of the second node,
wherein at least one of the locking the partition, blocking the query, locking the object metadata from the second node, receiving the changes, and unlocking the partition are performed by one or more processors.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
locking partitions in the utility node responsive to execution of the partition utility command.

### Claim 3 (depends on 1)

The method of claim 1, wherein the partition utility command comprises a merge partition, a drop partition, a move partition, a split partition, or a truncate partition.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
flushing data to persistent storage at the utility node and writing information pertaining to the partition utility command to a log file responsive to execution of the partition utility command.

### Claim 5 (depends on 1)

The method of claim 1, wherein the cluster-wide lock comprises object creation synchronization, wherein the object creation synchronization disallows creation of the second node object metadata.

### Claim 6 (depends on 1)

The method of claim 1, wherein the cluster-wide lock comprises object access synchronization, wherein the object access synchronization comprises instructions to lock in-memory structures containing the second node object metadata.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
receiving, by the second node, a flush instruction on the object metadata based on a subsequent task to the partition utility command being executed by the utility node.

### Claim 8

A system, comprising:
a memory; and
at least one processor coupled to the memory and configured to:
lock, by a second node, a partition in the second node responsive to a partition utility command executed by a utility node and affecting the partition handled by the utility node, and responsive to a query received at the second node, wherein the utility node and the second node are part of a cluster;
block, by the second node, the query to a data portion of the partition in the second node responsive to the partition utility command;
lock, by the second node, object metadata of the second node based on a cluster-wide lock issued responsive to the partition utility command;
receive, by the second node, changes to object metadata of the utility node and applying the changes to the object metadata of the second node; and
unlock, by the second node, the partition and the object metadata of the second node and unblock the query, once the changes to the object metadata of the utility node are applied to the object metadata of the second node.

### Claim 9 (depends on 7)

The system of claim 7, wherein the at least one processor is further configured to:
lock partitions in the utility node responsive to execution of the partition utility command.

### Claim 10 (depends on 8)

The system of claim 8, wherein the partition utility command comprises a merge partition, a drop partition, a move partition, a split partition, or a truncate partition.

### Claim 11 (depends on 8)

The system of claim 8, wherein the at least one processor is further configured to:
flush data to persistent storage at the utility node and write information pertaining to the partition utility to a log file responsive to execution of the partition utility command.

### Claim 12 (depends on 8)

The system of claim 8, wherein the cluster-wide lock comprises object creation synchronization, wherein the object creation synchronization disallows creation of the second node object metadata.

### Claim 13 (depends on 8)

The system of claim 8, wherein the cluster-wide lock comprises object access synchronization, wherein the object access synchronization comprises instructions to lock in-memory structures containing the second node object metadata.

### Claim 14

A non-transitory computer-readable device having instructions stored thereon that, when executed by at least one computing device, causes the at least one computing device to perform operations comprising:
locking, by a second node, a partition in the second node responsive to a partition utility command executed by a utility node and affecting the partition handled by the utility node and responsive to a query received at the second node, wherein the utility node and the second node are part of a cluster;
blocking, by the second node, the query to a data portion of the partition in the second node responsive to the partition utility command;
locking, by the second node, object metadata of the second node based on a cluster-wide lock issued responsive to the partition utility command;
receiving, by the second node, changes to object metadata of the utility node and applying the changes to the object metadata of the second node; and
unlocking, by the second node, the partition and the object metadata of the second node and unblocking the query, once the changes to the object metadata of the utility node are applied to the object metadata of the second node.

### Claim 15 (depends on 14)

The computer-readable device of claim 14, the operations further comprising:
locking partitions in the utility node responsive to execution of the partition utility command.

### Claim 16 (depends on 15)

The computer-readable device of claim 15, wherein the execution of the partition utility command further comprises:
writing lock context information regarding the execution of the partition utility command in a log file on the utility node;
executing failover recovery on the second node in response to a failure of the execution of the partition utility command on the utility node; and
reading the lock context information from the log file and locking the partition based on the lock context information during the failover recovery.

### Claim 17 (depends on 14)

The computer-readable device of claim 14, the operations further comprising:
flushing data to persistent storage at the utility node and writing information pertaining to the partition utility to a log file responsive to execution of the partition utility.

### Claim 18 (depends on 14)

The computer-readable device of claim 14, wherein the cluster-wide lock comprises object creation synchronization, wherein the object creation synchronization disallows creation of the second node object metadata.

### Claim 19 (depends on 14)

The computer-readable device of claim 14, wherein the cluster-wide lock comprises object access synchronization, wherein the object access synchronization comprises instructions to lock in-memory structures containing object metadata on the second node.

### Claim 20 (depends on 14)

The computer-readable device of claim 14, wherein the locking the object metadata of the second node further comprises skipping flushing on the second node.

### Claim 21 (depends on 14)

The computer-readable device of claim 14, wherein the changes to the object metadata of the utility node are a result of the execution of the partition utility command to the partition handled by the utility node.
