KR101786874B1 - Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log - Google Patents
Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log Download PDFInfo
- Publication number
- KR101786874B1 KR101786874B1 KR1020170026292A KR20170026292A KR101786874B1 KR 101786874 B1 KR101786874 B1 KR 101786874B1 KR 1020170026292 A KR1020170026292 A KR 1020170026292A KR 20170026292 A KR20170026292 A KR 20170026292A KR 101786874 B1 KR101786874 B1 KR 101786874B1
- Authority
- KR
- South Korea
- Prior art keywords
- master
- slave
- data
- replication
- log
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1471—Saving, restoring, recovering or retrying involving logging of persistent data for recovery
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
- G06F11/2053—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
- G06F11/2056—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant by mirroring
- G06F11/2071—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant by mirroring using a plurality of controllers
- G06F11/2076—Synchronous techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
- G06F16/184—Distributed file systems implemented as replicated file system
- G06F16/1844—Management specifically adapted to replicated file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G06F17/30215—
-
- G06F17/30575—
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Retry When Errors Occur (AREA)
Abstract
데이터의 일관성을 보장하는 상태기기 기반의 복제 및 체크포인트데이터와 복제로그를 이용한 분산 복구를 처리하는 데이터 복제 방법 및 데이터 저장 시스템이 개시된다. 데이터 복제 방법은, 저장된 데이터의 상태 집합을 의미하는 메모리저장소의 상태의 전이가, 메모리저장소에 대해 제공되는 연산의 수행에 의해 확정적으로 일어나며, 연산의 수행 결과도 동일하다는 특징을 이용하여, 두 메모리저장소에서 수행되는 연산을 선입선출 순서 방식으로 수행함으로써, 두 메모리저장소간의 일관성을 보장하는 복제를 수행할 수 있다.Disclosed is a data replication method and data storage system for processing distributed and recovery based on state machine-based replication and checkpoint data and replication log, which ensures data consistency. The data replication method is characterized in that the transition of the state of the memory storage means the state set of the stored data is determined by the execution of the operation provided for the memory storage and the result of the operation is the same, By performing the operations performed in the store in a first-in-first-out order manner, replication can be performed to ensure consistency between the two memory stores.
Description
본 발명의 실시예들은 데이터의 일관성을 보장하는 상태기기 기반의 복제 및 체크포인트데이터와 복제로그를 이용한 분산 복구를 처리하는 데이터 복제 방법 및 데이터 저장 시스템에 관한 것이다.Embodiments of the present invention relate to state machine-based replication and checkpoint data to ensure data consistency, and data replication methods and data storage systems that handle distributed recovery using replication logs.
네트워크를 통해 연결된 장치들에서 데이터의 분산된 저장소는 비용 효율이 높고, 많은 양의 데이터에 대한 신뢰성 있는 저장소로 이용되고 있다. 이러한 분산된 데이터 저장 시스템에서, 일시적 또는 영구적 데이터 손실에 대한 데이터 가용성과 같은 데이터 일관성(consistency)을 보장하기 위해, 분산된 데이터 저장 시스템에서 동일한 데이터 항목을 네트워크를 통해 연결된 다수의 기기에 복사하는 방법이 개발되었다. 이와 같이, 다수의 기기를 통해 동일한 데이터를 복사하여 저장하는 것을 데이터 복제라 한다. 이러한 데이터 복제는 기기의 고장, 장애 또는 일시적/영구적 데이터 손실의 위험에 대비하기 위해 이용될 수 있다.Distributed storage of data on devices connected through a network is cost-effective and is being used as a reliable repository for large amounts of data. In such a distributed data storage system, in order to ensure data consistency such as data availability for temporary or permanent data loss, a method of copying the same data item to a plurality of devices connected via a network in a distributed data storage system Was developed. In this way, copying and storing the same data through a plurality of devices is referred to as data replication. Such data replication can be used to counter the failure of a device, a failure, or the risk of temporary / permanent data loss.
이러한 데이터 복제는 비동기 방식 또는 동기 방식으로 이루어질 수 있다.Such data replication can be done asynchronously or synchronously.
비동기 방식의 데이터 복제는, 동기 방식의 데이터 복제에 비해 복제를 위해 필요한 비용이 낮은 반면, 데이터 가용성이 떨어진다. 예를 들어, 클라이언트가 제1 기기에 저장된 데이터를 변경하는 경우, 제1 기기의 데이터를 복제하는 제2 기기에 변경된 데이터가 바로 반영되지 않기 때문에, 제1 기기에 장애가 발생하는 경우, 변경된 데이터가 영구적으로 손실될 위험성이 존재한다.Asynchronous data replication is less costly for replication than synchronous data replication, while data availability is lower. For example, when the client changes the data stored in the first device, the changed data is not immediately reflected in the second device that replicates the data of the first device. Therefore, when a failure occurs in the first device, There is a risk of being permanently lost.
반면, 동기 방식의 데이터 복제는, 비동기 방식의 데이터 복제에 비해 가용성은 높으나, 데이터가 변경될 때마다 디스크와 같은 매체에 데이터 복제가 발생된다는 점에서 복제 흐름상의 시간 지연이 발생되는 등 복제를 위해 필요한 비용이 비동기 방식의 데이터 복제에 비해 높다.Synchronous data replication, on the other hand, is highly available compared to asynchronous data replication. However, since data replication occurs on a disk-like medium whenever data is changed, The cost is higher than the asynchronous data replication.
저장된 데이터의 상태 집합을 의미하는 메모리저장소의 상태의 전이가, 메모리저장소에 대해 제공되는 연산의 수행에 의해 확정적으로 일어나며, 연산의 수행 결과도 동일하다는 특징을 이용하여, 두 메모리저장소에서 수행되는 연산을 선입선출 순서 방식으로 수행함으로써, 두 메모리저장소간의 일관성을 보장하는 복제를 수행할 수 있는 데이터 복제 방법 및 데이터 저장 시스템을 제공한다.The transition of the state of the memory storage means the state set of the stored data is determined by the execution of the operation provided for the memory storage and the result of the operation is the same, In a first-in-first-out order manner, thereby providing a data replication method and a data storage system capable of performing replication that ensures consistency between two memory stores.
메모리 사상파일 형태로 복제로그에 대한 읽기 및/또는 쓰기를 수행하고, 디스크로의 플러시(flush)를 주기적으로 및/또는 복제로그에 쓰여진 데이터의 크기에 기반하여 수행함으로써, 복제 흐름에 대한 시간 지연을 최소화할 수 있는 데이터 복제 방법 및 데이터 저장 시스템을 제공한다.By performing a read and / or write to the replication log in the form of a memory mapping file and performing a flush to disk periodically and / or based on the size of the data written to the replication log, A data replication method and a data storage system capable of minimizing the number
기설정된 복제 팩터의 값에 기반하여 복제 팩터의 값 이상의 저장부들로부터 동일한 로그 시퀀스 넘버(Log Sequence Number, LSN)가 수신되는 경우에, 해당 LSN을 커밋 LSN으로 결정하고, 결정된 커밋 LSN까지 메모리저장소에 대한 연산이 순차적으로 수행되도록 하여, 가용성을 복제 팩터만큼 유지함으로써 유실된 데이터를 복구할 수 있는 데이터 복제 방법 및 데이터 저장 시스템을 제공한다.When the same log sequence number (LSN) is received from storage units whose values are equal to or greater than the value of the replication factor based on the value of the predetermined replication factor, the corresponding LSN is determined as the commit LSN, A data replication method and a data storage system capable of recovering lost data by maintaining availability as a replication factor.
메모리저장소의 상태 및 메모리저장소에 대해 수행된 연산의 마지막 위치에 해당하는 LSN을 포함하는 체크포인트데이터를 이용하여 메모리저장소의 재 시작 복구를 처리할 수 있는 데이터 복제 방법 및 데이터 저장 시스템을 제공한다.There is provided a data replication method and a data storage system capable of processing a restart of a memory storage using checkpoint data including an LSN corresponding to a state of a memory storage and an end position of an operation performed on the memory storage.
복수의 저장부를 포함하는 데이터 저장 시스템의 데이터 복제 방법에 있어서, 상기 복수의 저장부 중 마스터 저장부에서, 상기 마스터 저장부가 포함하는 마스터 메모리저장소 및 상기 복수의 저장부 중 나머지 저장부인 슬레이브 저장부가 포함하는 슬레이브 메모리저장소 중 적어도 하나에 대해 요청된 연산을 수신하는 단계, 상기 마스터 저장부에서, 상기 수신된 연산을 상기 마스터 저장부가 포함하는 마스터 복제로그에 저장하고, 수행되어야 할 연산의 상기 마스터 복제로그에서의 위치에 대한 정보를 상기 마스터 복제로그에 더 저장하고, 상기 마스터 복제로그를 상기 슬레이브 저장부가 포함하는 슬레이브 복제로그로 전달하는 단계 및 상기 마스터 저장부 및 상기 슬레이브 저장부에서, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 마스터 복제로그 및 상기 슬레이브 복제로그에 저장된 동일한 연산을 상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소에 대해 수행하는 단계를 포함하는 데이터 복제 방법이 제공된다.A method for data replication in a data storage system including a plurality of storage units, the method comprising the steps of: in a master storage unit of the plurality of storage units, a master memory storage included in the master storage unit and a slave storage unit being a remaining storage unit of the plurality of storage units Receiving a requested operation for at least one of slave memory repositories in the master storage unit; storing, in the master storage unit, the received operation in a master replication log contained in the master storage unit; Storing the master replication log in the master replication log and transferring the master replication log to a slave replication log included in the slave storage unit; Based on information about the location of the operation The data replication method comprising the step of performing the same operation for the stored in the replication log and the slave replication log to said master memory and the slave memory store storage is provided.
마스터 저장 기기의 데이터 복제 방법에 있어서, 상기 마스터 저장 기기에서, 상기 마스터 저장 기기가 포함하는 마스터 메모리저장소 및 슬레이브 저장 기기가 포함하는 슬레이브 메모리저장소 중 적어도 하나에 대해 요청된 연산을 수신하는 단계; 상기 마스터 저장 기기에서, 상기 수신된 연산을 상기 마스터 저장 기기가 포함하는 마스터 복제로그에 저장하고, 수행되어야 할 연산의 상기 마스터 복제로그에서의 위치에 대한 정보를 상기 마스터 복제로그에 더 저장하고, 상기 마스터 복제로그를 상기 슬레이브 저장 기기로 전달하는 단계; 및 상기 마스터 저장 기기에서, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 마스터 복제로그에 저장된 연산을 상기 마스터 메모리저장소에 대해 수행하는 단계를 포함하고, 상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소는, 동일한 데이터 상태 집합을 갖고, 상기 저장된 연산에 따라 동일한 연산결과를 갖는 것을 특징으로 하는 데이터 복제 방법이 제공된다.A method for replicating data in a master storage device, the method comprising: receiving, at the master storage device, a requested operation for at least one of a master memory storage included in the master storage device and a slave memory storage included in the slave storage device; Storing the received operation in a master replication log included in the master storage device and further storing information on a location in the master replication log of an operation to be performed in the master replication log, Transferring the master replication log to the slave storage device; And performing, at the master storage device, an operation stored in the master replica log based on information about the location of the operation to be performed for the master memory store, wherein the master memory store and the slave memory store Has the same data state set and has the same operation result according to the stored operation.
슬레이브 저장 기기의 데이터 복제 방법에 있어서, 상기 슬레이브 저장 기기에서, 상기 슬레이브 저장 기기가 포함하는 슬레이브 메모리저장소에 대해 요청된 연산을 마스터 저장 기기로 전송하는 단계; 상기 슬레이브 저장 기기에서, 상기 연산 및 상기 마스터 저장 기기가 포함하는 마스터 메모리저장소에 대해 요청된 연산 중 적어도 하나, 그리고 수행되어야 할 연산의 상기 마스터 저장 기기가 포함하는 마스터 복제로그에서의 위치에 대한 정보를 포함하는 마스터 복제로그를 수신하는 단계; 및 상기 슬레이브 저장 기기에서, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 슬레이브 저장 기기의 슬레이브 복제로그에 저장된 연산을 상기 슬레이브 메모리저장소에 대해 수행하는 단계를 포함하고, 상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소는, 동일한 데이터 상태 집합을 갖고, 상기 저장된 연산에 따라 동일한 연산결과를 갖는 것을 특징으로 하는 데이터 복제 방법이 제공된다.A method for data replication of a slave storage device, the method comprising: transmitting, at the slave storage device, a requested operation to a slave memory storage included in the slave storage device to a master storage device; At the slave storage device, at least one of the operation and the operation requested for the master memory storage included in the master storage device, and information about the location in the master replication log included in the master storage device of the operation to be performed Receiving a master replication log including the master replication log; And performing, in the slave storage device, an operation stored in the slave replication log of the slave storage device for the slave memory storage based on information about the location of the operation to be performed, Wherein the slave memory repository has the same data state set and has the same operation result according to the stored operation.
데이터 저장 시스템에 있어서, 복수의 저장부를 포함하고, 상기 복수의 저장부 각각은, 리플리케이터 및 메모리저장소를 포함하고, 상기 복수의 저장부 중 마스터 저장부가 포함하는 마스터 리플리케이터는, 상기 복수의 저장부 각각이 포함하는 메모리저장소들에 대해 수행될 연산의 수행 순서를 선입선출(First In First Out, FIFO) 방식으로 결정하여 상기 마스터 저장부가 포함하는 마스터 복제로그에 저장하고, 수행되어야 할 연산의 상기 마스터 복제로그에서의 위치에 대한 정보를 상기 마스터 복제로그에 더 저장하고, 상기 복수의 저장부 중 슬레이브 저장부의 슬레이브 리플리케이터는, 상기 마스터 복제로그를 수신하여 상기 슬레이브 저장부가 포함하는 슬레이브 복제로그에 저장하고, 상기 마스터 리플리케이터 및 상기 슬레이브 리플리케이터는, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 마스터 복제로그 및 상기 슬레이브 복제로그에 저장된 동일한 연산을 상기 마스터 저장부가 포함하는 메모리저장소 및 상기 슬레이브 저장부가 포함하는 메모리저장소에 대해 수행하는 것을 특징으로 하는 데이터 저장 시스템이 제공된다.A data storage system, comprising: a plurality of storage units, each of the plurality of storage units including a replicator and a memory storage, wherein a master replicator of the plurality of storage units includes a plurality of storage units (FIFO) method, and stores the result in the master replica log included in the master storage unit. The master replica of the operation to be performed Wherein the slave replicator of the slave storage unit of the plurality of storage units receives the master replication log and stores the master replication log in the slave replication log included in the slave storage unit, Wherein the master replicator and the slave replicator comprise: Wherein the master storage unit and the slave storage unit execute the same operations stored in the master replication log and the slave replication log based on the information about the location of the operation to be performed, Is provided.
마스터 저장 기기에 있어서, 마스터 메모리저장소; 상기 마스터 메모리저장소 및 슬레이브 저장 기기가 포함하는 슬레이브 메모리저장소 중 적어도 하나에 대해 요청된 연산을 수신하는 마스터 리플리케이터; 및 클라이언트 라이브러리를 포함하고, 상기 마스터 리플리케이터는, 상기 수신된 연산을 마스터 복제로그에 저장하고, 수행되어야 할 연산의 위치에 대한 정보를 상기 마스터 복제로그에 더 저장하며, 상기 클라이언트 라이브러리는, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 마스터 복제로그에 저장된 연산을 상기 마스터 메모리저장소에 대해 수행하고, 상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소는, 동일한 데이터 상태 집합을 갖고, 상기 저장된 연산에 따라 동일한 연산결과를 갖는 것을 특징으로 하는 마스터 저장 기기가 제공된다.A master storage device comprising: a master memory storage; A master replicator for receiving a requested operation on at least one of the master memory store and the slave memory stores included in the slave storage device; And a client library, wherein the master replicator stores the received operation in a master replication log, and further stores information on a location of an operation to be performed in the master replication log, And wherein the master memory store and the slave memory store have the same set of data states, and wherein the stored operation is performed on the stored operation And thus have the same operation result.
슬레이브 저장 기기에 있어서, 슬레이브 메모리저장소; 상기 슬레이브 메모리저장소에 대해 요청된 연산을 마스터 저장 기기로 전송하는 클라이언트 라이브러리; 및 상기 마스터 저장 기기가 포함하는 마스터 복제로그를 수신하는 슬레이브 리플리케이터 - 상기 마스터 복제로그는, 상기 연산 및 상기 마스터 저장 기기가 포함하는 마스터 메모리저장소에 대해 요청된 연산 중 적어도 하나, 그리고 수행되어야 할 연산의 상기 마스터 복제로그에서의 위치에 대한 정보를 포함함. -;를 포함하고, 상기 클라이언트 라이브러리는, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 슬레이브 저장 기기가 포함하는 슬레이브 복제로그에 저장된 연산을 상기 슬레이브 메모리저장소에 대해 수행하고, 상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소는, 동일한 데이터 상태 집합을 갖고, 상기 저장된 연산에 따라 동일한 연산결과를 갖는 것을 특징으로 하는 슬레이브 저장 기기가 제공된다.A slave storage device comprising: a slave memory storage; A client library for transferring the requested operation to the slave memory repository to the master storage device; And a slave replicator for receiving a master replication log included in the master storage device, the master replication log comprising at least one of the operations and the operations requested for the master memory storage included in the master storage device, Includes information on the location in the master replica log of the master replica log. - the client library performs operations stored in the slave replication log included in the slave storage device on the slave memory storage based on information on the location of the operation to be performed, Wherein the storage and the slave memory storage have the same data state set and have the same operation result according to the stored operation.
저장된 데이터의 상태 집합을 의미하는 메모리저장소의 상태의 전이가, 메모리저장소에 대해 제공되는 연산의 수행에 의해 확정적으로 일어나며, 연산의 수행 결과도 동일하다는 특징을 이용하여, 두 메모리저장소에서 수행되는 연산을 선입선출 순서 방식으로 수행함으로써, 두 메모리저장소간의 일관성을 보장하는 복제를 수행할 수 있다.The transition of the state of the memory storage means the state set of the stored data is determined by the execution of the operation provided for the memory storage and the result of the operation is the same, In a first-in-first-out order manner, replication can be performed to ensure consistency between the two memory stores.
메모리 사상파일 형태로 복제로그에 대한 읽기 및/또는 쓰기를 수행하고, 디스크로의 플러시(flush)를 주기적으로 및/또는 복제로그에 쓰여진 데이터의 크기에 기반하여 수행함으로써, 복제 흐름에 대한 시간 지연을 최소화할 수 있다.By performing a read and / or write to the replication log in the form of a memory mapping file and performing a flush to disk periodically and / or based on the size of the data written to the replication log, Can be minimized.
기설정된 복제 팩터의 값에 기반하여 복제 팩터의 값 이상의 저장부들로부터 동일한 로그 시퀀스 넘버(Log Sequence Number, LSN)가 수신되는 경우에, 해당 LSN을 커밋 LSN으로 결정하고, 결정된 커밋 LSN까지 메모리저장소에 대한 연산이 순차적으로 수행되도록 하여, 가용성을 복제 팩터만큼 유지함으로써 유실된 데이터를 복구할 수 있다.When the same log sequence number (LSN) is received from storage units whose values are equal to or greater than the value of the replication factor based on the value of the predetermined replication factor, the corresponding LSN is determined as the commit LSN, So that the lost data can be recovered by maintaining the availability as much as the replication factor.
메모리저장소의 상태 및 메모리저장소에 대해 수행된 연산의 마지막 위치에 해당하는 LSN을 포함하는 체크포인트데이터를 이용하여 메모리저장소의 재 시작 복구를 처리할 수 있다.Restart recovery of the memory store can be handled using checkpoint data including the LSN corresponding to the state of the memory store and the last location of the operations performed on the memory store.
도 1은 본 발명의 일실시예에 있어서, 데이터 저장 시스템의 개괄적인 구성의 예를 설명하기 위한 블록도이다.
도 2는 본 발명의 일실시예에 있어서, 복제로그의 예를 도시한 도면이다.
도 3은 본 발명의 일실시예에 있어서, 복제 방식의 예를 도시한 도면이다.
도 4는 본 발명의 일실시예에 있어서, 복제로그를 전송하는 과정의 예를 도시한 도면이다.
도 5는 본 발명의 일실시예에 있어서, COMMIT LSN을 결정 및 전달하는 과정의 예를 도시한 도면이다.
도 6은 본 발명의 일실시예에 있어서, 리플리케이터의 재 시작 복구 및 메모리저장소의 재 시작 복구를 포함하는 리플리케이터의 상태 전이를 나타낸 도면이다.
도 7은 본 발명의 일실시예에 있어서, 마스터 저장 기기의 내부 구성을 설명하기 위한 블록도이다.
도 8은 본 발명의 일실시예에 있어서, 마스터 저장 기기의 데이터 복제 방법을 도시한 흐름도이다.
도 9는 본 발명의 일실시예에 있어서, 슬레이브 저장 기기의 내부 구성을 설명하기 위한 블록도이다.
도 10은 본 발명의 일실시예에 있어서, 슬레이브 저장 기기의 데이터 복제 방법을 도시한 흐름도이다.1 is a block diagram illustrating an example of a general configuration of a data storage system in an embodiment of the present invention.
2 is a diagram showing an example of a replication log in an embodiment of the present invention.
Fig. 3 is a diagram showing an example of a replication method in an embodiment of the present invention.
4 is a diagram illustrating an example of a process of transmitting a replication log in an embodiment of the present invention.
5 is a diagram illustrating an example of a process of determining and transmitting a COMMIT LSN in an embodiment of the present invention.
Figure 6 is a diagram illustrating state transitions of a replicator, including a restart of a replicator and a restart of a memory store, in an embodiment of the present invention.
7 is a block diagram illustrating an internal configuration of a master storage device according to an embodiment of the present invention.
8 is a flowchart illustrating a data replication method of a master storage device according to an embodiment of the present invention.
9 is a block diagram for explaining an internal configuration of a slave storage device according to an embodiment of the present invention.
10 is a flowchart illustrating a data replication method of a slave storage device according to an embodiment of the present invention.
이하, 본 발명의 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
본 발명의 실시예들은 데이터 저장 시스템에서 상태기기(state machine)로 정의되어 동작되는 메모리저장소간의 일관성을 보장하는 명령어의 선입선출 방식의 고성능 복제 방법과 체크포인트데이터와 복제로그를 이용한 분산 복구 방법에 관한 것이다.Embodiments of the present invention are directed to a high performance duplication method of first-in-first-out method of instruction to ensure consistency between memory stores operated as defined by a state machine in a data storage system and a distributed recovery method using checkpoint data and replication log .
상태기기는 컴퓨터 사이언스(computer science)에서 정의되는 계산 모델로서, 본 발명의 실시예들에서는 상술한 메모리저장소를 의미할 수 있으며, 다음과 같은 속성을 만족할 수 있다.The state machine is a computation model defined in computer science. In the embodiments of the present invention, the state machine can mean the above-mentioned memory storage, and the following attributes can be satisfied.
1. 메모리저장소의 상태는 저장된 데이터의 상태 집합을 의미한다.1. The state of a memory store is a set of states of stored data.
2. 메모리저장소에서 제공하는 연산의 수행에 의해서 상태의 전이가 확정적으로(deterministic) 일어나며, 연산의 수행 결과도 동일하다.2. The transition of the state is deterministic by the execution of the operation provided by the memory storage, and the result of the operation is the same.
메모리저장소에 대한 연산을 순차적으로 수행하면, 상태기기의 정의에 의해서 두 메모리저장소의 데이터(상태)가 동일하게 된다. 본 발명의 실시예들에서는 두 메모리저장소에 수행되는 명령어를 선입선출(First In First Out, FIFO) 방식으로 수행하여 두 메모리저장소의 데이터(상태)를 복제할 수 있다.When operations are sequentially performed on the memory storage, the data (states) of the two memory stores are identical by definition of the state machine. In the embodiments of the present invention, the data (state) of the two memory repositories can be replicated by performing a first in first out (FIFO) instruction on the two memory stores.
이때, 본 발명의 실시예들에서 제공하는 메모리저장소의 변경에 대한 일관성은 순차 일관성(sequential consistency)일 수 있다. 이는, 전체 시스템에서 수행된 모든 연산의 결과가 특정한 명령어들의 순차실행에 의해 수행된 결과와 동일하다는 것을 의미할 수 있다. 예를 들어, 모든 클라이언트는 메모리저장소에 수행한 변경 연산(일례로, 쓰기(write))의 결과를 바로 읽을(read) 수 있다.At this time, the consistency of the change of the memory storage provided by the embodiments of the present invention may be sequential consistency. This may mean that the results of all operations performed on the overall system are the same as those performed by sequential execution of particular instructions. For example, all clients can immediately read the result of a change operation (for example, a write) performed on a memory store.
도 1은 본 발명의 일실시예에 있어서, 데이터 저장 시스템의 개괄적인 구성의 예를 설명하기 위한 블록도이다. 도 1에서 데이터 저장 시스템(100)은 설정 마스터(Configuration Master, 110)와 마스터 저장부(120) 및 슬레이브 저장부(130)를 도시하고 있다.1 is a block diagram illustrating an example of a general configuration of a data storage system in an embodiment of the present invention. 1, the
데이터 저장 시스템(100)은 데이터를 분산 저장하는 시스템으로, 데이터를 분산 저장하는 장치들에서 전원 공급 중단 등의 장애에 따라 데이터가 유실되는 것을 방지하기 위한 저장부들(120 및 130)을 포함할 수 있다.The
저장부들(120 및 130)은 도 1에 도시된 바와 같이, 마스터 역할을 수행하기 위한 마스터 저장부(120)와 슬레이브 역할을 수행하기 위한 슬레이브 저장부(130)로 구성될 수 있다. 이때, 슬레이브 저장부(130)는 동일한 구성을 갖는 복수의 저장부들로 구현될 수도 있다. 예를 들어, 데이터 저장 시스템(100)은 복수의 저장부들을 포함할 수 있고, 그 중 하나의 저장부가 마스터 저장부(120)가 될 수 있으며, 둘 이상의 나머지 저장부들이 각각 슬레이브 저장부들로서 구현될 수 있다.The
또한, 저장부들(120 및 130)은 각각 하나의 저장 기기로서 구현될 수 있다. 예를 들어, 저장부들(120 및 130)은 개별 전원을 갖는 별도의 저장 기기들이 네트워크를 통해 통신하는 형태로 구현될 수 있다. Also, the
또한, 저장부들(120 및 130)은 도 1에 도시된 바와 같이, 리플리케이터(Replicator, 마스터 리플리케이터(121) 및 슬레이브 리플리케이터(131)), 클라이언트 라이브러리(Client Library, 122 및 132), 메모리저장소(123 및 133), 복제로그(124 및 134) 및 체크포인트데이터(125 및 135)를 포함할 수 있다. 클라이언트 라이브러리(122 및 132)는 메모리저장소(123 및 133)에 내장된 형태로 구현될 수 있으며, 체크포인트데이터(125 및 135)는 데이터의 복구를 위한 것으로, 선택적으로 저장부들(120 및 130)에 포함될 수 있다.1, includes a replicator (
마스터 리플리케이터(121)는 메모리저장소(123 및 133)에서 수행할 연산(명령어)을 선입선출 순서로 결정할 수 있다. 이때, 결정된 연산은 마스터 저장부(120)의 복제로그(124)와 슬레이브 저장부(130)의 복제로그(134)에 저장될 수 있다. 이미 설명한 바와 같이, 슬레이브 역할을 수행하기 위한 다수의 저장부들이 존재하는 경우, 저장부들 각각이 슬레이브 리플리케이터와 복제로그를 포함할 수 있다. 이 경우, 마스터 리플리케이터(121)에 의해 결정된 연산은 슬레이브 리플리케이터들의 복제로그들 각각에 저장될 수 있다.The
슬레이브 저장부(130)의 클라이언트 라이브러리(132)는 메모리저장소(133)에서 수행할 연산을 마스터 리플리케이터(121)로 전달하고, 수행될 복제로그(134)의 부분에 대한 정보를 로컬 리플리케이터(131)로부터 전달받아 복제로그(134)에서 수행할 연산을 읽어들여 메모리저장소(133)에서 처리할 수 있다. 여기서, "로컬"은 동일한 저장부에 포함된 구성요소를 의미할 수 있다. 예를 들어, 클라이언트 라이브러리(132)의 "로컬 리플리케이터"는 리플리케이터(131)를 의미할 수 있고, 클라이언트 라이브러리(122)의 "로컬 메모리저장소"는 메모리저장소(123)를 의미할 수 있다.The
설정 마스터(110)는 리플리케이터들(121 및 131)의 상태 감시와 리플리케이터들(121 및 131)의 장애 발생시 복제관계 재설정을 위한 처리를 수행할 수 있다. 이러한 설정 마스터(110)에 대해서는 이후 더욱 자세히 설명한다.The setting master 110 may perform processing for monitoring the status of the
메모리저장소(123 및 133)는 이미 설명한 바와 같이 상태기기로 정의되는 저장소로서 모든 상태를 메모리상에 상주시킬 수 있다.The memory stores 123 and 133 can be any state stored in memory as a store defined by the state machine as previously described.
복제로그(124 및 134)는 리플리케이터들(121 및 131)로 전달된 연산과 수행하기 위한 연산의 위치에 대한 정보가 저장된 데이터를 의미할 수 있다. 이러한 복제로그(124 및 134)에 대해서는 이후 더욱 자세히 설명한다.Replication logs 124 and 134 may refer to data stored in the
체크포인트데이터(125 및 135)는 메모리저장소(123 및 133)의 시점 데이터를 디스크상의 데이터로 저장할 것을 의미할 수 있다.The
마스터 리플리케이터(121)에서 슬레이브 리플리케이터(131)로 전송되는 모든 데이터는 복제로그(134)에 저장될 수 있다. 복제로그(134)는 고정크기의 파일로 구성될 수 있으며, 크게 데이터가 저장되는 부분과 메타데이터가 저장되는 부분으로 구성될 수 있다.All data transferred from the
도 2는 본 발명의 일실시예에 있어서, 복제로그의 예를 도시한 도면이다. 도 2는 복제로그(200)가 데이터 부분(210)과 메타데이터 부분(220)으로 구성된 파일들(230 및 240)의 집합으로 구현된 예를 나타내고 있다. 데이터 부분(210)은 복제데이터 자체가 저장되는 부분일 수 있고, 메타데이터 부분(220)은 메타데이터에 대한 체크섬(checksum) 및 복제로그(200)상에서 복제데이터가 어느 위치까지 저장되어 있는가에 대한 정보를 포함할 수 있다.2 is a diagram showing an example of a replication log in an embodiment of the present invention. 2 shows an example in which the
이때, 복제로그(200)가 포함하는 각 파일들(230 및 240)의 크기가 고정되어 있기 때문에 복제 상에서 임의의 메시지의 위치를 숫자로 나타낼 수 있다. 이 숫자를 로그 시퀀스 넘버(Log Sequence Number, LSN)라 부를 수 있다. 복제로그(200)가 포함하는 파일들(230 및 240)의 이름은 데이터 부분이 시작하는 LSN으로 정의될 수 있다. 따라서, 임의의 메시지의 위치를 나타내는 LSN이 복제로그(200)의 어느 파일의 어느 위치에 저장되어 있는지 역으로 파악이 가능해진다.At this time, since the sizes of the
복제로그(200)에 저장되는 데이터는 복제로그(200)와 동일한 저장부에 포함된 클라이언트 라이브러리에 의해 요청된 연산 전송의 목적 이외에 이후 설명될 복제 프로토콜 상의 메시지를 포함할 수 있다. 아래 표 1은 복제로그(200)에 저장되는 데이터에 대한 정보를 나타내고 있다.The data stored in the
·LENGTH: 연산 길이
·DATA: 연산 데이터NID: the identifier of the replicator
· LENGTH: Operation length
DATA: Operation data
도 3은 본 발명의 일실시예에 있어서, 복제 방식의 예를 도시한 도면이다.Fig. 3 is a diagram showing an example of a replication method in an embodiment of the present invention.
단계(310)은 복제로그를 전송하는 과정일 수 있다. 이때, 메모리저장소에 요청된 연산이 클라이언트 라이브러리를 통해 각 리플리케이터의 복제로그에 저장될 수 있다. 이러한 단계(310)에 대해서는 이후 도 4를 통해 더욱 자세히 설명한다.Step 310 may be the process of transmitting the replica log. At this time, the operation requested in the memory repository can be stored in the replicate log of each replicator through the client library. This
단계(320)은 커밋(commit) LSN을 결정 및 전달하는 과정일 수 있다. 이러한 단계(320)은 도 3에 도시된 바와 같이, 마스터 리플리케이터에서 각 리플리케이터의 LSN 값을 취합하여 커밋 LSN을 결정하는 단계(321), 커밋 LSN이 마스터 리플리케이터의 복제로그에 기입되고, 복제로그의 전송을 통해 각 리플리케이터에 전달되는 단계(322) 및 각 리플리케이터가 복제로그상의 REP_COMMIT 메시지를 통해 클라이언트 라이브러리에 수행할 LSN을 전송하는 단계(323)를 포함할 수 있다. 이러한 단계(320)에 대해서는 이후 도 5를 통해 더욱 자세히 설명한다.Step 320 may be a process of determining and delivering a commit LSN. This
단계(330)은 메모리저장소에서 연산이 실행되는 과정일 수 있다. 예를 들어, 클라이언트 라이브러리의 콜백(callback) 함수와의 호출을 통해 메모리저장소에서 복제된 연산이 수행될 수 있다. 이러한 단계(330)에 대해서는 이후 도 6을 통해 더욱 자세히 설명한다. 상술한 콜백 함수를 포함하여 이후 설명될 함수들(일례로, 시스템 호출을 위한)은 리눅스(Linux) 운영체제에서 이용되는 함수들을 기반으로 설명되나 이에 한정되지 않고, 다른 운영체제의 유사한 함수로 대체될 수도 있다.Step 330 may be the process by which the operation is performed in the memory store. For example, operations replicated in the memory store may be performed via a call to a client library's callback function. This
도 4는 본 발명의 일실시예에 있어서, 복제로그를 전송하는 과정의 예를 도시한 도면이다. 도 4는 도 3의 단계(310)을 설명하기 위한 일실시예를 나타내고 있다. 리플리케이터들(121 및 131)은 기본적으로 메모리저장소(123 및 133)에 대해 요청된 연산을 복제로그(124 및 134)에 저장할 수 있다.4 is a diagram illustrating an example of a process of transmitting a replication log in an embodiment of the present invention. FIG. 4 shows an embodiment for explaining
연산 과정(410)은 클라이언트 라이브러리(122 및 132)가 마스터 리플리케이터(121)로 연산을 요청하는 과정일 수 있다.The calculation process 410 may be a process in which the
제1 저장 과정(420)은 마스터 리플리케이터(121)가 요청된 연산을 요청 받은 순서대로 복제로그(124)에 기입하는 과정일 수 있다.The first storage process 420 may be a process in which the
읽기 과정(430)은 마스터 리플리케이터(121)가 기입된 연산과 관련된 로그를 복제로그(124)로부터 읽어들이는 과정일 수 있다.The reading process 430 may be a process in which the
로그 전송 과정(440)은 마스터 리플리케이터(121)가 읽어들인 로그를 슬레이브 리플리케이터(131)로 전송하는 과정일 수 있다.The log transfer process 440 may be a process of transferring the log read by the
제2 저장 과정(450)은 슬레이브 리플리케이터(131)가 수신된 로그를 복제로그(134)에 기입하는 과정일 수 있다.The second storing process 450 may be a process in which the
이와 같이, 연산 과정(410) 및 제1 저장 과정(420)을 통해 클라이언트 라이브러리(122 및 132)에 의해 요청된 연산이 마스터 리플리케이터(121)의 복제로그(124)에 저장될 수 있고, 읽기 과정(430), 로그 전송 과정(440) 및 제2 저장 과정(450)을 통해 마스터 리플리케이터(121)의 복제로그(124)가 슬레이브 리플리케이터(131)로 전달되어 슬레이브 리플리케이터(131)의 복제로그(134)에 저장될 수 있다.In this way, operations requested by the
마스터 리플리케이터(121)의 복제로그(124)는 일단 기입되면 더 이상 변경되지 않기 때문에 독립적으로 슬레이브 리플리케이터(131)로 전송될 수 있다.The
리플리케이터(121 및 131)는 서비스 스레드(service thread) 및 백그라운드 스레드(background thread)로 동작할 수 있으며, 복제로그(124 및 134)에 쓰여진 데이터를 디스크로 플러시(flush)하는 작업이 각 스레드에 의해 아래 (ㄱ) 및 (ㄴ)과 같이 나뉘어 진행될 수 있다.The
(ㄱ) 우선, 리플리케이터(121 및 131)의 서비스 스레드는 메모리 사상파일 형태로 복제로그(124 및 134)에 대한 읽기/쓰기를 수행할 수 있다. 이 경우, 복제로그(124 및 134)에 쓰여진 내용은 저장부들(120 및 130)의 버퍼 캐시(buffer cache) 영역에 존재할 수 있으며, 아직 디스크로 플러시되지 않은 상태일 수 있다.(A) First, the service threads of the
(ㄴ) 리플리케이터(121 및 131)의 백그라운드 스레드는 복제로그(124 및 134)의 내용을 디스크로 플러시할 수 있다. 예를 들어, 백그라운드 스레드는, 저장 시스템(120 및 130)의 버퍼 캐시 영역에 존재하는 데이터의 모든 내용을 주기적으로 fsync(fdatasync) 함수와 같은 시스템 호출을 이용하여 디스크에 플러시할 수 있다. 백그라운드 스레드는 주기적으로 플러시를 수행할 수 있으며, 마지막으로 수행된 플러시 이후에 복제로그(124 및 134)에 쓰여진 데이터가 기설정된 크기를 넘어가는 경우에 다시 플러시를 실행할 수 있다.(B) The background thread of the
이와 같이, 리플리케이터(121 및 131)에서 복제로그(124 및 134)를 저장하는 것은, 버퍼 캐시를 통해 우선적으로 읽기/쓰기를 수행한 후, 특정 상황(마지막으로 수행된 플러시 이후에 복제로그(124 및 134)(일례로, 버퍼 캐시)에 쓰여진 데이터가 특정 크기를 넘어가는 경우)에 따라 또는 주기적으로 플러시를 수행하여 데이터를 디스크에 저장함으로써, 복제 흐름에 대한 시간 지연을 최소화하는 방식으로 구성될 수 있다.As such, storing
저장부들(120 및 130)의 버퍼 캐시 영역에 존재하는 데이터는 아직 디스크로 플러시되지 않았기 때문에 시스템의 전원 공급이 중단되는 등의 장애에 따라 유실될 가능성이 존재한다. 그러나, 본 발명의 실시예들에서는 복제로그(124 및 134)의 가용성이 복제 팩터(factor)만큼 유지될 수 있도록 복제 방식이 동작하기 때문에 유실된 데이터 부분을 복구할 수 있다.Since the data in the buffer cache area of the
도 5는 본 발명의 일실시예에 있어서, COMMIT LSN을 결정 및 전달하는 과정의 예를 도시한 도면이다.5 is a diagram illustrating an example of a process of determining and transmitting a COMMIT LSN in an embodiment of the present invention.
과정 (1)은, 마스터 리플리케이터(121)로부터 복제로그를 전송받은 슬레이브 리플리케이터들(131 및 510)이 마스터 리플리케이터(121)로 마지막 LSN 값을 전송하는 과정일 수 있다. LSN 값은 복제로그(슬레이브 리플리케이터들(131 및 510) 각각의 복제로그들)에 쓰여진 마지막 바이트(byte)에 대한 위치로서 복제로그를 구성하는 메시지의 경계뿐만 아니라 임의의 위치를 가리킬 수 있다.The process (1) may be a process in which the
과정 (2)는, 마스터 리플리케이터(121)가 슬레이브 리플리케이터들(131 및 510)로부터 전송받은 LSN 기반으로 가용성이 보장되어 안전하게 연산을 수행할 수 있는 LSN을 결정할 수 있다. 이때 결정된 LSN을 'COMMIT LSN'이라 부른다.In the process (2), the
COMMIT LSN은 복제 팩터값을 기반으로 결정될 수 있다. 예를 들어, 복제 팩터값이 '2'인 경우, 적어도 '2' 곳 이상의 복제로그에 전달된 LSN까지가 COMMIT LSN으로 지정될 수 있다. COMMIT LSN은 항상 단조 증가(monotone increasing)할 수 있다.The COMMIT LSN may be determined based on the replication factor value. For example, if the replication factor value is '2', then at least two LSNs sent to the replication log can be designated as COMMIT LSN. The COMMIT LSN can always be monotone increasing.
과정 (3)은, 새로운 COMMIT LSN이 결정된 이후의 마스터 리플리케이터(121)의 동작을 나타낼 수 있다.Process (3) may indicate the operation of the
예를 들어, 과정 (3)에서, 마스터 리플리케이터(121)는 복제로그(124)에 COMMIT LSN값을 데이터로 하는 REP_COMMIT 메시지를 기입할 수 있다. REP_COMMIT 메시지는 도 4를 통해 설명한 복제로그 전송 방식에 따라 슬레이브 리플리케이터들(131 및 510)로 전달될 수 있다. 이때, 과정 (3)에서 마스터 리플리케이터(121)는, 결정된 COMMIT LSN 값을 바로 로컬 클라이언트 라이브러리(122)로 전송할 수 없다. 그 이유는, 해당 COMMIT LSN 값이 아직 복제로그(124)에 존재하고, 슬레이브 리플리케이터들(131 및 510)에 가용성을 보장할 수 있을 만큼 전송되지 않았을 수 있기 때문이다. 이러한 이유로 마스터 리플리케이터(121)는, 마스터 리플리케이터(121)가 발행한 REP_COMMIT 메시지에 대한 정보를 가지고 있으며, 해당 COMMIT LSN 이전에 존재하는 REP_COMMIT 메시지의 COMMIT_LSN 필드값을 클라이언트 라이브러리(122)로 전송할 수 있다(REP_COMMIT lookup table(530)).For example, in the process (3), the
슬레이브 리플리케이터들(131 및 510)은 전송받은 복제 내용 중 REP_COMMIT 메시지가 존재하는 경우, REP_COMMIT 메시지의 COMMIT_LSN 필드값을 로컬 클라이언트 라이브러리(일례로, 슬레이브 리플리케이터(510)의 경우, 클라이언트 라이브러리(520)가 로컬 클라이언트 라이브러리임)에 전달할 수 있다. 슬레이브 리플리케이터들(131 및 510)에서는, 마스터 리플리케이터(121)의 복제로그(124)에 기입된 내용이 이미 전달되어 있기 때문에 가용성을 만족할 수 있다.The
다시 도 1을 참조하면, 복제로그(124 및 134)는 지속적으로 그 크기가 증가하기 때문에, 적당한 수준에서 복제로그(124 및 134)의 크기를 유지하기 위한 방안이 필요하다. 이때, 체크포인트데이터(125 및 135)는 메모리저장소(123 및 133)의 상태를 하나의 파일 형태로 저장된 데이터를 포함할 수 있다.Referring again to Figure 1, there is a need to maintain the size of the replica logs 124 and 134 at a reasonable level since the replica logs 124 and 134 continue to grow in size. At this time, the
임의의 저장부에 포함되는 체크포인트데이터는 아래 (a) 내지 (c)의 과정을 통해 생성될 수 있다.The checkpoint data included in an arbitrary storage unit may be generated through the following processes (a) to (c).
(a) 포크(fork) 시스템 호출을 통해 부모 프로세스와 자식 프로세스가 동일한 데이터를 유지하는 상태에서 메모리저장소가 시작될 수 있다.(a) Through the fork system call, the memory store can be started with the parent and child processes maintaining the same data.
(b) 부모 프로세스는 클라이언트 라이브러리와 연동되어 요청되는 연산을 수행할 수 있다.(b) The parent process can work with the client library to perform the requested operation.
(c) 자식 프로세스는 메모리저장소의 모든 상태를 체크포인트데이터로 저장할 수 있다. 체크포인트데이터에는 메모리저장소의 상태 이외에 해당 메모리저장소에 가해진 연산의 마지막 위치에 해당하는 LSN 값이 포함할 수 있다.(c) The child process can store all state of the memory store as checkpoint data. The checkpoint data may include an LSN value corresponding to the last position of the operation applied to the memory store in addition to the state of the memory store.
체크포인트데이터에 포함된 LSN 이전의 복제로그 파일들은 제거가 가능할 수 있다. 또한, 체크포인트데이터와 복제로그를 이용하여 메모리저장소의 상태를 복구할 수 있다.Replication log files prior to the LSN included in the checkpoint data may be removable. In addition, checkpoint data and replication logs can be used to restore the state of the memory repository.
이상에서 설명한 복제 방식은 메모리저장소에 가해지는 연산에 대해 선입선출 순서를 결정하는 마스터 리플리케이터(일례로, 도 1의 마스터 리플리케이터(121))를 가정하고 있다. 만약, 마스터 리플리케이터에 장애가 발생하는 경우에는, 전체 복제 흐름이 멈추게 되어 메모리저장소에서 연산이 수행되지 않게 된다.The above-described copying method assumes a master replicator (for example, the
설정 마스터(일례로, 도 1의 설정 마스터(110))는 리플리케이터들의 상태를 감시할 수 있으며, 마스터 리플리케이터에 장애가 발생한 경우, 남아 있는 슬레이브 리플리케이터들 중 LSN 값이 가장 큰 슬레이브 리플리케이터를 마스터 리플리케이터로 선출할 수 있다. 이미 설명한 바와 같이, LSN은 복제로그의 메시지 단위의 값이 아니기 때문에, 마스터 리플리케이터를 선출하는 기준은, 슬레이브 리플리케이터들 각각에 존재하는 COMMIT LSN의 최대값을 이용할 수 있다. 슬레이브 리플리케이터에 장애가 발생된 경우에는 복제 팩터를 조정하는 등의 추가적인 작업이 수행될 수 있다.The configuration master (e.g., the configuration master 110 in FIG. 1) can monitor the status of the replicators and, if a failure occurs in the master replicator, select the slave replicator having the largest LSN value among the remaining slave replicators as the master replicator can do. As described above, since the LSN is not the value of the message unit of the replication log, the criterion for selecting the master replicator can be the maximum value of the COMMIT LSN existing in each of the slave replicators. If a failure occurs in the slave replicator, additional operations such as adjusting the replication factor can be performed.
본 발명의 실시예들에서는 상술한 복제 방식에서 다음과 같은 기법을 이용하여 고성능 복제를 구현할 수 있다.In the embodiments of the present invention, high-performance replication can be implemented using the following technique in the replication method described above.
(1) 복제로그에 대한 메모리사상 파일 형태의 접근을 통해 메모리 복사에서 발생하는 부하를 제거(1) Memory mapping for replicated logs Removes the load caused by memory copying through file type access
(1-1) 마스터 리플리케이터는, 클라이언트 라이브러리로부터 복제될 연산을 수신한 이후, 복제로그의 메모리 사상 파일 영역을 버퍼 영역으로 지정하여 메모리 복사를 수행할 수 있다.(1-1) After receiving the operation to be replicated from the client library, the master replicator can perform memory copying by designating the memory mapping file area of the replication log as a buffer area.
(1-2) 슬레이브 리플리케이터는 마스터 리플리케이터로부터 복제로그를 수신하는 경우, 복제로그의 메모리 사상 파일 영역을 버퍼 영역으로 지정하여 TCP 커넥션(connection)의 파일 기술자에 대해 읽기(read) 시스템 콜을 수행할 수 있다.(1-2) When receiving the replication log from the master replicator, the slave replicator specifies the memory mapping file area of the replication log as a buffer area and performs a read system call to the file descriptor of the TCP connection .
(1-3) 메모리저장소에 내장된 클라이언트 라이브러리는 수행될 COMMIT LSN에 해당하는 영역을 읽어들일 수 있다. 이때, 클라이언트 라이브러리는 복제에 따른 메모리 사상 파일 형태로 직접 메모리에 접근할 수 있다.(1-3) The client library built in the memory repository can read the area corresponding to the COMMIT LSN to be executed. At this time, the client library can directly access the memory in the form of a memory mapping file according to the replication.
(2) 복제로그의 전송 방식에서 설명하였듯, 복제될 연산이 마스터 리플리케이터의 복제로그에 저장되는 과정과, 마스터 리플리케이터의 복제로그가 슬레이브 리플리케이터로 전송되는 과정은 요청(request)/응답(response) 방식이 아니라 스트리밍(streaming) 방식으로 진행된다. 따라서, 네트워크 응답 시간에 따른 지연 현상이 발생하지 않으며, 네트워크 대역폭에 의해 단위시간 당 처리량이 결정되게 된다.(2) As described in the transmission method of the replication log, a process in which an operation to be replicated is stored in the replication log of the master replicator, and a process in which the replication log of the master replicator is transmitted to the slave replicator includes a request / Streaming method rather than a method. Therefore, a delay phenomenon does not occur according to the network response time, and the throughput per unit time is determined by the network bandwidth.
(3) 복제로그에 저장되는 모든 내용은 복제 프로토콜의 메시지가 가감 없이 저장되는 형태이기 때문에 수신된 데이터를 변환하기 위한 추가적인 비용이 발생하지 않는다.(3) All the contents stored in the replica log do not incur the additional cost of converting the received data because the replica protocol messages are stored without addition or subtraction.
(4) 복제로그의 디스크 저장방식에서 설명한 바와 같이, 리플리케이터의 복제로그 저장은 복제 단계에서 fsync 시스템 호출을 이용하지 않고, write 시스템 호출만을 수행해서 시스템의 버퍼 캐시 영역에 데이터를 기입한 이후 반환되고, 리플리케이터의 백그라운드 스레드에 의해 디스크로 플러시된다. 이는 복제로그의 분산에 의해 고 가용성을 이미 확보하였기 때문에 가능한 방식이다.(4) As described in the disk storage method of the replication log, the replicator log storage of the replicator is performed after writing data to the buffer cache area of the system by performing only the write system call without using the fsync system call at the replication step , And is flushed to disk by the background thread of the replicator. This is possible because of the high availability already achieved by the distribution of replication logs.
이후에서는 본 발명의 실시예들에 따른 복구 방식에 대해 설명한다. 복구 방식은 아래와 같이 리플리케이터의 재 시작 복구, 메모리저장소의 재 시작 복구, 메모리저장소가 로컬 리플리케이터에 연결된 이후 복제로그의 전송에 의해서 수행되는 복제복구로 나뉘어질 수 있다.Hereinafter, a recovery method according to embodiments of the present invention will be described. The restoration method can be divided into restart recovery of the replicator, restoration of restart of the memory storage, and copy recovery performed by transferring the replication log after the memory storage is connected to the local replicator as shown below.
A. 리플리케이터의 재 시작 복구: 설정 마스터는, 복제로그의 정합성을 확인한 후 복제로그의 가용 LSN 범위를 확인할 수 있다. 예를 들어, 설정 마스터는, 가용한 최소 LSN인 MIN_LSN값과 가용한 최대 LSN인 MAX_LSN 값을 확인할 수 있다. 이때, 재 시작되는 리플리케이터는 MIN_LSN값과 MAX_LSN 값 사이의 복제 데이터를 가질 수 있다.A. Restart restart of replicators: The configuration master can check the replication LSN range of the replication log after verifying the integrity of the replication log. For example, the configuration master can check the MIN_LSN value, which is the minimum LSN available, and the MAX_LSN value, which is the maximum LSN available. At this time, the restarting replicator may have duplicate data between the MIN_LSN value and the MAX_LSN value.
B. 메모리저장소의 재 시작 복구: 리플리케이터는 체크포인트데이터가 존재하는 경우, 체크포인트데이터를 이용하여 메모리저장소의 상태를 복원할 수 있다. 체크포인트데이터와 함께 저장된 LSN 값을 CKPT_LSN이라 부를 수 있다. 이때, CKPT_LSN은 해당 메모리저장소의 상태에 적용된 마지막 연산의 끝 위치를 나타낼 수 있다. 만약, 체크포인트데이터가 유실 등의 이유로 존재하지 않는 경우, CKPT_LSN의 값은 '0'이 될 수 있다.B. Restarting Memory Store Restore: If the checkpoint data is present, the replicator can restore the state of the memory store using checkpoint data. The LSN value stored together with the checkpoint data may be referred to as CKPT_LSN. At this time, CKPT_LSN can indicate the end position of the last operation applied to the state of the corresponding memory storage. If the checkpoint data does not exist due to loss or the like, the value of CKPT_LSN may be '0'.
C. 복제 복구: 시스템이 새로 시작되어 리플리케이터들의 마스터/슬레이브 역할이 정해지지 않은 상태에서, 기존의 마스터 리플리케이터가 가지고 있는 복제로그를 이용하여 복구가 가능한 경우, 기존의 마스터 리플리케이터는 슬레이브로서 복제 관계에 참석할 수 있다.C. Replication Recovery: If the system is newly started and the master / slave role of the replicators is not defined, and the recovery is possible using the replication log of the existing master replicator, the existing master replicator will be able to participate in the replication relationship as a slave .
만약, 로컬 리플리케이터가 마스터 리플리케이터로부터 복제로그를 이용하여 복구될 수 없다면, 로컬 리플리케이터는 로컬 복제로그를 모두 지우고, 마스터 리플리케이터의 메모리저장소에 대한 체크포인트데이터를 전송 받아서 복구 과정을 다시 시작할 수 있다. 이를 원격 체크포인트데이터를 이용한 복구라고 한다.If the local replicator can not be recovered from the master replicator using the replication log, the local replicator may clear the local replication log and receive checkpoint data for the memory repository of the master replicator to resume the recovery process. This is called recovery using remote checkpoint data.
도 6은 본 발명의 일실시예에 있어서, 리플리케이터의 재 시작 복구 및 메모리저장소의 재 시작 복구를 포함하는 리플리케이터의 상태 전이를 나타낸 도면이다.Figure 6 is a diagram illustrating state transitions of a replicator, including a restart of a replicator and a restart of a memory store, in an embodiment of the present invention.
리플리케이터의 상태는 NONE(610), LCONN(620), MASTER(630) 및 SLAVE(640)의 네 가지 상태를 가질 수 있다.The state of the replicator may have four states:
NONE(610) 상태는, 리플리케이터의 재 시작 복구가 끝난 상태를 의미할 수 있다. 이때, NONE(610) 상태에서 MIN_LSN 및 MAX_LSN이 결정될 수 있다.The
LCONN(620) 상태는, 메모리저장소가 리플리케이터에 연결된 상태를 의미할 수 있다. 메모리저장소가 리플리케이터에 접속할 때, 메모리저장소 재 시작 복구 과정에서 얻어진 CKPT_LSN 값이 리플리케이터로 전달될 수 있다.The
CKPT_LSN이 MIN_LSN보다 작은 경우에는 원격 체크포인트데이터를 이용한 복구가 시작되어 리플리케이터가 재 구동될 수 있다.When CKPT_LSN is smaller than MIN_LSN, recovery using remote checkpoint data is started and the replicator can be restarted.
CKPT_LSN이 MIN_LSN보다 크거나 같은 경우, 리플리케이터는 LCONN(620) 상태에서 설정 마스터가 리플리케이터의 역할을 정해 줄 수 있도록 기다릴 수 있다. 설정 마스터는 설정 마스터의 복제로그 정보(MIN_LSN, MAX_LSN 및 CKPT_LSN)를 이용하여 리플리케이터의 역할을 결정할 수 있다.If CKPT_LSN is greater than or equal to MIN_LSN, the replicator may wait in the
설정 마스터가 마스터에 대한 접속 정보를 LCONN(620) 상태의 리플리케이터에 전달해 줌으로써, SLAVE(640) 상태의 슬레이브 리플리케이터는 마스터 리플리케이터로의 연결을 획득할 수 있다. 이때, 슬레이브 리플리케이터는 마스터에 대한 접속 정보를 로컬 클라이언트 라이브러리(의 메모리저장소)에 전달할 수 있다.A slave replicator in the
LCONN(620) 상태의 리플리케이터는, 접속 시 자신이 필요로 하는 시작 로그(CKPT_LSN과 MAX_LSN 값 중 큰 값) 정보를 마스터 리플리케이터에 전달할 수 있다. 이후, 마스터 리플리케이터는 해당 로그 번호로부터 복제로그를 슬레이브 리플리케이터로 전송할 수 있다.The replicator in the
복제가 처음 구성된 경우, 설정 마스터는 LCONN(620) 상태의 리플리케이터를 MASTER(630) 상태의 마스터 리플리케이터로 지정할 수 있다.If replication is initially configured, the configuration master may designate the replicator of the
도 7은 본 발명의 일실시예에 있어서, 마스터 저장 기기의 내부 구성을 설명하기 위한 블록도이고, 도 8은 본 발명의 일실시예에 있어서, 마스터 저장 기기의 데이터 복제 방법을 도시한 흐름도이다.FIG. 7 is a block diagram illustrating an internal configuration of a master storage device according to an exemplary embodiment of the present invention, and FIG. 8 is a flowchart illustrating a data replication method of a master storage device according to an exemplary embodiment of the present invention .
본 실시예에 따른 마스터 저장 기기(700)는 도 7에 도시된 바와 같이 프로세서(710), 버스(720), 네트워크 인터페이스(730) 및 메모리(740)를 포함할 수 있다. 메모리(740)는 운영체제(741), 데이터 복제 루틴(742) 및 마스터 메모리저장소(743)를 포함할 수 있다. 프로세서(710)는 마스터 리플리케이터(711) 및 클라이언트 라이브러리(712)를 포함할 수 있다. 다른 실시예들에서 마스터 저장 기기(700)는 도 7의 구성요소들보다 더 많은 구성요소들을 포함할 수도 있다. 그러나, 대부분의 종래기술적 구성요소들을 명확하게 도시할 필요성은 없다. 예를 들어, 마스터 저장 기기(700)는 디스플레이나 트랜시버(transceiver)와 같은 다른 구성요소들을 포함할 수도 있다.The
메모리(740)는 컴퓨터에서 판독 가능한 기록 매체로서, RAM(random access memory), ROM(read only memory) 및 디스크 드라이브와 같은 비소멸성 대용량 기록장치(permanent mass storage device)를 포함할 수 있다. 또한, 메모리(740)에는 운영체제(741), 데이터 복제 루틴(742)을 위한 프로그램 코드가 저장될 수 있으며, 마스터 메모리저장소(743)가 구현될 수 있다. 이러한 운영체제(741) 및 데이터 복제 루틴(742)과 같은 소프트웨어 구성요소들은 드라이브 메커니즘(drive mechanism, 미도시)을 이용하여 메모리(740)와는 별도의 컴퓨터에서 판독 가능한 기록 매체로부터 로딩될 수 있다. 이러한 별도의 컴퓨터에서 판독 가능한 기록 매체는 플로피 드라이브, 디스크, 테이프, DVD/CD-ROM 드라이브, 메모리 카드 등의 컴퓨터에서 판독 가능한 기록 매체(미도시)를 포함할 수 있다. 다른 실시예에서 소프트웨어 구성요소들은 컴퓨터에서 판독 가능한 기록 매체가 아닌 네트워크 인터페이스(730)를 통해 메모리(740)에 로딩될 수도 있다. 예를 들어, 데이터 복제 루틴(742)은 개발자들이 네트워크를 통해 제공하는 파일들에 의해 설치되는 프로그램에 기반하여 메모리(740)에 로딩될 수 있다.The
버스(720)는 마스터 저장 기기(700)의 구성요소들간의 통신 및 데이터 전송을 가능하게 할 수 있다. 버스(720)는 고속 시리얼 버스(high-speed serial bus), 병렬 버스(parallel bus), SAN(Storage Area Network) 및/또는 다른 적절한 통신 기술을 이용하여 구성될 수 있다.The
네트워크 인터페이스(730)는 마스터 저장 기기(700)를 컴퓨터 네트워크에 연결하기 위한 컴퓨터 하드웨어 구성요소일 수 있다. 네트워크 인터페이스(730)는 서버(700)를 무선 또는 유선 커넥션을 통해 컴퓨터 네트워크에 연결시킬 수 있다.The
프로세서(710)는 기본적인 산술, 로직 및 마스터 저장 기기(700)의 입출력 연산을 수행함으로써, 컴퓨터 프로그램의 명령을 처리하도록 구성될 수 있다. 명령은 메모리(740) 또는 네트워크 인터페이스(730)에 의해, 그리고 버스(720)를 통해 프로세서(710)로 제공될 수 있다. 프로세서(710)는 마스터 리플리케이터(711) 및 클라이언트 라이브러리(712)를 위한 프로그램 코드를 실행하도록 구성될 수 있다. 이러한 프로그램 코드는 메모리(740)와 같은 기록 장치에 저장(일례로, 데이터 복제 루틴(742))될 수 있다.The
이때, 프로세서(710)가 포함하는 마스터 리플리케이터(711) 및 클라이언트 라이브러리(712)는 도 8의 단계들(810 내지 830)를 수행하기 위해 구성될 수 있다.At this time, the
단계(810)에서 마스터 리플리케이터(711)은, 마스터 메모리저장소(743) 및 슬레이브 저장 기기가 포함하는 슬레이브 메모리저장소 중 적어도 하나에 대해 요청된 연산을 수신할 수 있다. 예를 들어, 도 4의 연산 과정(410)을 통해 설명한 바와 같이, 마스터 리플리케이터(711)는 마스터 연산 기기(700)가 포함하는 클라이언트 라이브러리(712) 및/또는 적어도 하나의 슬레이브 저장 기기가 포함하는 클라이언트 라이브러리를 통해 메모리저장소들에 대해 요청된 연산(명령어)을 수신할 수 있다.At
단계(820)에서 마스터 리플리케이터(711)은, 수신된 연산을 마스터 복제로그(마스터 저장 기기(700)가 포함하는 복제로그)에 저장하고, 수행되어야 할 연산의 위치에 대한 정보를 마스터 복제로그에 더 저장하고, 마스터 복제로그를 슬레이브 저장 기기로 전달할 수 있다. 이때, 슬레이브 저장 기기가 포함하는 슬레이브 복제로그가 전달된 마스터 복제로그와 동기화될 수 있다.In
이때, 수행되어야 할 연산의 위치는 앞서 설명한 커밋 LSN에 대응될 수 있다. 이미 설명한 바와 같이, 마스터 복제로그(또는 슬레이브 복제로그)는, 로그 시퀀스 넘버(Log Sequence Number, LSN)를 통해 마스터 복제로그(또는 슬레이브 복제로그)에서 데이터가 저장된 위치가 표현될 수 있다.At this time, the position of the operation to be performed may correspond to the commit LSN described above. As described above, the master replication log (or the slave replication log) can be represented by a log sequence number (LSN) in which the data is stored in the master replication log (or the slave replication log).
슬레이브 저장 기기의 슬레이브 리플리케이터는 슬레이브 복제로그에 저장된 마지막 데이터의 LSN값을 마스터 리플리케이터(711)로 전송할 수 있으며, 마스터 리플리케이터(711)는 수신된 LSN 값과 복제 팩터에 기반하여 커밋 LSN을 결정할 수 있다. 이러한 커밋 LSN은 수신된 연산과 함께 마스터 복제로그에 저장되어 슬레이브 저장 기기로 전달될 수 있다. 마스터 리플리케이터(711)는 복수의 슬레이브 저장 기기들로부터 수신된 복수의 LSN 값들 중에서 동일한 값의 LSN들 복제 팩터의 값(일례로 '3') 이상 존재하는 경우, 해당 LSN의 값을 커밋 LSN의 값으로 결정할 수 있다.The slave replicator of the slave storage device can transfer the LSN value of the last data stored in the slave replication log to the
또한, 마스터 리플리케이터(711)는 단계(820)에서 수신된 연산을 메모리 사상파일의 형태로 버퍼 캐시 영역에 저장하여 마스터 복제로그에 대한 읽기 및/또는 쓰기를 수행할 수 있다. 버퍼 캐시 영역에 대한 읽기 및/또는 쓰기는 디스크에 비해 매우 빠른 접근이 가능하기 때문에 복제 흐름에 대한 시간 지연을 최소화할 수 있다. 또한, 마스터 리플리케이터(711)는 주기적으로 버퍼 캐시 영역에 저장된 데이터를 디스크로 플러시(flush)할 수 있다. 뿐만 아니라, 마스터 리플리케이터(711)는 마지막 플러시에 따라 마스터 복제로그에 저장된 데이터의 크기가 기설정된 크기 이상인 경우, 버퍼 캐시 영역에 저장된 데이터를 디스크로 플러시할 수 있다. 이러한 데이터의 플러시는 fsync(fdatasync)와 같은 시스템 호출을 이용하여 수행될 수 있다.The
또한, 마스터 복제로그의 전달 역시 버퍼 캐시 영역을 이용하여 처리될 수 있다. 마스터 리플리케이터(711)는 마스터 복제로그의 메모리 사상 파일 영역을 버퍼 캐시 영역으로 지정하여 메모리 복사를 수행할 수 있다. 이때, 슬레이브 리플리케이터 역시 상술한 사상 파일 영역을 버퍼 캐시 영역으로 지정하여 마스터 복제로그를 읽어들일 수 있다. 이 경우, 슬레이브 저장 기기의 클라이언트 라이브러리는 상술한 사상 파일 영역에 직접 메모리 접근함으로서, 수행되어야 할 연산의 위치(커밋 LSN)에 대한 정보를 획득할 수 있다.Also, the transfer of the master replication log may also be handled using the buffer cache area. The
단계(830)에서 클라이언트 라이브러리(712)는, 수행되어야 할 연산의 위치에 대한 정보에 기반하여 마스터 복제로그에 저장된 연산을 마스터 메모리저장소(743)에 대해 수행할 수 있다. 이때, 마스터 메모리저장소(743) 및 슬레이브 메모리저장소는, 동일한 데이터 상태 집합을 가질 수 있고, 저장된 연산에 따라 동일한 연산결과를 가질 수 있다.At
이미 설명한 바와 같이, 메모리저장소의 상태는 저장된 데이터의 상태 집합을 의미할 수 있고, 메모리저장소에서 제공하는 연산의 수행에 의해서 상태의 전이가 확정적으로 일어나며, 연산의 수행 결과도 동일하다. 이는, 서로 동일한 상태에서 시작된 두 메모리저장소에 대해 동일한 연산이 수행되는 경우, 두 메모리저장소의 데이터(상태)가 동일함을 의미할 수 있으며, 두 메모리저장소에 수행되는 연산을 선입선출 방식으로 수행함으로써, 두 메모리저장소의 데이터(상태)를 복제할 수 있음을 의미할 수 있다. 예를 들어, 마스터 저장 기기(700)의 클라이언트 라이브러리(712)와 슬레이브 저장 기기의 클라이언트 라이브러리(712)는 수행되어야 할 연산의 위치에 대한 정보에 따라 마스터 복제로그와 슬레이브 복제로그에서 서로 동일한 위치까지의 연산을 마스터 메모리저장소(743) 및 슬레이브 메모리저장소에 대해 순차적으로 실행할 수 있다. 따라서, 마스터 메모리저장소(743) 및 슬레이브 메모리저장소의 데이터는 서로 동일해질 수 있다.As described above, the state of the memory storage may mean a state set of the stored data, and the transition of the state is definitively performed by the execution of the operation provided by the memory storage, and the execution result of the operation is the same. This means that if the same operation is performed on two memory stores started in the same state with each other, it means that the data (states) of the two memory stores are the same, and the operations performed on the two memory stores are performed by first- , Meaning that the data (state) of both memory stores can be replicated. For example, the
이 외에, 마스터 저장 기기(700)와 슬레이브 저장 기기를 포함하는 복수의 저장 기기들 각각은 체크포인트데이터를 더 포함할 수 있다. 체크포인트데이터는, 복수의 저장 기기들 각각이 포함하는 메모리저장소의 상태 및 메모리저장소에 대해 수행된 연산의 마지막 위치에 해당하는 LSN(CKPT_LSN)을 포함할 수 있다.In addition, each of the plurality of storage devices including the
이때, 복수의 저장 기기들 중 장애가 발생한 저장 기기의 메모리저장소의 상태를 장애가 발생한 저장 기기의 체크포인트데이터를 이용하여 복구할 수 있다. 예를 들어, 마스터 저장 기기(700)에 장애가 발생된 경우, 마스터 메모리저장소(743)의 상태는 마스터 저장 기기(700)가 포함하는 체크포인트데이터를 이용하여 복구될 수 있다.At this time, it is possible to restore the state of the memory storage of the failed storage device among the plurality of storage devices by using the checkpoint data of the failed storage device. For example, when a failure occurs in the
반면, 체크포인트데이터를 이용하여 할 수 없는 경우, 장애가 발생한 저장 기기는 마스터 저장 기기(700)의 체크포인트데이터를 전송받고, 전송된 체크포인트데이터를 이용하여 메모리저장소의 상태를 복구할 수도 있다. 예를 들어, 장애가 발생한 저장 기기는 복제로그의 사용한 최소 LSN과 최대 LSN을 확인할 수 있다. 이때, 장애가 발생한 저장 기기는 CKPT_LSN이 최소 LSN 미만인 경우, 체크포인트데이터가 유실되어 이용할 수 없음을 판단할 수 있다. 이때, 장애가 발생한 저장 기기는 마스터 저장 기기(700)의 체크포인트데이터를 이용하여 메모리저장소의 상태를 복구할 수 있다.On the other hand, if it is not possible to use the checkpoint data, the failed storage device may receive the checkpoint data of the
다른 예로, 장애가 발생한 저장 기기는 설정 마스터를 통해 마스터 저장 기기(700)에 대한 접속 정보를 제공받아 마스터 저장 기기(700)와의 연결을 획득할 수 있다. 이때, 장애가 발생한 저장 기기는 마스터 저장 기기(700)로 필요한 시작 로그에 대한 정보(복제로그의 필요한 시작 LSN)를 전달할 수 있다. 이 경우, 마스터 저장 기기(700)는 시작 로그에 대한 정보에 기반하여 요청된 복제로그를 장애가 발생한 저장 기기로 전송할 수 있다. 예를 들어, 마스터 저장 기기(700)는 시작 LSN부터의 복제로그를 장애가 발생한 저장 기기로 전송할 수 있다.As another example, the failed storage device may receive the connection information to the
마스터 저장 기기(700)에 장애가 발생하는 경우에는, 상술한 설정 마스터를 통해 슬레이브 저장 기기 중 하나가 마스터로 선출될 수 있다. 예를 들어, 복제로그에 저장된 마지막 데이터의 LSN이 가장 큰 슬레이브 저장 기기 또는 복제로그에 저장된 커밋 LSN이 가장 큰 슬레이브 저장 기기가 마스터로서 새롭게 선출될 수 있다.When a failure occurs in the
도 7 및 도 8에서 생략된 내용은 도 1 내지 도 6을 참조할 수 있다. 일례로, 마스터 저장 기기(700)는 도 1을 통해 설명한 마스터 저장부(120)에 슬레이브 저장 기기는 역시 도 1을 통해 설명한 슬레이브 저장부(130)에 각각 대응될 수 있다.The contents omitted in FIGS. 7 and 8 can be referred to FIGS. 1 to 6. FIG. For example, the
도 9는 본 발명의 일실시예에 있어서, 슬레이브 저장 기기의 내부 구성을 설명하기 위한 블록도이고, 도 10은 본 발명의 일실시예에 있어서, 슬레이브 저장 기기의 데이터 복제 방법을 도시한 흐름도이다.FIG. 9 is a block diagram illustrating an internal configuration of a slave storage device according to an exemplary embodiment of the present invention, and FIG. 10 is a flowchart illustrating a data replication method of a slave storage device according to an embodiment of the present invention .
본 실시예에 따른 슬레이브 저장 기기(900)는 도 7 및 도 8을 통해 설명한 슬레이브 저장 기기에 대응될 수 있으며, 도 9에 도시된 바와 같이 프로세서(910), 버스(920), 네트워크 인터페이스(930) 및 메모리(940)를 포함할 수 있다. 메모리(940)는 운영체제(941), 데이터 복제 루틴(942) 및 슬레이브 메모리저장소(943)를 포함할 수 있다. 프로세서(910)는 슬레이브 리플리케이터(911) 및 클라이언트 라이브러리(912)를 포함할 수 있다. 여기서, 프로세서(910), 버스(920), 네트워크 인터페이스(930) 및 메모리(940)는 도 7 및 도 8을 통해 설명한 프로세서(710), 버스(720), 네트워크 인터페이스(730) 및 메모리(740)에 대응할 수 있으며, 프로세서(910)가 포함하는 슬레이브 리플리케이터(911) 및 클라이언트 라이브러리(912)는 도 10의 단계들(1010 내지 1030)를 수행하기 위해 구성될 수 있다.The
단계(1010)에서 슬레이브 리플리케이터(911)는 슬레이브 저장 기기(900)가 포함하는 슬레이브 메모리저장소(943)에 대해 요청된 연산을 마스터 저장 기기로 전송할 수 있다. 마스터 저장 기기는 도 7 및 도 8을 통해 설명한 마스터 저장 기기(700)에 대응할 수 있다.The
단계(1020)에서 슬레이브 리플리케이터(911)는 상기 연산 및 마스터 저장 기기와 연계된 마스터 메모리저장소에 대해 요청된 연산 중 적어도 하나, 그리고 수행되어야 할 연산의 마스터 저장 기기가 포함하는 마스터 복제로그에서의 위치에 대한 정보를 포함하는 상기 마스터 복제로그를 수신할 수 있다.In
단계(1030)에서 클라이언트 라이브러리(912)는 수행되어야 할 연산의 위치에 대한 정보에 기반하여 슬레이브 저장 기기(900)가 포함하는 복제로그에 저장된 연산을 슬레이브 메모리저장소(943)에 대해 수행할 수 있다. 이때, 마스터 메모리저장소 및 슬레이브 메모리저장소(943)는 동일한 데이터 상태 집합을 가질 수 있고, 저장된 연산에 따라 동일한 연산결과를 가질 수 있다.The
도 9 및 도 10에서 생략된 내용은 도 1 내지 도 8을 참조할 수 있다.The contents omitted in Figs. 9 and 10 can be referred to Fig. 1 to Fig.
이와 같이, 본 발명의 실시예들에 따르면, 저장된 데이터의 상태 집합을 의미하는 메모리저장소의 상태의 전이가, 메모리저장소에 대해 제공되는 연산의 수행에 의해 확정적으로 일어나며, 연산의 수행 결과도 동일하다는 특징을 이용하여, 두 메모리저장소에서 수행되는 연산을 선입선출 순서 방식으로 수행함으로써, 두 메모리저장소간의 일관성을 보장하는 복제를 수행할 수 있다.As described above, according to the embodiments of the present invention, the transition of the state of the memory storage, which means a state set of the stored data, is definitively performed by the execution of the operation provided for the memory storage, By using the feature, the operations performed in the two memory repositories are performed in a first-in first-out order manner, so that replication can be performed to ensure consistency between the two memory repositories.
또한, 메모리 사상파일 형태로 복제로그에 대한 읽기 및/또는 쓰기를 수행하고, 디스크로의 플러시(flush)를 주기적으로 및/또는 복제로그에 쓰여진 데이터의 크기에 기반하여 수행함으로써, 복제 흐름에 대한 시간 지연을 최소화할 수 있다.It is also possible to read and / or write to the replication log in the form of a memory mapping file and perform a flush to disk periodically and / or based on the size of the data written to the replication log, Time delay can be minimized.
또한, 기설정된 복제 팩터의 값에 기반하여 복제 팩터의 값 이상의 저장부들로부터 동일한 로그 시퀀스 넘버(Log Sequence Number, LSN)가 수신되는 경우에, 해당 LSN을 커밋 LSN으로 결정하고, 결정된 커밋 LSN까지 메모리저장소에 대한 연산이 순차적으로 수행되도록 하여, 가용성을 복제 팩터만큼 유지함으로써 유실된 데이터를 복구할 수 있다.In addition, when the same log sequence number (LSN) is received from the storage units whose values are equal to or greater than the value of the replication factor based on the value of the predetermined replication factor, the corresponding LSN is determined as the commit LSN, Operations on the repository can be performed sequentially so that lost data can be recovered by maintaining availability as much as the replication factor.
또한, 메모리저장소의 상태 및 메모리저장소에 대해 수행된 연산의 마지막 위치에 해당하는 LSN을 포함하는 체크포인트데이터를 이용하여 메모리저장소의 재 시작 복구를 처리할 수 있다.Also, it is possible to handle the restart of the memory store using the checkpoint data including the LSN corresponding to the state of the memory store and the last position of the operation performed on the memory store.
실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The method according to an embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions to be recorded on the medium may be those specially designed and configured for the embodiments or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.
이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. For example, it is to be understood that the techniques described may be performed in a different order than the described methods, and / or that components of the described systems, structures, devices, circuits, Lt; / RTI > or equivalents, even if it is replaced or replaced.
그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.
Claims (7)
상기 복수의 저장부 중 마스터 저장부에서, 상기 마스터 저장부가 포함하는 마스터 메모리저장소 및 상기 복수의 저장부 중 나머지 저장부인 슬레이브 저장부가 포함하는 슬레이브 메모리저장소 중 적어도 하나에 대해 요청된 연산을 수신하는 단계;
상기 마스터 저장부에서, 상기 수신된 연산을 상기 마스터 저장부가 포함하는 마스터 복제로그에 저장하고, 수행되어야 할 연산의 상기 마스터 복제로그에서의 위치에 대한 정보를 상기 마스터 복제로그에 더 저장하고, 상기 마스터 복제로그를 상기 슬레이브 저장부가 포함하는 슬레이브 복제로그로 전달하여 상기 슬레이브 복제로그와 상기 마스터 복제로그를 동기화하는 단계; 및
상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소가 각각 동일한 연산결과를 포함하도록, 상기 마스터 저장부에서, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 마스터 복제로그에 저장된 연산을 상기 마스터 메모리저장소에 대해 수행하고, 상기 슬레이브 저장부에서, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 슬레이브 복제로그에 저장된 상기 수행된 연산과 동일한 연산을 상기 슬레이브 메모리저장소에 대해 수행하는 단계
를 포함하고,
상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소는, 동일한 데이터 상태 집합을 갖고, 상기 동일한 연산에 따라 동일한 연산결과를 갖는 것을 특징으로 하는 데이터 복제 방법.A data replication method of a data storage system including a plurality of storage units,
Receiving a requested operation on at least one of a master memory storage included in the master storage unit and a slave memory storage included in a slave storage unit that is a remaining storage unit of the plurality of storage units in the master storage unit among the plurality of storage units ;
Storing the received operation in a master replica log included in the master storage unit and further storing information on a position in the master replica log of an operation to be performed in the master replica log, Transferring a master replication log to a slave replication log included in the slave storage unit to synchronize the slave replication log and the master replication log; And
Wherein the master store stores the operations stored in the master replica log in the master memory repository based on information on the location of the operations to be performed in the master store so that the master memory store and the slave memory store each contain the same operation result. And performing, in the slave storage unit, the same operation as that performed in the slave replication log to the slave memory storage based on the information on the location of the operation to be performed
Lt; / RTI >
Wherein the master memory store and the slave memory store have the same data state set and have the same operation result according to the same operation.
상기 요청된 연산을 수신하는 단계는,
상기 마스터 저장부가 포함하는 마스터 클라이언트 라이브러리를 통해 상기 마스터 메모리저장소에 대해 요청된 연산을 수신하거나 또는 상기 슬레이브 저장부가 포함하는 슬레이브 클라이언트 라이브러리를 통해 상기 슬레이브 메모리저장소에 대해 요청된 연산을 수신하고,
상기 동일한 연산을 수행하는 단계는,
상기 마스터 클라이언트 라이브러리에서 상기 마스터 메모리저장소에 대해 상기 동일한 연산을 수행하고, 상기 슬레이브 클라이언트 라이브러리에서 상기 슬레이브 메모리저장소에 대해 상기 동일한 연산을 수행하는 것
을 특징으로 하는 데이터 복제 방법.The method according to claim 1,
Wherein receiving the requested operation comprises:
Receiving a requested operation on the slave memory repository through a slave client library included in the slave storage unit or receiving a requested operation on the slave memory repository through a master client library included in the master storage unit,
Wherein performing the same operation further comprises:
Performing the same operation on the master memory store in the master client library and performing the same operation on the slave memory store in the slave client library
The data copying method comprising the steps of:
상기 마스터 복제로그(또는 상기 슬레이브 복제로그)는, 로그 시퀀스 넘버(Log Sequence Number, LSN)를 통해 상기 마스터 복제로그(또는 상기 슬레이브 복제로그)에서 데이터가 저장된 위치가 표현되고,
수행되어야 할 연산의 상기 마스터 복제로그에서의 위치에 대한 정보를 상기 마스터 복제로그에 더 저장하는 단계는, 상기 마스터 저장부가 포함하는 마스터 리플리케이터에서, 상기 슬레이브 저장부가 포함하는 슬레이브 리플리케이터로부터 상기 슬레이브 복제로그에서 데이터가 저장된 마지막 LSN을 수신하는 단계; 및
상기 마스터 리플리케이터에서, 상기 수신된 LSN에 기반하여 상기 수행되어야 할 연산의 위치에 대한 정보인 커밋(commit) LSN을 결정하는 단계
를 포함하는 것을 특징으로 하는 데이터 복제 방법.The method according to claim 1,
The master replica log (or the slave replica log) is a location where data is stored in the master replica log (or the slave replica log) through a log sequence number (LSN)
Wherein the step of storing further information on a location in the master replica log of the operation to be performed in the master replica log further comprises the steps of, in the master replicator included in the master storage section, Receiving a last LSN in which data is stored; And
Determining, at the master replicator, a commit LSN that is information on the location of the operation to be performed based on the received LSN
Wherein the data copying method comprises:
상기 커밋 LSN을 결정하는 단계는,
상기 슬레이브 리플리케이터 중 기설정된 복제 팩터의 값 이상의 슬레이브 리플리케이터로부터 동일한 LSN이 수신되는 경우, 상기 동일한 LSN을 상기 커밋 LSN으로 결정하는 것
을 특징으로 하는 데이터 복제 방법.The method of claim 3,
The step of determining the commit LSN comprises:
If the same LSN is received from a slave replicator equal to or greater than a value of a predetermined replication factor of the slave replicator, determining the same LSN as the commit LSN
The data copying method comprising the steps of:
복수의 저장부를 포함하고,
상기 복수의 저장부 각각은,
리플리케이터 및 메모리저장소를 포함하고,
상기 복수의 저장부 중 마스터 저장부가 포함하는 마스터 리플리케이터는, 상기 복수의 저장부 각각이 포함하는 메모리저장소들에 대해 수행될 연산의 수행 순서를 선입선출(First In First Out, FIFO) 방식으로 결정하여 상기 마스터 저장부가 포함하는 마스터 복제로그에 저장하고, 수행되어야 할 연산의 상기 마스터 복제로그에서의 위치에 대한 정보를 상기 마스터 복제로그에 더 저장하고,
상기 복수의 저장부 중 슬레이브 저장부의 슬레이브 리플리케이터는, 상기 마스터 복제로그를 수신하여 상기 슬레이브 저장부가 포함하는 슬레이브 복제로그에 저장하여 상기 슬레이브 복제로그와 상기 마스터 복제로그를 동기화하고,
상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소가 각각 동일한 연산결과를 포함하도록, 상기 마스터 리플리케이터는, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 마스터 복제로그에 저장된 연산을 상기 마스터 저장부가 포함하는 메모리저장소에 대해 수행하고, 상기 슬레이브 리플리케이터는, 상기 수행되어야 할 연산의 위치에 대한 정보에 기반하여 상기 슬레이브 복제로그에 저장된 상기 수행된 연산과 동일한 연산을 상기 슬레이브 저장부가 포함하는 메모리저장소에 대해 수행하고,
상기 마스터 메모리저장소 및 상기 슬레이브 메모리저장소는, 동일한 데이터 상태 집합을 갖고, 상기 동일한 연산에 따라 동일한 연산결과를 갖는 것
을 특징으로 하는 데이터 저장 시스템.In a data storage system,
A plurality of storage units,
Wherein each of the plurality of storage units comprises:
A replicator and a memory storage,
The master replicator included in the master storage unit of the plurality of storage units determines the order of operations to be performed on the memory stores included in each of the plurality of storage units by first in first out (FIFO) Storing information in a master replica log included in the master storage section and information on a location in the master replica log of an operation to be performed,
Wherein the slave replicator of the slave storage unit among the plurality of storage units receives the master replication log and stores the master replication log in a slave replication log included in the slave storage unit to synchronize the slave replication log and the master replication log,
Wherein the master replicator includes an operation stored in the master replica log based on information on the location of the operation to be performed, the master replicator including the master storage unit and the slave memory storage unit, Wherein the slave replicator performs an operation on the memory storage including the slave storage unit based on the information about the location of the operation to be performed, the same operation as the operation performed in the slave replication log and,
Wherein the master memory store and the slave memory store have the same data state set and have the same operation result according to the same operation
And the data storage system.
상기 마스터 리플리케이터는,
상기 복수의 저장부 각각이 더 포함하는 클라이언트 라이브러리를 통해 상기 복수의 저장부 각각이 포함하는 메모리저장소에 대해 요청된 연산을 수신하고,
상기 마스터 저장부의 마스터 클라이언트 라이브러리에서 상기 마스터 메모리저장소에 대해 상기 동일한 연산을 수행하고, 상기 슬레이브 저장부가 더 포함하는 클라이언트 라이브러리에서 상기 슬레이브 메모리저장소에 대해 상기 동일한 연산을 수행하는 것
을 특징으로 하는 데이터 저장 시스템.The method according to claim 6,
The master replicator includes:
Wherein each of the plurality of storage units receives a requested operation for a memory storage included in each of the plurality of storage units via a client library,
Performing the same operation on the master memory storage in the master client library of the master storage unit and performing the same operation on the slave memory storage in the client library further including the slave storage unit
And the data storage system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020170026292A KR101786874B1 (en) | 2017-02-28 | 2017-02-28 | Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020170026292A KR101786874B1 (en) | 2017-02-28 | 2017-02-28 | Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020140100361A Division KR101713537B1 (en) | 2014-08-05 | 2014-08-05 | Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20170026434A KR20170026434A (en) | 2017-03-08 |
KR101786874B1 true KR101786874B1 (en) | 2017-10-18 |
Family
ID=58404847
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020170026292A KR101786874B1 (en) | 2017-02-28 | 2017-02-28 | Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101786874B1 (en) |
-
2017
- 2017-02-28 KR KR1020170026292A patent/KR101786874B1/en active IP Right Grant
Also Published As
Publication number | Publication date |
---|---|
KR20170026434A (en) | 2017-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8977826B1 (en) | Extent commands in replication | |
US8689047B2 (en) | Virtual disk replication using log files | |
JP4727437B2 (en) | Storage control method for storage system having database | |
US7039661B1 (en) | Coordinated dirty block tracking | |
JP5559821B2 (en) | Method for storing data, method for mirroring data, machine-readable medium carrying an instruction sequence, and program for causing a computer to execute the method | |
US8250033B1 (en) | Replication of a data set using differential snapshots | |
US6950915B2 (en) | Data storage subsystem | |
US8271447B1 (en) | Mirroring metadata in a continuous data protection environment | |
US9910592B2 (en) | System and method for replicating data stored on non-volatile storage media using a volatile memory as a memory buffer | |
US10831741B2 (en) | Log-shipping data replication with early log record fetching | |
US7685385B1 (en) | System and method for satisfying I/O requests before a replica has been fully synchronized | |
US8024537B2 (en) | Storage system, remote copy and management method therefor | |
WO2014059804A1 (en) | Method and system for data synchronization | |
WO2023046042A1 (en) | Data backup method and database cluster | |
US20110225382A1 (en) | Incremental replication using snapshots | |
JP2005309793A (en) | Data processing system | |
WO2019109256A1 (en) | Log management method, server and database system | |
US8639660B1 (en) | Method and apparatus for creating a database replica | |
US8977897B2 (en) | Computer-readable recording medium, data management method, and storage device | |
CN110121712A (en) | A kind of blog management method, server and Database Systems | |
US8918364B1 (en) | Online mirror state transitioning in databases | |
KR101786874B1 (en) | Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log | |
CN115658245A (en) | Transaction submitting system, method and device based on distributed database system | |
KR101713537B1 (en) | Data replication method and data storage system for processing state machine based replication guaranteeing consistency of data and distributed recovery using check point data and replication log | |
US10740007B2 (en) | Synchronized primary-secondary role swaps with synchronized safe data commit scans |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A107 | Divisional application of patent | ||
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant |