KR20200044660A - Method and apparatus for logging based on barrier - Google Patents

Method and apparatus for logging based on barrier Download PDF

Info

Publication number
KR20200044660A
KR20200044660A KR1020190061978A KR20190061978A KR20200044660A KR 20200044660 A KR20200044660 A KR 20200044660A KR 1020190061978 A KR1020190061978 A KR 1020190061978A KR 20190061978 A KR20190061978 A KR 20190061978A KR 20200044660 A KR20200044660 A KR 20200044660A
Authority
KR
South Korea
Prior art keywords
write
order
barrier
data
storage
Prior art date
Application number
KR1020190061978A
Other languages
Korean (ko)
Other versions
KR102132387B1 (en
Inventor
원유집
Original Assignee
한양대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한양대학교 산학협력단 filed Critical 한양대학교 산학협력단
Publication of KR20200044660A publication Critical patent/KR20200044660A/en
Application granted granted Critical
Publication of KR102132387B1 publication Critical patent/KR102132387B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

According to an embodiment of the present invention, provided is a method in which a host performs logging to a storage. The method comprises the steps of: calling a plurality of order guarantee write requests which support guarantee of a write order in a storage with regard to block data, which is data corresponding to at least one updated data block, and journal head data, which is data corresponding to a journal head; calling a synchronization command to transmit a plurality of write commands including a barrier-based write command for writing the block data and the journal head data in the storage in a predetermined order; and calling the order guarantee write request with regard to commit data, which is data corresponding to a commit block.

Description

배리어 기반 로깅 방법 및 장치{METHOD AND APPARATUS FOR LOGGING BASED ON BARRIER}Barrier-based logging method and device {METHOD AND APPARATUS FOR LOGGING BASED ON BARRIER}

본 발명은 배리어 기반 로깅을 수행하는 방법 및 배리어 기반 로깅을 지원하는 컴퓨팅 장치에 관한 것이다.The present invention relates to a method for performing barrier-based logging and a computing device supporting barrier-based logging.

파일 시스템이나 데이터베이스에서는 예측하지 못한 정전, 시스템 정지 등 불의의 사건으로부터 정보를 보호하기 위해 저널링 혹은 데이터베이스 로깅이라는 기법을 사용한다. 즉, 로그 영역에 갱신된 내용을 기록한 후에, 추후에 갱신된 내용을 실제 위치에 반영하는 기법이다. 이를 흔히 write-ahead-logging(로깅)이라 한다. 이러한 로깅을 통하여 안전하게 저장된 트랜잭션들은 원자성과 영속성을 보장 받는다. 또한, 로깅을 통해서 저장되는 블록들의 집합을 저널 트랜잭션이라 한다. 하나의 저널 트랜잭션은 트랜잭션 헤더 블록, 갱신된 블록들 그리고 커밋 블록으로 구성된다. 이때, 일반적으로 저널 트랜잭션은 다음 두 가지 방법 중의 하나로 저장된다.In a file system or database, a technique called journaling or database logging is used to protect information from unexpected events such as unexpected power outages and system outages. That is, after recording the updated contents in the log area, the updated contents are reflected in the actual location later. This is commonly called write-ahead-logging. Through this logging, safely stored transactions are guaranteed atomicity and persistence. In addition, a set of blocks stored through logging is called a journal transaction. A journal transaction consists of a transaction header block, updated blocks, and a commit block. At this time, journal transactions are generally stored in one of two ways.

첫번째로, 트랜잭션 헤더 블록과 갱신된 블록들에 대한 쓰기 명령을 호출한다. 그리고, 해당 블록들의 쓰기 명령이 모두 처리되면 플러시 명령을 호출한다. 플러시 명령을 요청한 후에, 커밋 블록에 대한 쓰기 명령을 호출한다. 그 후, 커밋 블록을 디스크에 안전하게 기록하기 위한 플러시 명령을 호출한다.First, it calls the write command for the transaction header block and the updated blocks. Then, when all write commands of the corresponding blocks are processed, a flush command is called. After requesting the flush command, the write command for the commit block is called. Then, it calls a flush command to safely write the commit block to disk.

두번째로, 커밋 블록에 트랜잭션 헤더 블록, 갱신된 블록들에 대한 체크섬을 기록한다. 트랜잭션 헤더 블록, 갱신된 블록, 커밋 블록에 대한 쓰기 명령을 호출한다. 쓰기 명령을 호출한 후에 플러시 명령어를 호출한다.Second, the transaction header block and the checksum for the updated blocks are recorded in the commit block. Call write commands for the transaction header block, the updated block, and the commit block. After calling the write command, the flush command is called.

이러한 종래 기술들의 목적은 저널 트랜잭션에 관련된 블록들이 빠짐없이 기록되었는지 파악하는 것이다. 첫번째 방법을 통해 커밋 블록이 안전하게 저장되는 것을 확인한 순간, 갱신된 블록들도 모두 안전하게 저장되었음을 담보한다. 두번째 방법에서는 복구 과정에서 하나의 트랜잭션에 속한 저널 헤드 블록과 로그 블록들에 대한 체크섬을 계산한 후, 관련 커밋 블록에 기록된 체크섬 값과 비교한다. 이 두 개의 값이 일치하면 저널 트랜잭션이 안전하게 저장된 것으로 판단한다. The purpose of these prior arts is to find out whether blocks related to journal transactions have been completely written. The moment you confirm that the commit block is safely stored through the first method, it ensures that all the updated blocks are also safely stored. In the second method, in the recovery process, checksums for journal head blocks and log blocks belonging to a transaction are calculated, and then compared with the checksum values recorded in the related commit block. If these two values match, it is judged that the journal transaction is safely stored.

그러나, 첫번째 방법은 성능 병목이 존재한다. 즉, 하나의 저널 트랜잭션을 커밋하기 위하여 두 차례의 플러시 호출이 사용되므로 엄청난 성능저하가 존재한다. 또한, 두번째 방법은 체크섬 충돌 위험과 성능 병목이 존재한다. 체크섬은 실제 값을 보다 작은 값으로 표현하는 기법인데 나머지 연산(modular 연산)등이 사용된다. 블록 중 일부가 유실되어 제대로 기록이 되지 않았음에도 불구하고, 불완전한 로그 블록들을 기반으로 계산한 체크섬이 커밋 블록에 기록된 체크섬과 일치할 가능성이 있다. 이러한 체크섬 충돌이 발생하면, 파일시스템이나 데이터베이스가 잘못된 상태로 복구될 수 있다. 또 하나의 문제점은 체크섬 계산 오버헤드이다. 초고속 네트워크를 통해 연결된 클라우드 서버의 경우, 네트워크 망을 통해서 저널 트랜잭션들이 매우 빠른 속도로 서버에 도착한다. 고속으로 도착하는 저널 트랜잭션들에 대해서 각각의 체크섬을 구하는 것은 병목이 된다.However, the first method has a performance bottleneck. That is, two flush calls are used to commit one journal transaction, so there is a huge performance penalty. In addition, the second method has a checksum collision risk and performance bottlenecks. Checksum is a technique of expressing the actual value as a smaller value, and the remaining operations (modular operation) are used. Although some of the blocks were lost and not properly recorded, there is a possibility that the checksum calculated based on incomplete log blocks matches the checksum recorded in the commit block. When such a checksum collision occurs, the file system or database may be restored to an incorrect state. Another problem is the checksum calculation overhead. In the case of a cloud server connected through a high-speed network, journal transactions arrive at the server at a very high rate through the network. Finding each checksum for journal transactions arriving at high speed becomes a bottleneck.

관련 선행기술로는 대한민국 공개특허공보 제10-2017-0141184호(발명의 명칭 : 로깅 장치 및 로깅 방법)가 있다.A related prior art is Korean Patent Publication No. 10-2017-0141184 (name of invention: logging device and logging method).

본 발명은 트랜잭션 헤더 블록과 갱신된 블록이 먼저 스토리지에 기록되고, 커밋 블록이 그 후 기록되도록 보장하는 배리어 기반 로깅을 수행하는 방법 및 배리어 기반 로깅을 지원하는 컴퓨팅 장치를 제공하고자 한다.An object of the present invention is to provide a computing device supporting barrier-based logging and a method for performing barrier-based logging to ensure that a transaction header block and an updated block are first written to storage, and a commit block is then written.

본 발명이 해결하고자 하는 과제는 이상에서 언급한 과제(들)로 제한되지 않으며, 언급되지 않은 또 다른 과제(들)은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problem to be solved by the present invention is not limited to the problem (s) mentioned above, and another problem (s) not mentioned will be clearly understood by those skilled in the art from the following description.

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 배리어 기반 로깅 방법은 적어도 하나의 갱신된 데이터 블록에 해당하는 데이터인 블록데이터 및 저널 헤드에 해당하는 데이터인 저널헤드데이터에 대하여, 상기 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출하는 단계; 상기 블록데이터 및 상기 저널헤드데이터를 상기 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 상기 스토리지에게 전송하는 동기화 명령을 호출하는 단계; 및 커밋 블록에 해당하는 데이터인 커밋데이터에 대하여, 상기 순서 보장 쓰기 요청을 호출하는 단계를 포함한다.In order to achieve the above object, a barrier-based logging method according to an embodiment of the present invention provides for block data, which is data corresponding to at least one updated data block, and journal head data, which is data corresponding to a journal head, in the storage. Calling a plurality of order guarantee write requests to support the guarantee of the write order of; Calling a synchronization command to transmit a plurality of write commands including a barrier-based write command for writing the block data and the journal head data to the storage in a predetermined order; And invoking the order guarantee write request for the commit data, which is data corresponding to the commit block.

바람직하게는, 상기 동기화 명령을 호출하는 단계는 상기 복수의 순서 보장 쓰기 요청 중 마지막으로 호출된 요청을 상기 스토리지에서의 기록 순서가 보장되는 기준이 되는 배리어 기반 쓰기 명령으로 설정하는 단계; 상기 마지막으로 호출된 요청을 제외한 적어도 하나의 요청을 상기 배리어 기반 쓰기 명령의 이전에 처리되는 순서 보장 쓰기 명령으로 설정하는 단계; 및 상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령을 상기 스토리지에게 전송하는 단계를 포함할 수 있다..Preferably, the step of invoking the synchronization command may include setting a last called request among the plurality of order guarantee write requests as a barrier-based write command that is a criterion for guaranteeing a write order in the storage; Setting at least one request other than the last called request to an order guaranteed write command processed before the barrier-based write command; And transmitting the at least one order guarantee write command and the barrier-based write command to the storage.

바람직하게는, 상기 스토리지에게 전송하는 단계의 이후에, 상기 동기화 명령의 종류에 따라, 반환하거나 상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령이 상기 스토리지에서 처리된 이후 반환하는 단계를 더 포함할 수 있다.Preferably, after the step of transmitting to the storage, depending on the type of the synchronization command, return or return after the at least one order guarantee write command and the barrier-based write command are processed in the storage. It can contain.

또한, 상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 배리어 기반 데이터 기록 순서 보장 방법은 갱신된 데이터 블록에 해당하는 데이터인 복수의 블록데이터에 대하여, 상기 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출하는 단계; 상기 복수의 블록데이터를 상기 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 상기 스토리지에게 전송하는 동기화 명령을 호출하는 단계; 및 다른 갱신된 데이터 블록에 해당하는 데이터인 해당하는 후속블록데이터에 대하여, 상기 순서 보장 쓰기 요청을 호출하는 단계를 포함한다.In addition, the barrier-based data recording order guarantee method according to an embodiment of the present invention for achieving the above object, for a plurality of block data corresponding to the updated data block, supports the guarantee of the recording order in the storage Calling a plurality of order guarantee write requests; Calling a synchronization command to transmit a plurality of write commands including a barrier-based write command to write the plurality of block data to the storage in a predetermined order; And invoking the order guarantee write request for corresponding subsequent block data that is data corresponding to another updated data block.

또한, 상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 배리어 기반 로깅을 지원하는 컴퓨팅 장치는 기록 순서의 보장을 지원하는 파일 시스템을 운영하는 소프트웨어가 탑재된 스토리지; 및 상기 스토리지에 탑재된 소프트웨어를 운영하는 프로세서를 포함하고, 상기 프로세서는 적어도 하나의 갱신된 데이터 블록에 해당하는 데이터인 블록데이터 및 저널 헤드에 해당하는 데이터인 저널헤드데이터에 대하여, 상기 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출하고, 상기 블록데이터 및 상기 저널헤드데이터를 상기 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 상기 스토리지에게 전송하는 동기화 명령을 호출하고, 커밋 블록에 해당하는 데이터인 커밋데이터에 대하여, 상기 순서 보장 쓰기 요청을 호출한다.In addition, a computing device supporting barrier-based logging according to an embodiment of the present invention for achieving the above object includes a storage on which software for operating a file system supporting guarantee of a recording order is mounted; And a processor for operating software mounted on the storage, wherein the processor is configured to block data, which is data corresponding to at least one updated data block, and journal head data, which is data corresponding to a journal head, in the storage. The plurality of write commands including a barrier-based write command for invoking a plurality of order guarantee write requests that support the guarantee of the write order, and writing the block data and the journal head data to the storage in a predetermined order, are stored in the storage. A synchronization command to be transmitted is called, and the order guarantee write request is called for the commit data, which is data corresponding to the commit block.

바람직하게는, 상기 프로세서가 상기 동기화 명령을 호출할 때, 상기 동기화 명령은 상기 복수의 순서 보장 쓰기 요청 중 마지막으로 호출된 요청을 상기 스토리지에서의 기록 순서가 보장되는 기준이 되는 배리어 기반 쓰기 명령으로 설정하고, 상기 마지막으로 호출된 요청을 제외한 적어도 하나의 요청을 상기 배리어 기반 쓰기 명령의 이전에 처리되는 순서 보장 쓰기 명령으로 설정하고, 상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령을 상기 스토리지에게 전송할 수 있다.Preferably, when the processor calls the synchronization command, the synchronization command is a barrier-based write command that serves as a criterion for guaranteeing a write order in the storage. Set, set at least one request except the last called request to a sequence guaranteed write command processed before the barrier based write command, and set the at least one sequence guaranteed write command and the barrier based write command to the Can be transferred to storage.

바람직하게는, 상기 동기화 명령은 상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령을 상기 스토리지에게 전송한 이후에, 상기 동기화 명령의 종류에 따라, 반환하거나 상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령이 상기 스토리지에서 처리된 이후 반환할 수 있다.Preferably, after the synchronization command transmits the at least one order guarantee write command and the barrier-based write command to the storage, it returns or, depending on the type of the sync command, the at least one order guarantee write command and The barrier-based write command may be returned after being processed in the storage.

본 발명은 트랜잭션 헤더 블록과 갱신된 블록이 먼저 스토리지에 기록되고, 커밋 블록이 그 후 기록되도록 보장하는 효과가 있다.The present invention has an effect of ensuring that the transaction header block and the updated block are written to storage first, and the commit block is written after that.

또한, 본 발명은 배리어 기반 로깅 기술을 적용함으로써, 종래의 기술에서 발생하는 성능 병목과 체크섬 충돌 문제를 회피할 수 있는 효과가 있다.In addition, the present invention has an effect of avoiding performance bottlenecks and checksum collision problems that occur in the prior art by applying a barrier-based logging technique.

도 1은 종래의 기술에 따른 호스트와 스토리지 간의 데이터 입출력 과정을 설명하기 위한 도면이다.
도 2는 종래의 기술에 따른 EXT4 파일시스템의 동기화 명령인 fsync()의 동작 과정을 설명하기 위한 도면이다.
도 3은 본 발명의 일 실시예에 따른 순서 보장 입출력 스택을 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시예에 따른 배리어 기반 로깅 방법을 설명하기 위한 흐름도이다.
도 5는 본 발명의 일 실시예에 따른 배리어 기반 데이터 기록 순서 보장 방법을 설명하기 위한 흐름도이다.
도 6은 본 발명의 일 실시예에 따른 동기화 함수의 동작 방법을 설명하기 위한 흐름도이다.
도 7은 본 발명의 일 실시예에 따른 배리어 기반 로깅을 지원하는 컴퓨팅 장치를 설명하기 위한 블록도이다.
1 is a view for explaining a data input and output process between the host and the storage according to the prior art.
2 is a view for explaining an operation process of fsync (), which is a synchronization command of the EXT4 file system according to the prior art.
3 is a view for explaining a sequence guaranteed input / output stack according to an embodiment of the present invention.
4 is a flowchart illustrating a barrier-based logging method according to an embodiment of the present invention.
5 is a flowchart illustrating a method for guaranteeing a barrier-based data recording order according to an embodiment of the present invention.
6 is a flowchart illustrating a method of operating a synchronization function according to an embodiment of the present invention.
7 is a block diagram illustrating a computing device supporting barrier-based logging according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.The present invention can be applied to various changes and may have various embodiments, and specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, and should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention. In describing each drawing, similar reference numerals are used for similar components.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first, second, A, and B can be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from other components. For example, the first component may be referred to as a second component without departing from the scope of the present invention, and similarly, the second component may be referred to as a first component. The term and / or includes a combination of a plurality of related described items or any one of a plurality of related described items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When an element is said to be "connected" or "connected" to another component, it is understood that other components may be directly connected to or connected to the other component, but other components may exist in the middle. It should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that no other component exists in the middle.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terms used in this application are only used to describe specific embodiments, and are not intended to limit the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "include" or "have" are intended to indicate the presence of features, numbers, steps, actions, components, parts or combinations thereof described herein, one or more other features. It should be understood that the existence or addition possibilities of fields or numbers, steps, operations, components, parts or combinations thereof are not excluded in advance.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by a person skilled in the art to which the present invention pertains. Terms such as those defined in a commonly used dictionary should be interpreted as having meanings consistent with meanings in the context of related technologies, and should not be interpreted as ideal or excessively formal meanings unless explicitly defined in the present application. Does not.

도 1은 종래의 기술에 따른 호스트와 스토리지 간의 데이터 입출력 과정을 설명하기 위한 도면이다.1 is a view for explaining a data input and output process between the host and the storage according to the prior art.

도 1을 참조하면, 호스트에서 운영되는 파일시스템은 IO 스케줄러 큐(IO scheduler queue)에 쓰기 요청(write request)를 입력한다. 그리고, 블록 디바이스 드라이버는 IO 스케줄러 큐로부터 하나 이상의 쓰기 요청을 제거하여, 이로부터 쓰기 명령(write command)를 구성한다. 그리고, 블록 디바이스 드라이버는 가능한 경우에 그 쓰기 명령을 스토리지 디바이스에게 전달한다. 이때, 스토리지 디바이스의 커맨드 큐(command queue)가 가득차 있지 않으면, 가능한 경우에 해당할 수 있다. 또한, 스토리지 컨트롤러(storage controller)는 커맨드 큐로부터 그 전달된 쓰기 명령을 제거하고, 호스트로부터 그 쓰기 명령에 관련 데이터를 수신하여 캐시에 저장한다. 수신이 완료되면, 스토리지는 호스트에 시그널을 전송한다. 한편, 캐시에 저장된 데이터는 주기적으로 또는 호스트로부터의 명시적인 요청에 의하여 스토리지 표면에 기록된다.Referring to FIG. 1, a file system operating on a host inputs a write request into an IO scheduler queue. Then, the block device driver removes one or more write requests from the IO scheduler queue, thereby constructing a write command. In addition, the block device driver transmits the write command to the storage device when possible. At this time, if the command queue of the storage device is not full, it may be possible. In addition, the storage controller removes the transmitted write command from the command queue, and receives data related to the write command from the host and stores it in a cache. When reception is complete, the storage sends a signal to the host. Meanwhile, data stored in the cache is written to the storage surface periodically or by an explicit request from the host.

여기서, 쓰기 요청의 입력 순서(I), 쓰기 명령 전달 순서(D), 데이터 전송 순서(X) 및 데이터 기록 순서(P)를 고려할 때, 다음과 같은 순서 상의 불일치가 존재할 수 있다.Here, when considering the input order (I) of the write request, the write command transfer order (D), the data transfer order (X), and the data write order (P), there may be a discrepancy in the following order.

우선, I와 D가 불일치할 수 있다. 이는, IO 스케줄러가 쓰기 요청을 스케줄링 원칙에 따라 재배치(reorder)하거나 병합(coalescence)할 수 있기 때문이다.First, I and D may be inconsistent. This is because the IO scheduler can reorder or merge write requests according to the scheduling principle.

또한, D와 X가 불일치할 수 있다. 이는, 스토리지 컨트롤러가 자유롭게 커맨드 큐의 쓰기 명령의 순서를 조정할 수 있기 때문이다.Also, D and X may be inconsistent. This is because the storage controller can freely adjust the order of write commands in the command queue.

또한, X와 P가 불일치할 수 있다. 이는, 스토리지의 캐시가 FIFO가 아니기 때문이다. 즉, 플래시 기반 스토리지에서, 데이터 기록 순서는 캐시에 기록된 순서가 아니라, 관련된 맵핑 테이블에 기록된 순서에 따라 결정될 수 있다.Also, X and P may be inconsistent. This is because the cache of storage is not a FIFO. That is, in the flash-based storage, the data writing order may be determined according to the order recorded in the associated mapping table, not the order recorded in the cache.

이러한 다양한 순서 상의 불확실성 때문에, 현대의 IO 스택을 이용한 데이터 입출력 과정은 전 과정을 통해 순서가 지켜지기 어려운 것으로 인식되어 왔다.Because of these various order uncertainties, it has been recognized that the order of data input / output using a modern IO stack is difficult to follow through the entire process.

도 2는 종래의 기술에 따른 EXT4 파일시스템의 동기화 명령인 fsync()의 동작 과정을 설명하기 위한 도면이다.2 is a view for explaining an operation process of fsync (), which is a synchronization command of the EXT4 file system according to the prior art.

EXT4(extended file system 4)는 리눅스의 대표적인 저널링 파일 시스템으로, 기존 EXT3 파일 시스템의 향상된 버전이다. 저널링 파일 시스템은 파일 시스템에 변경사항을 반영(commit)하기 전에, 저널안에 생성되는 변경사항을 추적하여 기록하는 파일 시스템이다. 이를 통해, 시스템 충돌이나 전원 문제가 발생할 때 초래될 수 있는 시스템의 손상을 최소화할 수 있는 효과가 있다.EXT4 (extended file system 4) is a representative journaling file system in Linux and is an improved version of the existing EXT3 file system. A journaling file system is a file system that tracks and records changes made in a journal before committing changes to the file system. Through this, it is possible to minimize damage to the system that may be caused when a system crash or a power problem occurs.

EXT4 파일 시스템에서는 기록 순서를 제어하기 위하여 fsync() 함수를 이용한다. Ordered모드(default)에서는 데이터 블록(D)이 저널 트랜잭션에 앞서 기록된다.In the EXT4 file system, fsync () function is used to control the recording order. In the ordered mode (default), the data block D is recorded prior to the journal transaction.

우선, 파일 시스템이 데이터 블록(D)에 대한 쓰기 요청을 입력한다. 이때, 데이터 블록(D)은 다른 파일들에 대한 복수의 블록일 수 있다. 그 후, 어플리케이션 쓰레드는 DMA 전송이 완료될 때까지 대기한다. 그리고, DMA 전송이 완료되면 그 어플리케이션 쓰레드는 JBD 쓰레드를 동작시켜 저널 트랜잭션을 반영하도록 한다. 그 후, 그 어플리케이션 쓰레드는 다시 슬립 상태로 진입하며, JBD 쓰레드가 저널 트랜잭션을 모두 기록한 후, 반환(return)한다.First, the file system inputs a write request for the data block D. In this case, the data block D may be a plurality of blocks for different files. Thereafter, the application thread waits until the DMA transfer is completed. Then, when the DMA transfer is completed, the application thread operates the JBD thread to reflect the journal transaction. After that, the application thread enters the sleep state again, and the JBD thread records all journal transactions and returns.

보다 구체적으로, 저널 트랜잭션은 두개의 쓰기 요청을 통해 반영될 수 있다. 이는, 저널 디스크립터 블록 및 로그 블록(JD)과 커밋 블록(JC)이다. 또한, 저널 트랜잭션을 반영하는 과정에서, JBD 쓰레드는 단일 트랜잭션 내부에서, 그리고 트랜잭션들 간에서 그 기록 순서를 유지할 필요가 있다. More specifically, the journal transaction can be reflected through two write requests. These are the journal descriptor block and log block (JD) and commit block (JC). Also, in the process of reflecting journal transactions, JBD threads need to maintain their record order within a single transaction and between transactions.

단일 트랜잭션 내부에서는, JBD 쓰레드가 JD를 JC보다 먼저 기록해야 할 필요가 있다. 즉, JBD 쓰레드는 JD가 JC보다 먼저 기록되도록, Transfer-and-Flush 기법을 이용할 수 있다. 이때, Transfer-and-Flush 기법은 JD에 관한 데이터가 DMA를 통해 전송(transfer)되고, 스토리지에 기록(flush)되는 동안 대기한 후, JC에 관한 데이터가 DMA를 통해 전송(transfer)되고, 스토리지에 기록(flush)되도록 함으로써, 그 기록 순서를 지키는 것이다.Inside a single transaction, the JBD thread needs to write the JD before the JC. That is, the JBD thread can use the Transfer-and-Flush technique so that the JD is written before the JC. At this time, the Transfer-and-Flush technique transfers data related to JD through DMA, waits while being flushed to storage, and then data related to JC is transferred through DMA, and stores By being flushed, the order of writing is kept.

또한, 트랜잭션들 간에는, JBD 쓰레드가 저널 트랜잭션의 요청 순서에 따라서 그 트랜잭션들이 기록되도록 해야 할 필요가 있다.Also, between transactions, it is necessary for the JBD thread to have the transactions recorded according to the request order of the journal transaction.

이처럼, EXT4 파일 시스템에서는 fsync()를 이용한 동기화 과정에서, 여러 차례의 컨텍스트 스위치가 발생하며, 데이터 전송과 기록에 따른 대기 시간이 요구되어 전송 오버헤드, 플러시 오버헤드가 필연적으로 발생하게 된다.As described above, in the synchronization process using fsync () in the EXT4 file system, multiple context switches are generated, and a wait time according to data transmission and recording is required, which inevitably causes transmission overhead and flush overhead.

도 3은 본 발명의 일 실시예에 따른 순서 보장 입출력 스택을 설명하기 위한 도면이다.3 is a view for explaining a sequence guaranteed input / output stack according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 순서 보장 입출력 스택은 순서 보장 블록 디바이스 레이어에서 새롭게 정의된 배리어 기반 쓰기 명령, 순서 보장 디스패치 모듈(order preserving dispatch module), 에포크 기반 IO 스케줄러(Epoch-based IO scheduler)로 구성될 수 있다. 이와 같은 구성들을 이용함으로써, Transfer-and-Flush 기법을 이용하지 않고도, 부분적으로 쓰기 요청에 대한 순서가 스토리지에까지 반영될 수 있다.The order guarantee input / output stack according to an embodiment of the present invention is a barrier-based write command newly defined in the order guarantee block device layer, an order preserving dispatch module, and an epoch-based IO scheduler. Can be configured. By using such configurations, the order of a write request can be partially reflected to storage without using a transfer-and-flush technique.

보다 구체적으로, 순서 보장 블록 디바이스 레이어는 쓰기 요청을 두 종류로 구분한다. 순서 보장 쓰기 요청과 순서 없는 쓰기 요청이 그것이다. 여기서, 순서 보장 쓰기 요청은 스토리지 기록 순서가 보장되도록 하기 위한 쓰기 요청이다. More specifically, the order guarantee block device layer divides the write request into two types. These are ordered write requests and ordered write requests. Here, the order guarantee write request is a write request for ensuring the storage write order.

또한, 순서 보장 쓰기 요청의 집합으로, 그 집합 내부에서는 기록 순서가 변경가능한 단위가 에포크이다. 또한, 순서 보장 쓰기 요청에 대응되는 순서 보장 쓰기 명령 중에서 특별한 하나의 타입이 배리어 기반 쓰기 명령이다. 즉, 배리어 기반 쓰기 명령은 에포크를 분류하기 위하여 이용되며, 그 전후의 순서 보장 쓰기 명령 간의 스토리지에서의 기록 순서가 보장된다.Also, as a set of order guarantee write requests, an epoch is a unit in which the recording order is changeable within the set. In addition, one special type of order guarantee write commands corresponding to order guarantee write requests is a barrier-based write command. That is, the barrier-based write command is used to classify epochs, and the order of writes in the storage between the order guarantee write commands before and after is guaranteed.

이때, 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령에는 각각 새로운 속성인 REQ_ORDERED 및 REQ_BARRIER가 이용될 수 있다. 즉, 일반적인 순서 보장 쓰기 명령에는 REQ_ORDERED가 이용되고, 배리어 기반 쓰기 명령에는 REQ_ORDERED와 REQ_BARRIER가 함께 이용될 수 있다.At this time, new attributes REQ_ORDERED and REQ_BARRIER may be used for the order guarantee write command and the barrier-based write command, respectively. That is, REQ_ORDERED may be used for a general order guarantee write command, and REQ_ORDERED and REQ_BARRIER may be used for a barrier-based write command.

도 4는 본 발명의 일 실시예에 따른 배리어 기반 로깅 방법을 설명하기 위한 흐름도이다.4 is a flowchart illustrating a barrier-based logging method according to an embodiment of the present invention.

이때, 호스트가 스토리지에 배리어 기반 로깅을 수행할 수 있다.At this time, the host may perform barrier-based logging to the storage.

단계 S410에서는, 호스트가 적어도 하나의 갱신된 데이터 블록에 해당하는 데이터인 블록데이터 및 저널 헤드에 해당하는 데이터인 저널헤드데이터에 대하여, 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출한다.In step S410, the host requests a plurality of order guarantee writes to support block data, which is data corresponding to at least one updated data block, and journal head data, which is data corresponding to a journal head, to guarantee the recording order in storage. Call

여기서, 블록데이터 및 저널헤드데이터는 단일 트랜잭션을 구성하는 총 3가지 요소 가운데 2개로서, 나머지 하나는 아래에서 언급할 커밋데이터이다.Here, the block data and the journal head data are two of a total of three elements constituting a single transaction, and the other is the commit data to be mentioned below.

이때, 호스트는 로깅을 위해서, 블록데이터 및 저널헤드데이터를 커밋데이터보다 앞서 스토리지에 기록해야 한다. 이를 위해, 호스트는 블록데이터 및 저널헤드데이터 각각에 대하여 순서 보장 쓰기 요청을 호출할 수 있다. At this time, the host needs to write block data and journal head data to storage prior to commit data for logging. To this end, the host may call an order guarantee write request for each block data and journal head data.

그러나, 호스트의 순서 보장 쓰기 요청이 곧바로 스토리지에서의 기록 순서를 보장하는 것은 아니며, 이를 위해 아래의 단계가 필요할 수 있다.However, the host's order guarantee write request does not immediately guarantee the write order in storage, and the following steps may be necessary for this.

단계 S420에서는, 호스트가 그 블록데이터 및 저널헤드데이터를 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 스토리지에게 전송하는 동기화 명령을 호출한다.In step S420, the host calls a synchronization command to transmit a plurality of write commands including a barrier-based write command for writing the block data and journal head data to the storage in a predetermined order.

즉, 호스트는 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 스토리지에게 전송함으로써, 그 블록데이터 및 저널헤드데이터가 소정의 순서로 스토리지에 기록되도록 할 수 있다. 이때, 복수의 쓰기 명령은 하나의 배리어 기반 쓰기 명령과 적어도 하나의 순서 보장 쓰기 명령으로 구성될 수 있다.That is, the host may transmit a plurality of write commands including a barrier-based write command to the storage so that the block data and journal head data are written to the storage in a predetermined order. At this time, the plurality of write commands may be composed of one barrier-based write command and at least one order guarantee write command.

마지막으로 단계 S430에서는, 호스트가 커밋 블록에 해당하는 데이터인 커밋데이터에 대하여, 순서 보장 쓰기 요청을 호출한다.Finally, in step S430, the host calls the order guarantee write request for the commit data, which is data corresponding to the commit block.

즉, 호스트는 이미 블록데이터 및 저널헤드데이터가 스토리지에 저장되었기 때문에, 커밋데이터를 스토리지에 기록하기 위하여 순서 보장 쓰기 요청을 호출할 수 있다.That is, since the host has already stored the block data and the journal head data in the storage, the host can call the order guarantee write request to write the commit data to the storage.

한편, 커밋데이터는 추후 배리어 기반 쓰기 명령이 스토리지에게 또다시 전송될 때, 스토리지에 기록될 수 있다.Meanwhile, the commit data may be written to the storage when a barrier-based write command is transmitted to the storage again.

이와 같이, 본 발명의 일 실시예에 따른 배리어 기반 로깅 방법은 트랜잭션 헤더 블록과 갱신된 블록이 먼저 스토리지에 기록되고, 커밋 블록이 그 후 기록되도록 기록 순서를 보장하는 효과가 있다.As described above, the barrier-based logging method according to an embodiment of the present invention has an effect of guaranteeing the recording order such that the transaction header block and the updated block are first written to storage, and the commit block is then recorded.

도 5는 본 발명의 일 실시예에 따른 배리어 기반 데이터 기록 순서 보장 방법을 설명하기 위한 흐름도이다.5 is a flowchart illustrating a method for guaranteeing a barrier-based data recording order according to an embodiment of the present invention.

단계 S510에서는, 호스트가 갱신된 데이터 블록에 해당하는 데이터인 복수의 블록데이터에 대하여, 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출한다.In step S510, the host calls a plurality of order guarantee write requests that support the guarantee of the write order in the storage for a plurality of block data that is data corresponding to the updated data block.

단계 S520에서는, 호스트가 그 복수의 블록데이터를 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 스토리지에게 전송하는 동기화 명령을 호출한다.In step S520, the host calls a synchronization command that transmits a plurality of write commands including a barrier-based write command for writing the plurality of block data to the storage in a predetermined order.

단계 S530에서는, 호스트가 다른 갱신된 데이터 블록에 해당하는 데이터인 해당하는 후속블록데이터에 대하여, 순서 보장 쓰기 요청을 호출한다.In step S530, the host calls the order guarantee write request for the corresponding subsequent block data, which is data corresponding to another updated data block.

이와 같이, 본 발명의 일 실시예에 따른 배리어 기반 데이터 기록 순서 보장 방법은 데이터의 기록 순서 보장이 필요한 호스트에게 성능의 병목현상 및 체크섬 충돌 또는 오버헤드의 우려없이, 스토리지에서의 데이터 기록 순서를 보장할 수 있는 효과가 있다.As described above, the barrier-based data recording order guarantee method according to an embodiment of the present invention guarantees the data recording order in the storage without fear of performance bottleneck and checksum collision or overhead for a host in need of guaranteeing the data recording order There is an effect that can be done.

도 6는 본 발명의 일 실시예에 따른 동기화 함수의 동작 방법을 설명하기 위한 흐름도이다.6 is a flowchart illustrating a method of operating a synchronization function according to an embodiment of the present invention.

단계 S610에서는, 호스트가 그 복수의 순서 보장 쓰기 요청 중 마지막으로 호출된 요청을 스토리지에서의 기록 순서가 보장되는 기준이 되는 배리어 기반 쓰기 명령으로 설정한다.In step S610, the host sets the last called request among the plurality of guaranteed order write requests as a barrier-based write command that serves as a criterion for ensuring the write order in storage.

즉, 호스트는 동기화 함수를 호출함으로써, 그 복수의 순서 보장 쓰기 요청 중에서 마지막으로 호출된 쓰기 요청을 배리어 기반 쓰기 명령으로 설정할 수 있다.That is, the host may set the last called write request among the multiple order guaranteed write requests as a barrier-based write command by calling a synchronization function.

이때, 배리어 기반 쓰기 명령은 그 쓰기 명령을 기준으로, 이전에 스토리지 장치에 전송된 순서 보장 쓰기 명령이 처리된 이후에 처리된다. 또한, 이후에 스토리지 장치에 전송된 순서 보장 쓰기 명령이 처리되기 이전에 처리된다. 이와 같이, 배리어 기반 쓰기 명령이 스토리지의 커맨드 큐에서 처리되므로, 스토리지에서의 기록 순서가 보장되는 기준이 된다고 할 수 있다.At this time, the barrier-based write command is processed after the order guarantee write command previously transmitted to the storage device is processed based on the write command. In addition, the order guarantee write command transmitted later to the storage device is processed before being processed. As described above, since the barrier-based write command is processed in the command queue of the storage, it can be said that the recording order in the storage is a standard for guaranteeing.

다른 실시예에서는, 배리어 기반 쓰기 명령은 배리어 기반 쓰기 명령이 스토리지의 커맨드 큐에 입력된 시점인 입력시점을 기준으로, 그 입력시점 이전에 커맨드 큐에 입력된 적어도 하나의 쓰기 명령이 처리된 이후로, 그 입력시점 이후에 커맨드 큐에 입력된 적어도 하나의 쓰기 명령이 처리되기 이전에, 스토리지 내부에서 처리될 수 있다.In another embodiment, the barrier-based write command is based on an input time point at which the barrier-based write command is input to a command queue of storage, after at least one write command input to the command queue is processed before the input time point. , Before at least one write command input to the command queue after the input time is processed, may be processed in the storage.

예컨대, 커맨드 큐에 {W1, W2, W3, W4}의 순서로 쓰기 명령이 입력되어 있다고 가정할 수 있다. 이때, W1, W2 는 순서 보장 쓰기 명령이고, W3, W4는 배리어 기반 쓰기 명령이다. 이 경우, W3의 배리어 기반 쓰기 명령은, W3의 배리어 기반 쓰기 명령의 입력시점을 기준으로, 그 이전에 입력된 쓰기 명령인 W1과 W2가 먼저 처리되어 스토리지에 기록된 이후에 스토리지에 기록된다. 또한, 그 이후에 입력된 쓰기 명령인 W4가 처리되어 스토리지에 기록되기 이전에 스토리지에 기록된다.For example, it can be assumed that a write command is input in the order of {W 1 , W 2 , W 3 , W 4 } in the command queue. At this time, W 1 and W 2 are order guarantee write commands, and W 3 and W 4 are barrier-based write commands. In this case, the barrier based on a write command of the W 3, based on the input timing of the W 3 barrier-based write command of the write command, W 1 and W 2 input to the previously processed first storage after the recording to the storage Is written on. Further, the write command W 4 input thereafter is processed and written to the storage before being written to the storage.

또 다른 실시예에서는, 배리어 기반 쓰기 명령은 쓰기 명령과 배리어 설정 명령을 조합하여 호출하도록 구성되거나, 쓰기 명령에 미리 정해진 배리어플래그를 입력하도록 구성될 수 있다.In another embodiment, the barrier-based write command may be configured to invoke a combination of a write command and a barrier setting command, or may be configured to input a predetermined barrier flag to the write command.

즉, 본 발명의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령은 다양한 형태로 구현될 수 있다. That is, the order guarantee write command and barrier-based write command of the present invention can be implemented in various forms.

우선, 쓰기 명령과 분리된 순서 보장 설정 명령 또는 배리어 설정 명령으로 구현될 수 있다. 즉, 어플리케이션 레벨에서는 쓰기 명령을 호출한 이후에 순서 보장 설정 명령 또는 배리어 설정 명령을 호출함으로써, 순서 보장 쓰기 명령 또는 배리어 기반 쓰기 명령을 구현할 수 있다.First of all, it may be implemented as an order guarantee setting command or a barrier setting command separate from the write command. That is, at the application level, an order guarantee write command or a barrier-based write command may be implemented by calling an order guarantee setting command or a barrier setting command after calling a write command.

단계 S620에서는, 호스트가 그 마지막으로 호출된 요청을 제외한 적어도 하나의 요청을 배리어 기반 쓰기 명령의 이전에 처리되는 순서 보장 쓰기 명령으로 설정한다.In step S620, the host sets at least one request, except for the last called request, as a guaranteed order write command processed before the barrier-based write command.

즉, 호스트는 동기화 함수를 호출함으로써, 그 복수의 순서 보장 쓰기 요청 중에서 마지막으로 호출된 쓰기 요청을 제외한 나머지를 순서 보장 쓰기 명령으로 설정할 수 있다. That is, the host can set the rest of the plurality of ordered write requests excluding the last called write request as ordered write commands by calling a synchronization function.

마지막으로 단계 S630에서는, 호스트가 그 적어도 하나의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령을 스토리지에게 전송한다.Finally, in step S630, the host transmits the at least one order guarantee write command and the barrier-based write command to the storage.

이때, 호스트는 스토리지에서 그 적어도 하나의 순서 보장 쓰기 명령이 배리어 기반 쓰기 명령보다 우선하여 처리되도록, 그 적어도 하나의 순서 보장 쓰기 명령을 배리어 기반 쓰기 명령보다 먼저 스토리지에게 전송할 수 있다.At this time, the host may transmit the at least one order guarantee write command to the storage before the barrier-based write command so that the at least one order guarantee write command is processed in priority over the barrier-based write command in the storage.

다른 실시예에서는, 호스트가 단계 S630의 이후에, 동기화 명령의 종류에 따라, 반환하거나 적어도 하나의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령이 스토리지에서 처리된 이후 반환할 수 있다.In another embodiment, the host may return after step S630, depending on the type of the synchronization command, or after at least one order guarantee write command and barrier-based write command are processed in the storage.

예컨대, 동기화 명령의 종류에는 2가지가 존재할 수 있다. For example, two types of synchronization commands may exist.

첫번째로, 그 적어도 하나의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령을 스토리지에게 전송한 이후에, 그 쓰기 명령의 처리 결과를 기다리지 않고 반환(return)하는 동기화 명령이 있다. First, after transmitting the at least one order guarantee write command and the barrier-based write command to storage, there is a synchronization command that returns without waiting for the processing result of the write command.

보다 구체적으로, fdatabarrier() 함수로 구현될 수 있으며, 해당 동기화 명령은 쓰기 명령이 처리되는 동안 수행되는 플러시를 대기하지 않음으로써, 기록 순서 보장을 위한 성능 병목을 발생시키기 않게 되며, 체크섬을 이용하지 않으므로 체크섬 충돌 및 오버헤드의 가능성도 없는 장점이 있다.More specifically, it can be implemented with the fdatabarrier () function, and the corresponding synchronization command does not wait for a flush to be performed while the write command is being processed, so that it does not create a performance bottleneck for guaranteeing the write order, and does not use a checksum. Therefore, there is an advantage that there is no possibility of checksum collision and overhead.

두번째로, 그 적어도 하나의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령을 스토리지에게 전송한 이후에, 그 쓰기 명령의 처리 결과를 기다린 후, 반환하는 동기화 명령이 있다. Second, after transmitting the at least one order-assured write command and the barrier-based write command to the storage, there is a synchronization command that waits for the result of the write command and returns.

보다 구체적으로, fdatasync() 함수로 구현될 수 있으며, 해당 동기화 명령은 쓰기 명령이 처리되는 동안 수행되는 플러시를 대기함으로써, 기록 순서 보장을 위한 성능 병목이 다소간 발생하게 되나, 체크섬을 이용하지 않으므로 체크섬 충돌 및 오버헤드의 가능성도 없는 장점이 있다.More specifically, it can be implemented with the fdatasync () function, and the corresponding synchronization command waits for a flush to be performed while the write command is being processed, resulting in some performance bottlenecks for guaranteeing the write order, but checksum is not used. There is also the advantage that there is no possibility of collision and overhead.

도 7은 본 발명의 일 실시예에 따른 배리어 기반 로깅을 지원하는 컴퓨팅 장치를 설명하기 위한 블록도이다.7 is a block diagram illustrating a computing device supporting barrier-based logging according to an embodiment of the present invention.

도 7을 참조하면, 본 발명의 일 실시예에 따른 배리어 기반 로깅을 지원하는 컴퓨팅 장치(700)는 스토리지(710) 및 프로세서(720)를 포함한다.Referring to FIG. 7, a computing device 700 supporting barrier-based logging according to an embodiment of the present invention includes a storage 710 and a processor 720.

한편, 본 발명의 일 실시예에 따른 배리어 기반 로깅을 지원하는 컴퓨팅 장치(700)는 데스크탑PC, 노트북PC, 스마트폰, 태블릿 및 웨어러블 기기 등과 같이 로깅 기능을 필요로 하는 다양한 종류의 기기에 탑재될 수 있다.Meanwhile, the computing device 700 supporting barrier-based logging according to an embodiment of the present invention may be mounted on various types of devices requiring a logging function, such as a desktop PC, a notebook PC, a smartphone, a tablet, and a wearable device. You can.

스토리지(710)는 기록 순서의 보장을 지원하는 파일 시스템을 운영하는 소프트웨어가 탑재된다.The storage 710 is equipped with software that operates a file system that supports the guarantee of recording order.

프로세서(720)는 스토리지(710)에 탑재된 소프트웨어를 운영한다.The processor 720 operates software installed in the storage 710.

이때, 프로세서(720)는 적어도 하나의 갱신된 데이터 블록에 해당하는 데이터인 블록데이터 및 저널 헤드에 해당하는 데이터인 저널헤드데이터에 대하여, 스토리지(710)에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출하고, 그 블록데이터 및 저널헤드데이터를 스토리지(710)에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 스토리지(710)에게 전송하는 동기화 명령을 호출하고, 커밋 블록에 해당하는 데이터인 커밋데이터에 대하여, 순서 보장 쓰기 요청을 호출한다.In this case, the processor 720 may support a plurality of block data, which is data corresponding to at least one updated data block, and journal head data, which is data corresponding to the journal head, to support the guarantee of the recording order in the storage 710. Synchronization command to send a plurality of write commands to the storage 710, including a barrier-based write command to call the order guarantee write request, and write the block data and journal head data in a predetermined order to the storage 710 Call, and the order guarantee write request is called for the commit data, which is data corresponding to the commit block.

다른 실시예에서는, 프로세서(720)가 동기화 명령을 호출할 때, 동기화 명령은 복수의 순서 보장 쓰기 요청 중 마지막으로 호출된 요청을 스토리지(710)에서의 기록 순서가 보장되는 기준이 되는 배리어 기반 쓰기 명령으로 설정하고, 그 마지막으로 호출된 요청을 제외한 적어도 하나의 요청을 배리어 기반 쓰기 명령의 이전에 처리되는 순서 보장 쓰기 명령으로 설정하고, 그 적어도 하나의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령을 스토리지(610)에게 전송할 수 있다.In another embodiment, when the processor 720 calls a synchronization command, the synchronization command is a barrier-based write that serves as a criterion for guaranteeing a recording order in the storage 710 of a request last called among a plurality of order guarantee write requests. Command, set at least one request except the last called request to a previously guaranteed ordered write command of the barrier-based write command, and store the at least one ordered guarantee write command and the barrier-based write command 610.

또 다른 실시예에서는, 동기화 명령은 그 적어도 하나의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령을 스토리지(710)에게 전송한 이후에, 동기화 명령의 종류에 따라, 반환하거나 그 적어도 하나의 순서 보장 쓰기 명령 및 배리어 기반 쓰기 명령이 스토리지(710)에서 처리된 이후 반환할 수 있다.In another embodiment, after the synchronization command transmits the at least one order guarantee write command and the barrier-based write command to the storage 710, the synchronization command returns or at least one order guarantee write command according to the type of the sync command. And after the barrier-based write command is processed in the storage 710.

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다. So far, the present invention has been focused on the preferred embodiments. Those skilled in the art to which the present invention pertains will understand that the present invention can be implemented in a modified form without departing from the essential characteristics of the present invention. Therefore, the disclosed embodiments should be considered in terms of explanation, not limitation. The scope of the present invention is shown in the claims rather than the foregoing description, and all differences within the equivalent range should be interpreted as being included in the present invention.

Claims (7)

호스트가 스토리지에 로깅을 수행하는 방법에 있어서,
적어도 하나의 갱신된 데이터 블록에 해당하는 데이터인 블록데이터 및 저널 헤드에 해당하는 데이터인 저널헤드데이터에 대하여, 상기 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출하는 단계;
상기 블록데이터 및 상기 저널헤드데이터를 상기 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 상기 스토리지에게 전송하는 동기화 명령을 호출하는 단계; 및
커밋 블록에 해당하는 데이터인 커밋데이터에 대하여, 상기 순서 보장 쓰기 요청을 호출하는 단계
를 포함하는 것을 특징으로 하는 배리어 기반 로깅 방법.
In the way the host performs logging to storage,
Invoking a plurality of order guarantee write requests to support the guarantee of the write order in the storage, for block data as data corresponding to at least one updated data block and journal head data as data corresponding to a journal head;
Calling a synchronization command to transmit a plurality of write commands including a barrier-based write command for writing the block data and the journal head data to the storage in a predetermined order; And
Invoking the order guarantee write request for the commit data, which is data corresponding to the commit block.
Barrier-based logging method comprising a.
제1항에 있어서,
상기 동기화 명령을 호출하는 단계는
상기 복수의 순서 보장 쓰기 요청 중 마지막으로 호출된 요청을 상기 스토리지에서의 기록 순서가 보장되는 기준이 되는 배리어 기반 쓰기 명령으로 설정하는 단계;
상기 마지막으로 호출된 요청을 제외한 적어도 하나의 요청을 상기 배리어 기반 쓰기 명령의 이전에 처리되는 순서 보장 쓰기 명령으로 설정하는 단계; 및
상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령을 상기 스토리지에게 전송하는 단계
를 포함하는 것을 특징으로 하는 배리어 기반 로깅 방법.
According to claim 1,
The step of invoking the synchronization command is
Setting a last call request among the plurality of order guarantee write requests as a barrier-based write command that is a criterion for guaranteeing a write order in the storage;
Setting at least one request other than the last called request to an order guaranteed write command processed before the barrier-based write command; And
Transmitting the at least one order guarantee write command and the barrier-based write command to the storage
Barrier-based logging method comprising a.
제2항에 있어서,
상기 스토리지에게 전송하는 단계의 이후에,
상기 동기화 명령의 종류에 따라, 반환하거나 상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령이 상기 스토리지에서 처리된 이후 반환하는 단계
를 더 포함하는 것을 특징으로 하는 배리어 기반 로깅 방법.
According to claim 2,
After the step of transmitting to the storage,
Depending on the type of the synchronization command, return or return after the at least one order guarantee write command and the barrier-based write command are processed in the storage.
Barrier-based logging method further comprising a.
호스트가 스토리지에 데이터의 기록 순서를 보장하는 방법에 있어서,
갱신된 데이터 블록에 해당하는 데이터인 복수의 블록데이터에 대하여, 상기 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출하는 단계;
상기 복수의 블록데이터를 상기 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 상기 스토리지에게 전송하는 동기화 명령을 호출하는 단계; 및
다른 갱신된 데이터 블록에 해당하는 데이터인 해당하는 후속블록데이터에 대하여, 상기 순서 보장 쓰기 요청을 호출하는 단계
를 포함하는 것을 특징으로 하는 배리어 기반 데이터 기록 순서 보장 방법.
In the method of ensuring the order in which the host writes data to the storage,
Invoking a plurality of order guarantee write requests that support guarantee of a write order in the storage for a plurality of block data which is data corresponding to the updated data block;
Calling a synchronization command to transmit a plurality of write commands including a barrier-based write command to write the plurality of block data to the storage in a predetermined order; And
Calling the order guarantee write request for corresponding subsequent block data, which is data corresponding to another updated data block.
Barrier-based data recording method, characterized in that it comprises a.
기록 순서의 보장을 지원하는 파일 시스템을 운영하는 소프트웨어가 탑재된 스토리지; 및
상기 스토리지에 탑재된 소프트웨어를 운영하는 프로세서를 포함하고,
상기 프로세서는
적어도 하나의 갱신된 데이터 블록에 해당하는 데이터인 블록데이터 및 저널 헤드에 해당하는 데이터인 저널헤드데이터에 대하여, 상기 스토리지에서의 기록 순서의 보장을 지원하는 복수의 순서 보장 쓰기 요청을 호출하고,
상기 블록데이터 및 상기 저널헤드데이터를 상기 스토리지에 소정의 순서로 기록하기 위한 배리어 기반 쓰기 명령을 포함하는 복수의 쓰기 명령을 상기 스토리지에게 전송하는 동기화 명령을 호출하고,
커밋 블록에 해당하는 데이터인 커밋데이터에 대하여, 상기 순서 보장 쓰기 요청을 호출하는 것을 특징으로 하는 배리어 기반 로깅을 지원하는 컴퓨팅 장치.
Storage equipped with software that operates a file system that supports the guarantee of recording order; And
It includes a processor for operating the software mounted on the storage,
The processor
Calling a plurality of order guarantee write requests to support the guarantee of the write order in the storage for block data, which is data corresponding to at least one updated data block, and journal head data, which is data corresponding to a journal head,
Invoke a synchronization command to transmit a plurality of write commands including a barrier-based write command for writing the block data and the journal head data to the storage in a predetermined order, and
A computing device supporting barrier-based logging, characterized in that the order guarantee write request is called for commit data, which is data corresponding to a commit block.
제5항에 있어서,
상기 프로세서가 상기 동기화 명령을 호출할 때,
상기 동기화 명령은
상기 복수의 순서 보장 쓰기 요청 중 마지막으로 호출된 요청을 상기 스토리지에서의 기록 순서가 보장되는 기준이 되는 배리어 기반 쓰기 명령으로 설정하고,
상기 마지막으로 호출된 요청을 제외한 적어도 하나의 요청을 상기 배리어 기반 쓰기 명령의 이전에 처리되는 순서 보장 쓰기 명령으로 설정하고,
상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령을 상기 스토리지에게 전송하는 것을 특징으로 하는 배리어 기반 로깅을 지원하는 컴퓨팅 장치.
The method of claim 5,
When the processor calls the synchronization command,
The synchronization command
The last call request among the plurality of order guarantee write requests is set as a barrier-based write command that is a criterion for guaranteeing a write order in the storage,
At least one request other than the last called request is set as a guaranteed order write command processed before the barrier-based write command,
And computing the at least one order guarantee write command and the barrier-based write command to the storage.
제6항에 있어서,
상기 동기화 명령은
상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령을 상기 스토리지에게 전송한 이후에,
상기 동기화 명령의 종류에 따라, 반환하거나 상기 적어도 하나의 순서 보장 쓰기 명령 및 상기 배리어 기반 쓰기 명령이 상기 스토리지에서 처리된 이후 반환하는 것을 특징으로 하는 배리어 기반 로깅을 지원하는 컴퓨팅 장치.



The method of claim 6,
The synchronization command
After transmitting the at least one order guarantee write command and the barrier-based write command to the storage,
A computing device supporting barrier-based logging, characterized in that it returns, after the at least one order guarantee write command and the barrier-based write command are processed in the storage, according to the type of the synchronization command.



KR1020190061978A 2018-10-19 2019-05-27 Method and apparatus for logging based on barrier KR102132387B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020180125444 2018-10-19
KR20180125444 2018-10-19

Publications (2)

Publication Number Publication Date
KR20200044660A true KR20200044660A (en) 2020-04-29
KR102132387B1 KR102132387B1 (en) 2020-07-09

Family

ID=70466498

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190061978A KR102132387B1 (en) 2018-10-19 2019-05-27 Method and apparatus for logging based on barrier

Country Status (1)

Country Link
KR (1) KR102132387B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160012388A (en) * 2014-07-24 2016-02-03 성균관대학교산학협력단 Method and apparatus for fsync system call processing using ordered mode journaling with file unit
KR20170048084A (en) * 2015-10-26 2017-05-08 충북대학교 산학협력단 Apparatus and Method for Operating Write-Ahead-Logging
KR101744685B1 (en) * 2015-12-31 2017-06-09 한양대학교 산학협력단 Protection method and apparatus for metadata of file
KR20190086341A (en) * 2018-01-12 2019-07-22 삼성전자주식회사 Storage device storing data in order based on barrier command

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160012388A (en) * 2014-07-24 2016-02-03 성균관대학교산학협력단 Method and apparatus for fsync system call processing using ordered mode journaling with file unit
KR20170048084A (en) * 2015-10-26 2017-05-08 충북대학교 산학협력단 Apparatus and Method for Operating Write-Ahead-Logging
KR101744685B1 (en) * 2015-12-31 2017-06-09 한양대학교 산학협력단 Protection method and apparatus for metadata of file
KR20190086341A (en) * 2018-01-12 2019-07-22 삼성전자주식회사 Storage device storing data in order based on barrier command

Also Published As

Publication number Publication date
KR102132387B1 (en) 2020-07-09

Similar Documents

Publication Publication Date Title
US5787304A (en) Multipath I/O storage systems with multipath I/O request mechanisms
US7788453B2 (en) Redirection of storage access requests based on determining whether write caching is enabled
US10922135B2 (en) Dynamic multitasking for distributed storage systems by detecting events for triggering a context switch
US9250818B2 (en) Transferring learning metadata between storage servers having clusters via copy services operations on a shared virtual logical unit that stores the learning metadata
US7234004B2 (en) Method, apparatus and program product for low latency I/O adapter queuing in a computer system
JP7412063B2 (en) Storage device mirroring methods, devices, and programs
US20200004649A1 (en) Transfer track format information for tracks in cache at a primary storage system to a secondary storage system to which tracks are mirrored to use after a failover or failback
JPH076099A (en) System and method for duplexing of remote data
JP2017531250A (en) Granular / semi-synchronous architecture
US9081511B2 (en) Source-target relations mapping
US7650476B2 (en) System, method and computer program product for generating a consistent point in time copy of data
US9934110B2 (en) Methods for detecting out-of-order sequencing during journal recovery and devices thereof
US9697152B1 (en) I/O processing system including dynamic missing interrupt and input/output detection
US20160034191A1 (en) Grid oriented distributed parallel computing platform
KR102262209B1 (en) Method and apparatus for sending barrier command using dummy io request
US10140183B2 (en) Efficient state tracking for clusters
KR102132387B1 (en) Method and apparatus for logging based on barrier
US9779105B1 (en) Transaction logging using file-system-specific log files
KR20200044646A (en) Method and apparatus for dual mode journaling
CN112805949B (en) Method for processing snapshot creation request and storage device
KR102254501B1 (en) Partially order preserving i/o scheduler and method thereof
US9967337B1 (en) Corruption-resistant backup policy
KR20190096837A (en) Method and apparatus for parallel journaling using conflict page list
US11662946B2 (en) Priority-aware internode messaging for active-active storage system
US11782615B2 (en) Information processing system, non-transitory computer-readable recording medium having stored therein storage controlling program, and storage controller

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right