[go: up one dir, main page]

KR102816588B1 - Method and data structure to evict transaction data on disk intermediately - Google Patents

Method and data structure to evict transaction data on disk intermediately Download PDF

Info

Publication number
KR102816588B1
KR102816588B1 KR1020230010779A KR20230010779A KR102816588B1 KR 102816588 B1 KR102816588 B1 KR 102816588B1 KR 1020230010779 A KR1020230010779 A KR 1020230010779A KR 20230010779 A KR20230010779 A KR 20230010779A KR 102816588 B1 KR102816588 B1 KR 102816588B1
Authority
KR
South Korea
Prior art keywords
transaction
operating system
data
file
page
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
KR1020230010779A
Other languages
Korean (ko)
Other versions
KR20230115930A (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 KR20230115930A publication Critical patent/KR20230115930A/en
Application granted granted Critical
Publication of KR102816588B1 publication Critical patent/KR102816588B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

호스트의 운영체제가, 페이지 캐시의 크기가 제1트랜잭션에 속한 복수 개의 쓰기 페이지들의 크기보다 작으면, 상기 복수 개의 쓰기 페이지들 중 일부의 쓰기 페이지를 스토리지에 쓰는 이빅트(evict) 단계, 및 상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계를 포함하는 트랜잭션 실행방법이 공개된다.A transaction execution method is disclosed, including an evict step in which an operating system of a host writes some of the write pages among the plurality of write pages belonging to the first transaction to storage if the size of the page cache is smaller than the sizes of the plurality of write pages, and a commit step in which the operating system commits the first transaction.

Description

대용량 트랜잭션을 위한 트랜잭션 데이터 중간 저장 기법 및 장치{Method and data structure to evict transaction data on disk intermediately}{Method and data structure to evict transaction data on disk intermediately}

본 발명은 컴퓨팅 기술에 관한 것으로서, 특히 한 개의 트랜잭션에 포함된 쓰기 데이터의 양이 페이지 캐시의 양보다 많은 대용량 트랜잭션을 실행하는 기술에 관한 것이다. The present invention relates to computing technology, and more particularly, to technology for executing a large-capacity transaction in which the amount of write data included in one transaction is greater than the amount of page cache.

도 1은 종래기술 및 본 발명의 일 실시예에 따라 제공되는 호스트의 구성을 나타낸 것이다. Figure 1 illustrates the configuration of a host provided according to the prior art and one embodiment of the present invention.

호스트(10)는 컴퓨팅 장치일 수 있다. 호스트(10)는 메모리(13), 전원부(16), 저장부(17), 처리부(18), 및 통신부(19)를 포함할 수 있다. 전원부(16)는 호스트(10)의 동작전원을 공급하도록 되어 있다. 저장부(17)는 처리부(18)로 하여금 어플리케이션(11) 및/또는 운영체제(12)를 실행하도록 하는 명령어들을 포함하는 프로그램이 저장되어 있을 수 있다. 저장부(17)는 SSD, HDD와 같은 비휘발성 메모리일 수 있다. 처리부(18)는 상기 프로그램을 실행하여 상기 어플리케이션(11) 및/또는 운영체제(12)를 실행하도록 되어 있을 수 있다. 처리부(18)는 예컨대 AP 또는 CPU일 수 있다. 메모리(13)는 DRAM과 같이 운영체제(12)에 의해 직접 제어되는 것일 수 있다. 메모리(13)는 페이지 캐시 및 쉐도우 페이지 캐시를 포함할 수 있다. 통신부(19)는 운영체제(12)의 명령을 스토리지(20)에 전달하는 통신 미디어를 드라이브하도록 되어 있을 수 있다. 상기 통신 미디어는 베이스밴드 통신신호를 전송하거나 또는 변조된 통신신호를 전송하는 것일 수 있다. The host (10) may be a computing device. The host (10) may include a memory (13), a power supply (16), a storage (17), a processing unit (18), and a communication unit (19). The power supply (16) is configured to supply operating power to the host (10). The storage unit (17) may store a program including commands that cause the processing unit (18) to execute an application (11) and/or an operating system (12). The storage unit (17) may be a non-volatile memory such as an SSD or an HDD. The processing unit (18) may be configured to execute the program to execute the application (11) and/or the operating system (12). The processing unit (18) may be, for example, an AP or a CPU. The memory (13) may be directly controlled by the operating system (12), such as a DRAM. The memory (13) may include a page cache and a shadow page cache. The communication unit (19) may be configured to drive a communication medium that transmits commands from the operating system (12) to storage (20). The communication medium may transmit a baseband communication signal or a modulated communication signal.

호스트에서 실행되는 어플리케이션 프로그램(이하, 간단히 '어플리케이션')은 데이터를 스토리지(저장장치)(예컨대, SSD)에 저장하는 주체일 수 있다. 그러나 어플리케이션을 스토리지를 직접 제어할 수 없다. 따라서 어플리케이션은 스토리지를 직접 제어할 수 있는 운영체제를 통해서 스토리지에 데이터를 쓸 수 있다. 운영체제에서 스토리지를 다루는 부분을 파일시스템이라고 지칭할 수 있다. An application program running on a host (hereinafter, simply referred to as an 'application') can be the entity that stores data in storage (storage device) (e.g., SSD). However, the application cannot directly control the storage. Therefore, the application can write data to the storage through an operating system that can directly control the storage. The part of the operating system that handles the storage can be referred to as a file system.

데이터가 어플리케이션이 요구하는 방식으로 스토리지에 저장되지 않는다면 오류가 발생할 수 있다. 데이터가 어플리케이션이 요구하는 방식으로 스토리지에 저장되기 위해서는 트랜잭션이라는 것이 이용될 수 있다.If data is not stored in storage in the way the application requires, errors can occur. Transactions can be used to ensure that data is stored in storage in the way the application requires.

트랜잭션은 쓰기 데이터들의 집합인데, 원자성, 일관성, 트랜잭션들 간의 고립성, 정전시 유지되는 내구성과 같은 특성들이 만족되어야 한다. 이러한 특성들을 만족하는 쓰기 데이터들의 집합을 트랜잭션이라고 부를 수 있다.A transaction is a set of write data, and must satisfy properties such as atomicity, consistency, isolation between transactions, and durability in the event of a power failure. A set of write data that satisfies these properties can be called a transaction.

일부 종래 기술에서, 어플리케이션은 트랜잭션을 필요로 하지만, 운영체제는 트랜잭션을 필요로 하지 않는다. 이 경우, 어플리케이션은 소정의 방식으로 트랜잭션을 구현하도록 되어 있을 수 있는데, 이는 비효율적일 수 있다. 스토리지 안에는 빠르게 동작하는 캐시가 존재한다. 어플리케이션이 쓰기 데이터를 위한 쓰기 콜을 운영체제에 보내고, 이에 반응하여 운영체제가 스토리지에 쓰기 데이터를 보내면, 상기 쓰기 데이터는 보통 상기 스토리지의 캐시에 저장된다. 어플리케이션이 트랜잭션을 제어하면 상기 스토리지의 캐시를 거의 사용하지 못할 수 있다. 왜냐하면 스토리지의 캐시 안에서 쓰기 데이터들이 캐싱되면 어플리케이션이 원하는 트랜잭션 순서가 깨질 수 있다. 따라서 일부 종래 기술에서, 어플리케이션은 제1트랜잭션과 제2트랜잭션의 순서를 유지하기 위하여, 제1트랜잭션을 스토리지의 캐시에 쓴 다음 이를 스토리지의 비휘발성 영역에 플러시 해주고, 그 후에 제2트랜잭션을 스토리지의 캐시에 쓴 다음 이를 스토리지의 비휘발성 영역에 플러시 해준다. 여기서 데이터 X를 플러시 하는 것은, 데이터 X를 스토리지의 비휘발성 메모리에 저장하는 것을 의미할 수 있다. In some prior art, the application requires a transaction, but the operating system does not require a transaction. In this case, the application may be configured to implement the transaction in a certain way, which may be inefficient. There is a fast-running cache in the storage. When the application sends a write call for write data to the operating system, and in response, the operating system sends write data to the storage, the write data is usually stored in the cache of the storage. If the application controls the transaction, the cache of the storage may be hardly used. This is because if the write data are cached in the cache of the storage, the transaction order desired by the application may be broken. Therefore, in some prior art, in order to maintain the order of the first and second transactions, the application writes the first transaction to the cache of the storage and then flushes it to the non-volatile area of the storage, and then writes the second transaction to the cache of the storage and then flushes it to the non-volatile area of the storage. Here, flushing the data X may mean storing the data X in the non-volatile memory of the storage.

트랜지션은 커밋 블록이라고 지칭되는 특별한 데이터를 포함한다. 스토리지 내에 커밋 블록이 존재한다는 것은, 스토리지 내에 상기 커밋 블록과 연관된 트랜잭션의 데이터들이 모두 빠짐없이 쓰였다는 것을 보장한다. 한 개의 트랜잭션에 포함된 커밋 블록을 다른 나머지 모든 블록들보다 뒤에 쓰는 조건을 보장하기 위하여, 상기 다른 나머지 모든 블록을 먼저 스토리지의 캐시에 쓰고 플러시하고, 그 후에 커밋 블록을 스토리지의 캐시에 쓰고 플러시 하는 방식을 종래의 어플리케이션이 사용한다.A transition includes special data called a commit block. The presence of a commit block in storage guarantees that all data of a transaction associated with the commit block in storage have been written without omission. In order to guarantee that a commit block included in a transaction is written after all other remaining blocks, conventional applications use a method in which all other remaining blocks are first written to the cache of storage and flushed, and then the commit block is written to the cache of storage and flushed.

트랜잭션과 별개로, 어플리케이션에서는 쓰기 데이터를 스토리지에 저장할 때에 파일이라는 단위를 사용한다.Separate from transactions, applications use a unit called a file when storing write data in storage.

종래 일부 기술에서, 트랜잭션을 원본 파일에 그대로 쓰지 않고, 그 대신 저널 파일이라는 것을 새로 만든다. 상기 저널 파일은 스토리지의 비휘발성 메모리에 저장될 수 있다. 그 다음, 제1트랜잭션을 저널 파일에 쓴다. 제1트랜잭션이 상기 저널 파일에 완전히 쓰인 다음에야, 상기 제1트랜잭션을 원본파일에 반영한다. 정전이 발생하면 온전히 저널 파일에 쓰인 트랜잭션들만 복구할 수 있다. In some conventional techniques, instead of writing a transaction to the original file, a new journal file is created instead. The journal file can be stored in non-volatile memory of the storage. Then, the first transaction is written to the journal file. Only after the first transaction is completely written to the journal file, the first transaction is reflected to the original file. If a power outage occurs, only the transactions that were completely written to the journal file can be recovered.

그러나 상술한 종래기술에 따르면 다음과 같은 비효율성이 존재한다는 문제가 있다. 즉, 저널 파일을 만들게 되면 쓰기 데이터를 처리하기 위해 저널 파일에 한 번 쓴 후 원본 파일에도 한 번을 써야 하기 때문에 컴퓨팅 자원의 사용량이 증가하며, 플러시를 많이 호출한다는 단점도 있다. However, according to the above-described prior art, there is a problem that the following inefficiency exists. That is, when a journal file is created, the writing data must be written once to the journal file and once to the original file in order to process it, so the usage of computing resources increases, and there is also a disadvantage in that many flush calls are made.

상술한 문제를 해결하는 종래기술들이 존재한다. 상술한 문제점은, 어플리케이션만이 트랜잭션을 운용하고, 운영체제는 트랜잭션을 지원하지 않는다는 점에 있다. 따라서 상술한 문제를 해결하는 종래기술에서는 운영체제가 트랜잭션 기능을 지원한다. 그런데 이러한 종래기술에도 단점이 존재한다. 즉, 어플리케이션이 쓰고자 하는 쓰기 데이터는 운영체제에 의해 메모리(페이지 캐시)에 피닝(pining, 고정)된다. 그 후에 어플리케이션이 커밋 콜을 운영체제에게 보내면, 운영체제는 메모리에 피닝된 것을 한 번에 스토리지에 써준다. 스토리지에 쓸 때에도 트랜잭션 형태를 운영체제가 직접 사용한다. 이때, 어플리케이션이 요구하는 쓰기 데이터를 메모리에 피닝 해야 하므로, 트랜잭션의 크기는 메모리의 크기에 의해 그 한계가 정해진다. There are conventional techniques that solve the above-mentioned problem. The above-mentioned problem is that only the application operates the transaction, and the operating system does not support the transaction. Therefore, in the conventional technique that solves the above-mentioned problem, the operating system supports the transaction function. However, these conventional techniques also have a disadvantage. That is, the write data that the application wants to write is pinned to the memory (page cache) by the operating system. Then, when the application sends a commit call to the operating system, the operating system writes the pinned data to the memory to the storage at once. Even when writing to the storage, the operating system directly uses the transaction form. At this time, since the write data requested by the application must be pinned to the memory, the size of the transaction is limited by the size of the memory.

본 발명은, 트랜잭션을 지원하는 운영체제의 파일시스템에서 트랜잭션의 크기가 운영제체가 관리하는 메모리의 크기에 의해 제한된다는 문제를 해결하는 기술을 제공하고자 한다.The present invention aims to provide a technology for solving the problem that the size of a transaction in a file system of an operating system supporting transactions is limited by the size of memory managed by the operating system.

본 발명은 대용량 트랜잭션을 실행하기 위한 중간저장 장치 및 기법을 제안한다. 본 발명에서는 이를 스틸링(Stealing)이라고 지칭할 수 있다. 상기 대용량 트랜잭션이란, 한 개의 트랜잭션에 포함된 쓰기 데이터의 양이 페이지 캐시의 양보다 큰 경우를 의미할 수 있다.The present invention proposes an intermediate storage device and technique for executing a large-capacity transaction. In the present invention, this may be referred to as stealing. The large-capacity transaction may mean a case where the amount of write data included in one transaction is greater than the amount of page cache.

어플리케이션은 다양한 오퍼레이션 콜을 운영체제에게 보낼 수 있다. 송신 스타트(Tx start) 콜은 어플리케이션이 트랜잭션을 시작함을 나타내는 시스템 콜이다. 쓰기(Write) 콜은 파일에 어떤 데이터를 스토리지에 쓰겠다는 것을 나타내는 시스템 콜이다. 송신 엔드(Tx end) 콜은 트랜잭션을 종료하겠다는 것을 나타내는 시스템 콜이다. An application can make various operation calls to the operating system. The Tx start call is a system call that indicates that the application is starting a transaction. The Write call is a system call that indicates that some data will be written to the storage in a file. The Tx end call is a system call that indicates that the transaction will be terminated.

어플리케이션이 송신 스타트 콜을 실행한 후에 쓰기 콜을 실행하면, 운영체제가 사용하는 메모리인 페이지 캐시에 상기 쓰기 콜에 관련된 쓰기 데이터(페이지)들이 피닝 된다. 만일 페이지 캐시에 상기 쓰기 데이터를 모두 피닝 할 수 없을 때에, 즉 페이지 캐시가 작을 때에는 종래기술에서는 상기 트랜잭션을 취소한다는 문제가 있다. 여기서 상기 종래기술은, 트랜잭션을 지원하는 운영체제가 트랜잭션을 실행하는 기술을 의미할 수 있다.When an application executes a write call after executing a transmission start call, the write data (pages) related to the write call are pinned in the page cache, which is the memory used by the operating system. If the write data cannot all be pinned in the page cache, that is, when the page cache is small, there is a problem in that the transaction is canceled in the prior art. Here, the prior art may mean a technology in which an operating system supporting a transaction executes a transaction.

본 발명에서는, 운영제체는, 트랜잭션 도중에, 운영체제가 직접 관리하는 페이지 캐시에 저장되어 있던 쓰기 데이터들 중 일부 데이터(일부 페이지)를 스토리지에 먼저 중간저장하며, 이를 이빅트(evict) 또는 이빅트 단계라고 지칭한다. 상기 먼저 중간 저장된 쓰기 데이터들이 기록되어 있던 페이지 캐시의 블록들은 이제 사용가능한 상태가 된다. 그 다음에, 운영체제는 페이지 캐시에 어플리케이션이 상기 트랜잭션을 통해 요청한 나머지 모든 쓰기 데이터들을 피닝 한다. 그 후에 어플리케이션에 의해 송신 엔드 콜이 호출되면, 운영체제는 페이지 캐시에 저장된 모든 데이터를 스토리지에 쓰는 명령을 실행한다. In the present invention, during a transaction, the operating system first intermediately stores some data (some pages) of the write data stored in the page cache directly managed by the operating system in storage, which is referred to as evict or the evict phase. The blocks of the page cache where the first intermediately stored write data were recorded now become available for use. Then, the operating system pins all remaining write data requested by the application through the transaction in the page cache. Thereafter, when the send end call is called by the application, the operating system executes a command to write all data stored in the page cache to storage.

본 발명에서, 이빅트란 특정 페이지를 선정하여 상기 특정 페이지에 저장되어 있던 내용을 스토리지에 쓰고, 상기 선정된 특정 페이지를 다른 용도로 사용할 수 있도록 빈 페이지로 만드는 것을 의미할 수 있다. In the present invention, evict may mean selecting a specific page, writing the content stored in the specific page to storage, and making the selected specific page an empty page so that it can be used for another purpose.

상기 중간저장이 실행된 이후에, 상기 트랜잭션의 커밋이 완료되면, 상기 중간저장은 상기 일부의 쓰기 데이터의 최종적인 저장으로 간주될 수 있다. 즉, 상기 중간저장은 상기 스토리지에 대한 상기 일부 데이터(일부 페이지)의 최종적인 저장으로 간주될 수 있다.After the above intermediate storage is executed, if the commit of the above transaction is completed, the intermediate storage can be considered as the final storage of the part of the write data. That is, the intermediate storage can be considered as the final storage of the part of the data (some pages) for the storage.

상술한 중간저장이 가능한 것은, 본 발명의 운영체제가 로그 구조 파일시스템을 사용하기 때문이다. The above-described intermediate storage is possible because the operating system of the present invention uses a log structure file system.

상기 로그 구조 파일시스템에서는, 스토리지에 기록되어 있는 어떤 데이터 A를 A'로 수정하고자 할 때에, 상기 A가 기록되어 있는 스토리지의 제1블록에 A'를 쓰는 것이 아니고, 다른 제2블록에 A'를 쓰는 특징을 갖는다. 그리고 상기 제1블록에 쓰인 A는 적절한 시점에 무효화된다. 상기 무효화는 운영체제가 무효화 명령을 이용하여 실행할 수 있다. 여기서 상기 '블록'은 스토리지 내에서 데이터가 저장되는 단위 저장소를 의미할 수 있다. 복수 개의 블록들을 모아서 한 개의 세그먼트라고 지칭할 수 있다. 이와 같이 로그 구조 파일시스템의 경우에는 스토리지에 이미 기록되어 있는 올드 데이터 A를 신규 데이터 A'로 수정하더라도 상기 올드 데이터 A가 소정의 시간 동안 스토리지에 남아 있다는 특징을 갖는다. 이 점은 본 발명에 있어서 중요하다.The above log structure file system has a characteristic that when a certain data A recorded in storage is to be modified to A', A' is not written to the first block of the storage where A is recorded, but A' is written to another second block. And A written in the first block is invalidated at an appropriate time. The invalidation can be executed by the operating system using an invalidation command. Here, the 'block' may mean a unit storage where data is stored in the storage. A plurality of blocks can be referred to as one segment. In this way, the log structure file system has a characteristic that even if old data A already recorded in the storage is modified to new data A', the old data A remains in the storage for a predetermined period of time. This point is important to the present invention.

스토리지에 기록된 어떤 데이터 A와 상기 데이터 A가 저장된 블록의 위치 간의 매핑관계를 나타낸 파일 매핑정보는 inode라고 지칭하는 파일에 저장된다. inode 파일은 스토리지에도 저장되고, 운영체제가 관리하는 페이지 캐시에도 일시적으로 저장될 수 있다. File mapping information, which represents the mapping relationship between some data A recorded in storage and the location of the block where said data A is stored, is stored in a file called an inode. The inode file is stored in storage and can also be temporarily stored in the page cache managed by the operating system.

한 개의 세그먼트에서 유효한 것으로 간주되는 블록을 라이브 블록이라고 지칭할 수 있다. 소정의 매핑정보에 의해 어떤 유효한 데이터가 저장되어 있는 블록이라고 선언된 블록을 라이브 블록이라고 지칭할 수 있다. 어떤 제1세그먼트에 포함된 블록들 중 모든 라이브 블록들에 저장된 데이터를 다른 제2세그먼트에 옮긴 후, 상기 제1세그먼트에 포함된 모든 블록들을 사용가능한 블록으로 만드는 과정을 가비지 콜렉션이라고 지칭할 수 있다. 가비지 콜렉션의 목적은 빈 세그먼트를 확보하는 것이다. A block considered valid in a segment may be referred to as a live block. A block declared to have some valid data stored therein by a given mapping information may be referred to as a live block. The process of moving data stored in all live blocks among the blocks included in a certain first segment to another second segment and then making all blocks included in the first segment usable blocks may be referred to as garbage collection. The purpose of garbage collection is to secure an empty segment.

트랜잭션을 지원하는 종래의 운영체제의 파일시스템은 로그 구조 파일시스템이 아니다. 즉 상기 종래의 기술에 따르면, 스토리지에 기록되어 있던 어떤 올드(old) 데이터(=올드 페이지)를 새로운 신규(new) 데이터(=신규 페이지)로 갱신하면 상기 올드 데이터는 상기 스토리지에서 바로 사라진다. The file system of a conventional operating system that supports transactions is not a log-structured file system. That is, according to the conventional technology, when some old data (=old page) recorded in storage is updated with new data (=new page), the old data immediately disappears from the storage.

이에 비하여, 로그 구조 파일시스템을 사용하는 본 발명에서는, 스토리지에 기록되어 있던 어떤 올드 데이터를 새로운 신규 데이터로 갱신하는 경우에, 상기 올드 데이터를 상기 스토리지에 소정의 조건 아래에서 유지할 수 있다는 점을 이용한다. In contrast, the present invention, which uses a log structure file system, utilizes the fact that when updating some old data recorded in storage with new data, the old data can be maintained in the storage under certain conditions.

로그 구조 파일시스템은 체크포인트라는 연산을 지원한다. 체크포인트 연산은 페이지 캐시에 저장되어 있는 파일 매핑정보(inode)들을 스토리지에 플러시 하는 연산이 체크포인트 연산이다. Log-structured file systems support an operation called checkpointing. The checkpointing operation is an operation that flushes file mapping information (inodes) stored in the page cache to storage.

이와 관련하여, 스토리지의 비휘발성 메모리에 저장되어 있는 파일 매핑정보는 스토리지의 캐시에 캐싱될 수 있고, 스토리지의 캐시에 저장되어 있는 파일 매핑정보는 다시 호스트의 운영체제가 관리하는 메모리, 즉 페이지 캐시에 캐싱될 수 있다. 스토리지에 저장되어 있는 파일 매핑정보를 운영체제가 수정하기 위해, 먼저 스토리지에 저장되어 있는 파일 매핑정보를 상기 페이지 캐시에 캐싱할 수 있다. In this regard, file mapping information stored in the non-volatile memory of the storage can be cached in the cache of the storage, and the file mapping information stored in the cache of the storage can be cached again in the memory managed by the operating system of the host, i.e., the page cache. In order for the operating system to modify the file mapping information stored in the storage, the file mapping information stored in the storage can first be cached in the page cache.

본 발명의 일 관점에 따라 트랜잭션을 실행하는 도중에, 페이지 캐시가 포화되면 페이지 캐시에 저장된 페이지 중 일부, 예컨대 페이지 A를 스토리지에 중간 저장할 수 있다. 즉 상기 페이지 A를 이빅트 할 수 있다. 이때 페이지 A의 올드 페이지는 스토리지의 제1블록에 기록되어 있고, 페이지 A의 신규 페이지는 스토리지의 제2블록에 기록될 수 있다. 이때, 상기 중간저장이 실행될 때에, 상기 신규 페이지가 제2블록에 쓰여 있음을 나타내는 신규 파일 매핑정보가 페이지 캐시 및 스토리지의 캐시에 기록될 수 있다. 이 경우 상기 올드 페이지가 제1블록에 쓰여 있음을 나타내는 올드 파일 매핑정보는 사라지게 된다. 이 상태에서 체크포인트 연산이 호출되면 상기 신규 파일 매핑정보가 스토리지에 플러시 되며, 그 결과 스토리지에 존재하던 상기 올드 파일 매핑정보는 사라진다. 그 다음, 만일 상기 트랜잭션이 커밋 되기 이전에 시스템 크래시(예컨대 정전)가 발생하면, 상기 시스템 크래시 이후에 복구가 이루어지는 과정에서 상기 스토리지에 기록된 상기 신규 파일 매핑정보가 이용될 수 있지만, 이미 사라진 상기 올드 파일 매핑정보는 이용될 수 없다. 따라서 복구를 실행하더라도 상기 종료되지 않은 트랜잭션의 이전 상태로 복구가 되지 않는다는 문제가 있다. 이러한 문제를 해결하기 위하여 본 발명에서는 다음과 같은 추가 구성을 도입한다.According to one aspect of the present invention, during the execution of a transaction, if the page cache becomes saturated, some of the pages stored in the page cache, for example, page A, may be stored in the storage for an intermediate storage. That is, the page A may be evicted. At this time, the old page of page A may be recorded in the first block of the storage, and the new page of page A may be recorded in the second block of the storage. At this time, when the intermediate storage is executed, new file mapping information indicating that the new page is written in the second block may be recorded in the cache of the page cache and the storage. In this case, the old file mapping information indicating that the old page is written in the first block disappears. When a checkpoint operation is called in this state, the new file mapping information is flushed to the storage, and as a result, the old file mapping information existing in the storage disappears. Then, if a system crash (for example, a power outage) occurs before the transaction is committed, the new file mapping information recorded in the storage may be used in the recovery process after the system crash, but the old file mapping information that has already disappeared cannot be used. Therefore, even if recovery is executed, there is a problem that the previous state of the above-mentioned unfinished transaction is not restored. In order to solve this problem, the present invention introduces the following additional configuration.

본 발명의 일 관점에 따르면, 상기 페이지 A를 이빅트 한 경우, 상기 페이지 A에 관한 상기 신규 파일 매핑정보를 상기 트랜잭션이 커밋 될 때까지 상기 페이지 캐시에 피닝 할 수 있다. 이렇게 하면 체크포인트 연산이 호출되더라도 상기 신규 파일 매핑정보가 플러시 되지 않으며, 따라서 상기 트랜잭션이 커밋 될 때까지는 스토리지 내의 상기 올드 파일 매핑정보가 그대로 유지될 수 있다. According to one aspect of the present invention, when the page A is evicted, the new file mapping information regarding the page A can be pinned in the page cache until the transaction is committed. In this way, even if a checkpoint operation is called, the new file mapping information is not flushed, and thus the old file mapping information in the storage can be maintained as is until the transaction is committed.

체크포인트 연산의 호출은 운영체제가 주기적으로 실행하거나 또는 가비지 콜렉션이 호출되기 직전 및 직후에 이루어질 수 있다. The call to the checkpoint operation may be performed periodically by the operating system or may be made just before or after a garbage collection call.

상술한 바와 같이 이빅트가 이루어진 페이지에 대해서는, 스토리지에 저장된 올드 블록에 대한 무효화가 트랜잭션의 커밋 이전에는 이루어지지 않는다. For pages where evict has occurred as described above, invalidation of old blocks stored in storage is not performed before the transaction is committed.

<로그 구조 파일시스템에서의 트랜잭션 지원-exF2FS><Transaction Support in Log Structure File System - exF2FS>

본 발명에서는 트랜잭션 로그 구조 파일시스템인 exF2FS를 제시한다. 제안된 파일시스템은 멤버쉽-오리엔티드 트랜잭션(Membership-Oriented Transaction). 스틸링-이네이블드 트랜잭션(Stealing-Enable Transaction) 및 쉐도우 가비지 콜렉션(Shadow Garbage Collection)이라고 하는 세 가지 주요 구성 요소로 구성될 수 있다.In this invention, we propose exF2FS, a transaction log structure file system. The proposed file system can be composed of three major components: Membership-Oriented Transaction, Stealing-Enable Transaction, and Shadow Garbage Collection.

상기 멤버쉽-오리엔티드 트랜잭션은 트랜잭션이 애플리케이션이 트랜잭션과 관련된 파일을 명시적으로 지정할 수 있는 여러 파일에 걸쳐 있을 수 있도록 한다. The above membership-oriented transactions allow a transaction to span multiple files, where the application can explicitly specify which files are involved in the transaction.

상기 스틸링-이네이블드 트랜잭션을 사용하면 어플리케이션 프로그램이 소량의 메모리로 트랜잭션을 실행하고 많은 업데이트(예: 전체 크기가 수십 GB인 수백 개의 파일)를 단일 트랜잭션으로 캡슐화 할 수 있다. The above stealing-enabled transactions allow application programs to execute transactions with a small amount of memory and encapsulate many updates (e.g., hundreds of files with a total size of tens of GB) into a single transaction.

상기 쉐도우 가비지 콜렉션을 사용하면 로그 구조 파일시스템이 진행 중인 트랜잭션의 오류 원자성에 영향을 주지 않고 가비지 콜렉션을 수행할 수 있다.The above shadow garbage collection allows the log-structured file system to perform garbage collection without affecting the error atomicity of ongoing transactions.

exF2FS의 트랜잭션 지원은 코드 복잡성을 최소화하고 성능 부작용을 피하면서 어플리케이션 프로그램의 중요한 요구 사항을 충족하도록 신중하게 조정될 수 있다.exF2FS's transaction support can be carefully tuned to meet the critical requirements of your application while minimizing code complexity and avoiding performance side effects.

exF2FS를 사용하면 스톡 SQLite의 다중 파일 트랜잭션에 비해 SQLite 다중 파일 트랜잭션 처리량이 24배 증가한다. 압축을 파일시스템 트랜잭션으로 구현하면 RocksDB 처리량이 87% 증가한다.Using exF2FS increases SQLite multifile transaction throughput by 24x over stock SQLite multifile transactions. Implementing compression as a filesystem transaction increases RocksDB throughput by 87%.

최신 애플리케이션은 종종 멀티플 파일 추상화로 분할되는 일관된 충돌(crashconsistent) 방식으로 데이터를 보호하기 위해 노력한다. 기본 파일시스템으로부터의 적절한 트랜잭션 지원이 없으면 어플리케이션 프로그램은 복잡한 프로토콜을 사용하여 여러 파일에 걸친 트랜잭션 업데이트를 보장하여 긴 쓰기 시퀀스 및 fsync()를 생성한다. vim 및 emacs와 같은 텍스트 편집기는 원자적 rename()을 사용하여 업데이트된 파일을 원자적으로 저장한다.Modern applications often strive to protect data in a crash-consistent manner, splitting it across multiple file abstractions. Without proper transaction support from the underlying file system, application programs use complex protocols to ensure transactional updates across multiple files, generating long write sequences and fsync()s. Text editors such as vim and emacs use atomic rename() to atomically save updated files.

멀티플 데이터베이스 파일을 업데이트하는 트랜잭션의 경우 라이브러리 기반 임베디드 DBMS인 SQLite는 각 데이터베이스 파일에 대해 별도의 저널 파일을 유지 관리하므로 과도한 fdatasync() 호출과 대규모 쓰기 증폭이 발생한다. RocksDB와 같은 최신 LSM 기반 키-값 스토리지의 압축 작업(compaction operation)은 매니페스트(manifest) 파일로 알려진 별도의 저널 파일에서 병합 정렬(merge-sort) 상태를 유지한다. 압축 작업의 실패-원자성을 위해 키-값 스토리지 엔진은 출력 파일을 개별적으로 플러시(flush)하고 압축의 전역(global) 상태를 매니페스트 파일로 플러시 한다.For transactions that update multiple database files, SQLite, a library-based embedded DBMS, maintains a separate journal file for each database file, resulting in excessive fdatasync() calls and large write amplification. The compaction operation of modern LSM-based key-value stores such as RocksDB maintains the merge-sort state in a separate journal file, known as the manifest file. To ensure failure-atomicity of the compaction operation, the key-value storage engine flushes the output files individually and flushes the global state of the compaction to the manifest file.

파일시스템의 트랜잭션 지원을 통해 어플리케이션 프로그램은 각 출력 파일 및 매니페스트 파일에 대한 멀티플 fsync()를 단일 파일시스템 트랜잭션으로 대체하여 중복 IO를 제거하여 더 높은 성능을 렌더링 할 수 있다.Transactional support in the file system allows application programs to replace multiple fsync()s for each output file and manifest file with a single file system transaction, eliminating redundant IO and rendering higher performance.

트랜잭션 지원의 분명한 이점에도 불구하고 운영체제와 파일시스템에 대한 과제는 여전히 남아 있다.Despite the clear benefits of transaction support, challenges remain for operating systems and file systems.

트랜잭션 지원 시스템을 성공적으로 배포하려면 사용 용이성, 코드 복잡성, ACID 지원 정도, 및 성능이라는 네 가지 요구 사항 사이에서 올바른 균형을 찾아야 한다. 불행하게도 이들 중 하나를 달성하려면 종종 다른 비용을 지불해야 한다. 트랜잭션에 대한 시스템 수준의 지원은 크게 네이티브 운영체제 지원, 커널 수준 파일시스템, 사용자 수준 파일시스템 및 트랜잭션 블록 장치의 네 가지로 분류할 수 있다. 운영체제의 일류 시티즌(citizen)으로서 트랜잭션을 지원하는 것이 이상적이다; 그러나 운영체제를 크게 변경해야 한다. 사용자 수준 파일시스템의 트랜잭션 지원은 전체 ACID 트랜잭션을 제공하기 위해 사용자 수준 DBMS를 이용한다. ACID 지원은 성능을 희생한다. 커널 수준 파일시스템의 트랜잭션 지원은 ACID 지원 정도에 따라 더 분류할 수 있다: 완전한 ACID 의미 체계(semantics), 격리 지원이 없는 ACD 또는 격리 및 내구성 지원이 없는 AC 이다. F2FS 트랜잭션은 원자성만 지원하며 격리 및 내구성을 지원하지 않는다.Successfully deploying a transaction support system requires finding the right balance between four requirements: ease of use, code complexity, ACID support, and performance. Unfortunately, achieving one of these often comes at the expense of another. System-level support for transactions can be broadly categorized into four categories: native operating system support, kernel-level filesystems, user-level filesystems, and transactional block devices. Ideally, transactions should be supported as a first-class citizen of the operating system; however, this requires significant changes to the operating system. Transaction support in user-level filesystems utilizes a user-level DBMS to provide full ACID transactions. ACID support comes at the expense of performance. Transaction support in kernel-level filesystems can be further categorized by the degree of ACID support: full ACID semantics, ACD without isolation support, or AC without isolation and durability support. F2FS transactions support only atomicity and do not support isolation or durability.

F2FS의 트랜잭션은 여러 파일에 걸쳐 있을 수 없다. 아이러니하게도 트랜잭션에 대한 최소한의 지원에도 불구하고 F2FS는 트랜잭션 지원을 대중에게 성공적으로 배포하는 유일한 파일시스템이다. F2FS의 트랜잭션 지원에는 SQLite라는 특정 대상 애플리케이션이 있다. F2FS의 원자 쓰기를 사용하면 SQLite는 롤백 저널(rollback journal) 파일 없이 트랜잭션을 구현할 수 있으며 과도한 플러시 오버헤드를 제거할 수 있다.F2FS transactions cannot span multiple files. Ironically, despite its minimal support for transactions, F2FS is the only filesystem to have successfully deployed transaction support to the public. F2FS's transaction support has a specific target application: SQLite. F2FS's atomic writes allow SQLite to implement transactions without a rollback journal file, eliminating the excessive flush overhead.

본 발명에서는 파일시스템 수준 트랜잭션 지원을 제공하는 문제를 다시 살펴본다. 특히 로그구조의 파일시스템에 관심영역을 집중한다. 트랜잭션 파일시스템에 대한 종래 기술의 대부분은 저널링 파일시스템을 기본 파일시스템으로 사용한다. 이러한 종래 기술은 트랜잭션 기능을 제공하기 위해 파일시스템의 저널링 계층을 이용한다. 플래시 스토리지용으로 설계된 로그 구조 파일시스템인 F2FS는 최근 스마트폰 플랫폼에서 널리 보급되었으며 클라우드 플랫폼으로 확장되기 시작했다. 로그 구조 파일시스템에서 트랜잭션 지원을 다룬 연구는 거의 없다. 일부 종래 연구에서는 로그 구조 파일시스템에서 트랜잭션 지원을 다루고 있지만, 상기 종래 연구는 트랜잭션 지원 측면에서 제한적이다. 또한 상기 종래 연구는 다중 파일 트랜잭션, 트랜잭션 스틸링, 트랜잭션과 가비지 콜렉션 간의 충돌 처리를 지원하지 않는다.In this invention, we revisit the problem of providing file system level transaction support. In particular, we focus on log-structured file systems. Most of the prior art on transactional file systems uses journaling file systems as their underlying file systems. These prior art techniques utilize the journaling layer of the file system to provide transaction functionality. F2FS, a log-structured file system designed for flash storage, has recently become widespread on smartphone platforms and has begun to expand to cloud platforms. There is little research on transaction support in log-structured file systems. Although some prior art studies have addressed transaction support in log-structured file systems, these prior art studies are limited in terms of transaction support. In addition, these prior art studies do not support multi-file transactions, transaction stealing, and conflict handling between transactions and garbage collection.

본 발명에서는 에서는 세 가지 설계 목표를 가진 로그 구조 파일시스템의 트랜잭션 지원을 제시한다. (i) 트랜잭션은 디렉토리를 포함하여 여러 파일에 걸쳐 있을 수 있어야 하고, (ii) 트랜잭션은 많은 양의 업데이트를 처리할 수 있어야 하며, (iii) 트랜잭션은 가비지 콜렉션 실행의 영향을 받지 않아야 한다. 이러한 각 요구 사항은 어플리케이션 프로그램의 관점에서 볼 때 평범하고 필수적으로 보인다. 불행하게도 이러한 간단하고 평범한 요구 사항을 충족하는 트랜잭션 로그 구조 파일시스템을 개발하는 것은 설계 및 구현 측면에서 기본 파일시스템의 실질적인 변경을 요구하는 사소한 작업이다; 새로운 트랜잭션 모델 개발, 파일시스템의 페이지 회수 절차 재설계 및 가비지 콜렉션 절차 재설계. 충분한 성숙도를 갖춘 트랜잭션 관리에서 이러한 필수 요구 사항을 해결하는 최신 트랜잭션 파일시스템은 거의 없다. In this paper, we present transaction support in a log-structured file system with three design goals: (i) a transaction should be able to span multiple files, including directories, (ii) a transaction should be able to handle a large number of updates, and (iii) a transaction should be immune to garbage collection operations. Each of these requirements seems trivial and essential from the perspective of an application program. Unfortunately, developing a transaction log-structured file system that satisfies these simple and trivial requirements is a non-trivial task that requires substantial changes to the underlying file system in terms of design and implementation; developing a new transaction model, redesigning the file system's page reclamation procedure, and redesigning the garbage collection procedure. Few modern transactional file systems address these essential requirements in terms of transaction management with sufficient maturity.

본 발명에서는 트랜잭션이 여러 파일에 걸쳐 있을 수 있도록 멤버십 지향 트랜잭션 모델을 제시한다. 또한, 트랜잭션이 수십 GB의 데이터가 있는 수백 개의 파일로 구성될 수 있는 대용량 트랜잭션을 처리할 수 있도록 파일시스템 트랜잭션을 위한 스틸링을 제시한다. 또한, 가비지 콜렉션이 진행 중인 트랜잭션을 방해하지 않도록 쉐도우 가비지 콜렉션을 제시한다. The present invention proposes a membership-oriented transaction model that allows transactions to span multiple files. It also proposes stealing for file system transactions to handle large transactions where a transaction may consist of hundreds of files with tens of GB of data. It also proposes shadow garbage collection to ensure that garbage collection does not interfere with ongoing transactions.

본 발명에 의해 주요 효과는 다음과 같다. The main effects of the present invention are as follows.

첫째, 본 발명의 멤버십-오리엔티드 트랜잭션(Membership-Oriented Transaction)에 따르면, 파일시스템은 디렉토리를 포함하여 트랜잭션과 관련된 파일 집합을 지정하는 트랜잭션 파일 그룹인 커널 개체를 유지 관리한다. 멤버십-오리엔티드 트랜잭션을 사용하면 애플리케이션이 트랜잭션 대상 파일을 명시적으로 지정할 수 있다.First, according to the membership-oriented transaction of the present invention, the file system maintains a kernel object, a transaction file group, which specifies a set of files involved in a transaction, including a directory. Membership-oriented transactions allow applications to explicitly specify the target files of a transaction.

둘째, 본 발명의 스틸링(Stealing)을 이용하면, 커밋 되지 않은 트랜잭션의 더티 페이지가 이빅트(evict)되도록 허용하면서도 트랜잭션의 원자성을 보장한다. 본 발명에서는 파일시스템 트랜잭션에서 스틸링을 실현하기 위해 지연된 무효화(Delayed Invalidation)재배치 레코드(Relocation Record)를 제시한다. 상기 지연된 무효화는 이빅트 된 페이지(evicted pages)의 올드 디스크 위치(old disk locations)가 트랜잭션이 커밋 될 때까지 가비지 콜렉션 되는 것을 금지한다. 상기 재배치 레코드는 각각, 이빅트 된 페이지를 중단(abort)하고 커밋(commit)하기 위한 실행 취소(undo) 및 재실행(redo) 정보를 유지한다.Second, stealing of the present invention allows dirty pages of uncommitted transactions to be evicted while ensuring the atomicity of the transaction. The present invention proposes delayed invalidation and relocation records to realize stealing in file system transactions. The delayed invalidation prevents old disk locations of evicted pages from being garbage collected until the transaction is committed. The relocation records maintain undo and redo information for aborting and committing evicted pages, respectively.

셋째, 본 발명의 쉐도우 가비지 컬렉션(Shadow Garbage Collection)을 이용하면, 가비지 콜렉션 모듈이 커밋 되지 않은 트랜잭션의 더티 페이지를 조기에 내구성 및 복구 가능하게 만드는 것을 금지할 수 있다. 쉐도우 가비지 콜렉션을 사용하면 파일시스템이 진행 중인 트랜잭션에 투명하게 가비지 콜렉션을 수행할 수 있다.Third, by using the shadow garbage collection of the present invention, the garbage collection module can be prevented from making dirty pages of uncommitted transactions durable and recoverable early. Shadow garbage collection allows the file system to perform garbage collection transparently for ongoing transactions.

본 발명에서는 F2FS에서 이러한 기능을 구현한다. 본 발명에서는 이렇게 새로 개발된 파일시스템을 확장 F2FS(exF2FS)라고 부른다. exF2FS는 스톡 SQLite에 비해 SQLite 성능을 24배 향상시키고 SQLite의 PERSIST 저널 모드에 비해 쓰기 볼륨을 1/6로 줄인다. YCSB 워크로드-A에서 RocksDB 성능을 87% 향상시킨다. exF2FS가 기존 F2FS 파티션을 마운트 할 수 있도록 기존 F2FS의 디스크 구조를 변경하지 않도록 특별한 주의를 기울일 필요가 있다.In this invention, we implement these features in F2FS. In this invention, we call this newly developed file system Extended F2FS (exF2FS). exF2FS improves SQLite performance by 24x compared to stock SQLite and reduces write volume by 1/6 compared to SQLite's PERSIST journal mode. It improves RocksDB performance by 87% on YCSB workload-A. Special care must be taken not to change the disk structure of the existing F2FS so that exF2FS can mount the existing F2FS partition.

<멀티-파일 트랜잭션><Multi-file Transaction>

다중 파일 트랜잭션은 최신 소프트웨어의 필수 부분이다. 다음은 현재 사용되고 있는 다중 파일 트랜잭션 방식의 몇 가지 예이다.Multi-file transactions are an essential part of modern software. Here are some examples of multi-file transaction methods in use today.

[웹 브라우저에서 검색 기록을 유지] Chrome 브라우저는 방문한 URL, 다운로드 파일 리스트, 각 URL에 대한 액세스 기록 및 가장 자주 방문한 URL 리스트와 같은 사용자 브라우징 활동을 유지한다. Chrome은 이들 각각을 별도의 파일로 유지하고 이러한 파일을 오류 원자적 방식(failure-atomic fashion)으로 업데이트한다. 오류 원자성(failure-atomicity)을 위해 Chrome은 SQLite를 사용하여 과도한 IO를 렌더링 하는 이러한 파일을 업데이트한다. SQLite 트랜잭션은 비효율적이다. [Keeping browsing history in web browser] Chrome browser keeps user browsing activity such as visited URLs, list of downloaded files, access history for each URL, and list of most frequently visited URLs. Chrome keeps each of these in separate files and updates these files in a failure-atomic fashion. For failure-atomicity, Chrome uses SQLite to update these files, which renders excessive IO. SQLite transactions are inefficient.

[LSM 기반 키-값 스토리지의 압축] 압축은 간격이 겹치는 여러 SSTable을 겹치지 않는 간격의 출력 파일 시퀀스로 병합 정렬하는 프로세스이다. 압축 작업의 오류 원자성은 각 출력 파일과 상위 디렉터리에 대해 fsync()를 호출하고 트랜잭션의 전역 상태를 매니페스트 파일이라는 특수 파일로 플러시 한다. YCSB의 "로드" 워크로드에서 RocksDB의 단일 압축은 총 13.3GB에 대해 최대 198개의 출력 파일(200개 이상의 fsync())을 생성할 수 있다.[LSM-based Key-Value Storage Compression] Compression is the process of merging and sorting multiple SSTables with overlapping intervals into a sequence of non-overlapping output files. The error atomicity of the compaction operation is achieved by calling fsync() for each output file and its parent directory, and flushing the global state of the transaction to a special file called a manifest file. Under a "load" workload on YCSB, a single compaction in RocksDB can produce up to 198 output files (over 200 fsync()s) for a total of 13.3 GB.

[소프트웨어 설치] 새 소프트웨어를 업데이트하거나 설치하려면 수백 개의 파일을 다운로드 및 수정하고 장애 원자적 방식으로 관련 디렉터리를 업데이트해야 한다. 설치 또는 업데이트가 부분적으로 완료되면 종종 시스템이 불안정해진다.[Software Installation] Updating or installing new software requires downloading and modifying hundreds of files and updating related directories in an atomic manner. Partial installations or updates often result in system instability.

[메일 클라이언트] MAILDIR IMAP 형식은 사서함과 메시지를 각각 디렉토리로 유지하고 디렉토리의 파일로 유지한다. 이메일 클라이언트는 트랜잭션 방식으로 메시지 파일과 관련 디렉토리를 업데이트한다. 기본 파일시스템에서 트랜잭션 지원이 없으면 메일 클라이언트는 비용이 많이 드는 원자 이름 변경을 사용하여 메일함과 메시지를 트랜잭션 방식으로 관리한다.[Mail client] MAILDIR IMAP format maintains mailboxes and messages as directories, respectively, and as files in the directories. The email client updates message files and associated directories in a transactional manner. If the underlying file system does not support transactions, the email client uses expensive atomic renames to manage mailboxes and messages in a transactional manner.

<멀티-파일 트랜잭션 및 SQLite><Multi-file Transactions and SQLite>

SQLite는 Android Mail 및 Facebook App과 같은 모바일 애플리케이션, Gmail 및 Apple iWork와 같은 데스크톱 애플리케이션, Lustre 및 Ceph와 같은 분산 파일시스템 등 다양한 애플리케이션에서 널리 사용되는 서버리스 임베디드 DBMS이다. 이러한 애플리케이션은 SQLite를 사용하여 여러 파일에 대한 업데이트를 오류 원자적 방식으로 지속적으로 관리한다. SQLite가 기본 파일시스템의 트랜잭션 지원으로부터 어떻게 이점을 얻을 수 있는지 이해하기 위해 SQLite의 다중 파일 트랜잭션의 IO 동작을 계측한다.SQLite is a widely used serverless embedded DBMS in various applications, such as mobile applications such as Android Mail and Facebook App, desktop applications such as Gmail and Apple iWork, and distributed file systems such as Lustre and Ceph. These applications use SQLite to manage updates to multiple files in a fault-atomic manner. To understand how SQLite can benefit from the transaction support of the underlying file system, we instrument the IO behavior of SQLite's multi-file transactions.

SQLite를 사용하여 데이터를 지속적으로 관리하면 어플리케이션 프로그램이 더 간단해질 수 있지만 SQLite의 파일 지원 저널링 및 페이지 세분화 물리적 로깅으로 인해 상당한 쓰기 증폭과 과도한 플러시가 발생한다. SQLite의 단일 insert()는 40KB의 write()와 함께 5개의 fdatasync()를 발생시킨다. SQLite 트랜잭션의 극단적인 IO 비효율성을 개선하기 위한 몇 가지 연구가 있었다. 이러한 모든 노력은 단일 데이터베이스 파일이 있는 트랜잭션의 IO 오버헤드를 개선하는 데 제한된다.Using SQLite to persist data can make application programs simpler, but SQLite's file-backed journaling and page-granular physical logging cause significant write amplification and excessive flushing. A single insert() in SQLite causes 5 fdatasync()s along with a 40KB write(). There have been several studies to improve the extreme IO inefficiency of SQLite transactions. All of these efforts are limited to improving the IO overhead of transactions with a single database file.

SQLite는 마스터 저널 파일에서 다중 파일 트랜잭션의 전역 상태를 기록하기 위해 단일 파일 트랜잭션 및 몇 가지 플러시의 모음으로 다중 파일 트랜잭션을 구성한다. SQLite는 아래 나열된 네 단계로 다중 파일 트랜잭션을 구현한다. 제1단계와 제3단계는 마스터 저널 파일을 업데이트하기 위한 것이다. 제2단계와 제4단계는 일련의 단일 파일 처리를 실행하기 위한 것이다. SQLite constructs a multifile transaction as a collection of single-file transactions and several flushes to record the global state of the multifile transaction in a master journal file. SQLite implements a multifile transaction in four phases, as listed below. Phases 1 and 3 are for updating the master journal file. Phases 2 and 4 are for performing a series of single-file operations.

도 2는 이러한 각 단계가 물리적 실험을 통해 IO 동작과 어떻게 연관되는지 보여준다. 여기서 트랜잭션은 서로 다른 세 개의 데이터베이스 파일에 대한 세 개의 삽입으로 구성된다.Figure 2 shows how each of these steps relates to IO operations through a physical experiment, where a transaction consists of three inserts into three different database files.

제1단계: 마스터 저널 파일을 초기화한다. SQLite는 마스터 저널 파일에 저널 파일의 이름을 기록한다. 그런 다음 마스터 저널 파일(도 2의 S1)과 업데이트된 디렉토리를 디스크(도 2의 S2)로 플러시 한다.Step 1: Initialize the master journal file. SQLite records the name of the journal file in the master journal file. Then, it flushes the master journal file (S1 in Figure 2) and the updated directory to disk (S2 in Figure 2).

제2단계: 로깅 및 데이터베이스 업데이트. SQLite는 저널 파일에 실행 취소 레코드를 기록하고 데이터베이스 파일을 업데이트한다. 각 파일은 단일 데이터베이스 트랜잭션에서와 같은 방식으로 업데이트된다(도 2의 S3). 도 2에는 각각 단일 insert()에 해당하는 세 개의 S3이 있다.Step 2: Logging and Database Updates. SQLite writes the undo record to the journal file and updates the database files. Each file is updated in the same way as a single database transaction (S3 in Figure 2). There are three S3s in Figure 2, each corresponding to a single insert().

제3단계: 마스터 저널 파일 삭제. 성공적인 커밋의 표시로 SQLite는 마스터 저널 파일을 삭제하고 연결된 디렉터리를 내구성 있게 만든다(도 2의 S4).Step 3: Delete the master journal file. As a sign of a successful commit, SQLite deletes the master journal file and makes the linked directory durable (S4 in Figure 2).

제4단계: 로그를 재설정한다. SQLite는 저널 파일을 재설정하고 플러시 한다(도 2의 S5).Step 4: Reset the log. SQLite resets and flushes the journal file (S5 in Figure 2).

도 2에서 X축과 Y축은 각각 시간과 LBA를 나타낸다. 여기서 본 발명에서는 F2FS의 3개 영역, 즉 메타데이터 영역, 메인 영역의 데이터 영역, 메인 영역의 노드 영역을 명시적으로 지정한다. SQLite가 fdatasync()를 통해 더티 파일 블록을 플러시 할 때 기본 F2FS는 데이터 블록뿐만 아니라 관련 노드 블록도 각각 데이터 영역과 노드 영역으로 플러시 한다. 도 2의 S1에서 마스터 저널 파일(fd(mj))을 플러시하면 두 개의 개별 4KB IO가 디스크에 렌더링 된다. 하나는 데이터 블록 플러시용이고 다른 하나는 노드 블록 플러시용이다. 데이터 블록과 관련 노드 블록은 파일시스템의 무결성을 보장하기 위해 내구성이 있어야 한다. 각 insert()에는 세 개의 fdatasync()(S3)가 있다. 첫 번째와 두 번째 fdatasync()는 롤백 저널 파일을 플러시하기 위한 것이다. 세 번째는 데이터베이스 파일을 플러시하기 위한 것이다. S4에서 SQLite는 마스터 저널 파일을 삭제하고 상위 디렉토리를 유지한다. 마스터 저널 파일의 연결 해제가 지속되면 트랜잭션이 커밋 된다. S5에서 SQLite는 트랜잭션의 롤백 저널 파일을 재설정한다.In Fig. 2, the X-axis and the Y-axis represent time and LBA, respectively. Here, the present invention explicitly specifies three areas of F2FS, namely, the metadata area, the data area of the main area, and the node area of the main area. When SQLite flushes a dirty file block through fdatasync(), the default F2FS flushes not only the data block but also the associated node block to the data area and the node area, respectively. When the master journal file (fd(mj)) is flushed in S1 of Fig. 2, two separate 4KB IOs are rendered to the disk. One is for flushing the data block and the other is for flushing the node block. The data block and the associated node block must be durable to ensure the integrity of the file system. There are three fdatasync() (S3) for each insert(). The first and second fdatasync() are for flushing the rollback journal file. The third is for flushing the database file. In S4, SQLite deletes the master journal file and maintains the parent directory. If the disconnection of the master journal file persists, the transaction is committed. In S5, SQLite resets the rollback journal file for a transaction.

도 2에서와 같이 SQLite 다중 파일 트랜잭션의 IO 오버헤드는 다소 치명적이다. 3개의 100바이트 레코드를 삽입하면 15개의 fdatasync()와 180KB가 디스크에 기록된다.As shown in Figure 2, the IO overhead of SQLite multi-file transactions is rather severe: inserting three 100-byte records results in 15 fdatasync()s and 180KB written to disk.

<로그 구조 파일시스템, F2FS 및 원자성 쓰기><Log-structured file system, F2FS and atomic writes>

본 발명에서는 기본 로그 구조 파일시스템으로 F2FS를 사용한다. F2FS에는 원래의 로그 구조 파일시스템 설계와 차별화되는 여러 주요 설계 기능이 있다. 그 중 본 발명에서 중점을 둔 두 가지 기능은 블록 할당 비트맵과 이중 로그 파티션 레이아웃이다. 스틸링 및 쉐도우 가비지 콜렉션을 실현하려면 F2FS가 블록 할당 비트맵과 두 개의 로그를 조작하고 업데이트하는 방식을 점검해야 한다.The present invention uses F2FS as the basic log-structured file system. F2FS has several key design features that differentiate it from the original log-structured file system design. Among them, the two features that the present invention focuses on are the block allocation bitmap and the dual log partition layout. In order to realize stealing and shadow garbage collection, it is necessary to examine how F2FS manipulates and updates the block allocation bitmap and the two logs.

첫 번째는 블록 할당 비트맵이다. 원래의 로그 구조 파일시스템 설계에는 파일시스템 파티션의 지정된 블록이 할당되었는지 여부를 지정하는 명시적인 데이터 구조가 없다. 파일시스템은 파일 매핑을 통해 도달할 수 있는 경우 파일시스템 파티션의 블록이 할당된 것으로 결정한다. F2FS는 파일시스템의 주어진 블록이 유효한지 여부를 나타내기 위해 블록 할당 비트맵을 유지한다. The first is the block allocation bitmap. The original log-structured filesystem design had no explicit data structure that specified whether a given block in a filesystem partition was allocated. The filesystem determines that a block in a filesystem partition is allocated if it is reachable through a file mapping. F2FS maintains a block allocation bitmap to indicate whether a given block in the filesystem is valid.

두 번째는 이중 로그 파티션 레이아웃이다. 레거시 로그 구조 파일시스템은 파일시스템 파티션을 단일 로그로 취급한다. 데이터 블록과 관련 filemap1을 함께 클러스터링하고 단일 단위로 플러시 한다. F2FS는 데이터 영역과 노드 영역이라는 두 개의 개별 로그로 파일시스템 파티션을 구성한다. F2FS는 데이터 블록과 노드 블록을 관련 영역에 각각 배치한다. 레거시 로그 구조 파일시스템과 달리 F2FS는 데이터 블록과 노드 블록을 별도로 쓴다. 시스템 충돌에 대해 파일시스템 무결성을 유지하기 위해 F2FS는 데이터 블록이 연결된 노드 블록보다 먼저 내구성이 있는지 확인한다. F2FS의 이러한 순서 지정 메커니즘으로 인해 데이터 블록 쓰기를 위한 블록 추적은 도 2와 같이 데이터 블록과 노드 블록에 대한 각 쓰기 쌍에서 노드 블록 쓰기를 위한 블록 추적 전에 나타난다.The second is the dual-log partition layout. Legacy log-structured file systems treat a file system partition as a single log. They cluster data blocks and their associated filemap1 together and flush them as a single unit. F2FS organizes a file system partition into two separate logs: the data area and the node area. F2FS places data blocks and node blocks in their associated areas, respectively. Unlike legacy log-structured file systems, F2FS writes data blocks and node blocks separately. To maintain file system integrity against system crashes, F2FS checks whether a data block is durable before its associated node block. Due to this ordering mechanism in F2FS, the block trace for a data block write appears before the block trace for a node block write in each write pair for a data block and a node block, as shown in Figure 2.

F2FS는 원자 쓰기 기능을 제공한다. 애플리케이션은 오류 원자적 방식으로 단일 파일에 대해 여러 블록을 쓸 수 있다. 이 기능은 주로 SQLite의 단일 파일 트랜잭션의 과도한 IO 오버헤드를 해결하기 위한 것이다.F2FS provides atomic write capability. Applications can write multiple blocks to a single file in an error-atomic manner. This feature is primarily intended to address the excessive IO overhead of single-file transactions in SQLite.

start_atomic_write(fd) ;start_atomic_write(fd) ;

write(fd, block1) ;write(fd, block1) ;

write(fd, block2) ;write(fd, block2) ;

commit_atomic_write(fd) ;commit_atomic_write(fd) ;

원자 쓰기의 경우 F2FS는 inode의 더티 페이지 리스트를 유지 관리한다. 트랜잭션이 파일 블록을 업데이트하면 더티 페이지를 inode별 더티 페이지 리스트에 삽입하고 더티 페이지를 메모리에 피닝 한다. 트랜잭션이 커밋 되면 파일시스템은 inode별 더티 페이지 리스트에서 더티 페이지의 피닝을 해제하고 디스크에 대한 업데이트된 파일 매핑을 보유하는 더티 페이지 및 관련 노드 블록을 플러시 한다. 원자 쓰기는 커밋 될 때까지 더티 페이지를 메모리에 피닝 하므로 설계상 F2FS는 원자 쓰기 트랜잭션에서 스틸링을 지원할 수 없다. 트랜잭션이 커밋 되면 F2FS는 노드 블록에서 FSYNC_BIT 플래그를 설정한다. 둘 이상의 노드 블록이 플러시 되면 원자 쓰기는 FSYNC_BIT 플래그를 마지막 노드 블록에 배치한다. F2FS는 노드 블록에서 FSYNC_BIT 플래그를 설정하여 롤 포워드 복구 대상임을 표시한다.For atomic writes, F2FS maintains a list of dirty pages for the inode. When a transaction updates a file block, it inserts the dirty page into the per-inode dirty page list and pins the dirty page to memory. When the transaction commits, the file system unpins the dirty page from the per-inode dirty page list and flushes the dirty page and its associated node block that holds the updated file mapping to disk. Since atomic writes pin dirty pages to memory until they are committed, by design F2FS cannot support stealing in atomic write transactions. When a transaction commits, F2FS sets the FSYNC_BIT flag in the node block. If more than one node block is flushed, the atomic write places the FSYNC_BIT flag in the last node block. F2FS sets the FSYNC_BIT flag in a node block to mark it as eligible for roll-forward recovery.

로그 구조 파일시스템은 주기적으로 업데이트된 파일 매핑, 업데이트된 비트맵(F2FS만 해당), 및 각 로그의 마지막 블록의 디스크 위치와 같은 상태를 체크포인트 한다. 파일시스템이 충돌하면 복구 모듈이 가장 최근의 체크포인트 정보와 관련하여 파일시스템의 상태를 복구한다. 롤백 복구 후 복구 모듈은 마지막 위치에서 로그를 스캔하고 FSYNC_BIT로 노드 블록, 즉 가장 최근 체크포인트 이후 성공적으로 완료된 트랜잭션을 찾아 관련 파일을 복구한다.Log-structured file systems periodically checkpoint their state, including updated file mappings, updated bitmaps (F2FS only), and the disk location of the last block in each log. If the file system crashes, the recovery module recovers the state of the file system relative to the most recent checkpoint information. After rollback recovery, the recovery module scans the log from the last location and finds node blocks with FSYNC_BIT, i.e., transactions that completed successfully after the most recent checkpoint, and recovers the associated files.

본 발명에서는 트랜잭션 로그 구조 파일시스템이 충족해야 하는, (i) 다중 파일 트랜잭션, (ii) 스틸링 및 (iii) 트랜잭션 인식 가비지 콜렉션이라는 세 가지 제약 조건을 정의한다. 본 발명에서는 이러한 제약 조건을 만족하는 트랜잭션 로그 구조 파일시스템인 exF2FS를 제시한다. exF2FS의 핵심 기술 구성 요소는 멤버쉽-오리엔티드 트랜잭션, 스틸링-이네이블드 트랜잭션 및 쉐도우 가비지 콜렉션이다. 각 구성 요소는 아래에 요약되어 있다.The present invention defines three constraints that a transaction log structured file system must satisfy: (i) multi-file transactions, (ii) stealing, and (iii) transaction-aware garbage collection. The present invention proposes exF2FS, a transaction log structured file system that satisfies these constraints. The core technical components of exF2FS are membership-oriented transactions, stealing-enabled transactions, and shadow garbage collection. Each component is summarized below.

[멤버쉽-오리엔티드 트랜잭션] F2FS의 트랜잭션은 inode 단위로 트랜잭션의 더티 페이지를 유지하기 때문에 여러 파일에 걸쳐 있을 수 없다. 본 발명에서는 멤버쉽-오리엔티드 트랜잭션이라는 새로운 트랜잭션 모델을 개발한다. 멤버쉽-오리엔티드 트랜잭션에서 파일시스템은 업데이트가 트랜잭션으로 처리되어야 하는 파일 집합인 트랜잭션 파일 그룹을 정의하고 각 트랜잭션 파일 그룹에 대한 트랜잭션의 더티 페이지를 유지 관리한다. 멤버쉽-오리엔티드 트랜잭션에서 트랜잭션은 여러 파일에 걸쳐 있을 수 있으며 어플리케이션 프로그램은 트랜잭션이 적용되는 파일을 명시적으로 지정할 수 있다.[Membership-oriented transaction] A transaction in F2FS cannot span multiple files because it maintains the dirty pages of the transaction in inode units. In the present invention, a new transaction model called membership-oriented transaction is developed. In a membership-oriented transaction, the file system defines a transaction file group, which is a set of files whose updates must be processed as transactions, and maintains the dirty pages of the transaction for each transaction file group. In a membership-oriented transaction, a transaction can span multiple files, and an application program can explicitly specify the files to which the transaction applies.

[스틸링-이네이블드 트랜잭션] 스틸링의 경우, 파일시스템이 커밋 되지 않은 트랜잭션의 더티 페이지를 회수(reclaim)할 때, 페이지 회수(reclamation) 결과를 취소(undone)할 수 있도록 페이지 회수(reclamation) 절차를 점검한다. 스틸링-이네이블드 트랜잭션을 통해 제안된 파일시스템은 적은 양의 메모리로, 예컨대 수십 GB의 데이터가 포함된 수백 개의 파일과 같은 대규모 트랜잭션을 지원할 수 있다.[Stealing-Enabled Transactions] In the case of stealing, when the file system reclaims dirty pages of uncommitted transactions, it checks the page reclamation procedure so that the page reclamation result can be undone. With stealing-enabled transactions, the proposed file system can support large transactions, such as hundreds of files containing tens of GB of data, with a small amount of memory.

[쉐도우 가비지 콜렉션] 가비지 콜렉션은 커밋 되지 않은 트랜잭션과 연결된 더티 페이지를 내구성 있게 만들 수 있으며 트랜잭션이 커밋되기 전에 업데이트된 파일 매핑을 조기에 체크포인트 할 수 있다. 커밋 되지 않은 트랜잭션에서 가비지 콜렉션을 분리하기 위해 쉐도우 가비지 콜렉션을 개발한다.[Shadow Garbage Collection] Garbage collection can make dirty pages associated with uncommitted transactions durable and can early checkpoint updated file mappings before the transaction is committed. Shadow Garbage Collection is developed to isolate garbage collection from uncommitted transactions.

<멤버쉽-오리엔티드 트랜잭션 모델><Membership-Oriented Transaction Model>

본 발명에서는 멤버쉽-오리엔티드 트랜잭션이라는 새로운 트랜잭션 모델을 제안한다. 이 모델에서는 새 커널 엔티티(entity)인 트랜잭션 파일 그룹을 정의한다. 트랜잭션 파일 그룹은 업데이트를 하나의 트랜잭션으로 처리해야 하는 파일들의 집합으로 도 3과 같이 트랜잭션 멤버쉽(아이노드 집합), 더티 페이지 리스트, 재배치 리스트, 마스터 커밋 블록으로 구성된다. 트랜잭션 파일 그룹 객체의 네임스페이스에 해시 테이블을 사용하는데, 이는 세마포어(semaphore) 및 파이프(pipe)와 같은 커널 객체의 네임스페이스를 구성하는 데 널리 사용된다.In this invention, we propose a new transaction model called membership-oriented transaction. In this model, a new kernel entity, transaction file group, is defined. The transaction file group is a set of files whose updates must be processed as a single transaction, and is composed of transaction membership (a set of inodes), a dirty page list, a relocation list, and a master commit block, as shown in Fig. 3. A hash table is used in the namespace of the transaction file group object, which is widely used to configure the namespace of kernel objects such as semaphores and pipes.

트랜잭션 파일 그룹을 사용하면 애플리케이션이 트랜잭션에 포함되어야 하는 파일을 지정할 수 있다. 더티 페이지 리스트는 트랜잭션 멤버 파일에 대한 더티 페이지 세트이다. 더티 페이지 리스트에는 더티 데이터 페이지 리스트와 더티 노드 페이지 리스트의 두 가지 개별 더티 페이지 리스트가 있다. 재배치 리스트는 재배치 레코드 집합이다. 재배치 레코드에는 이빅트 된 페이지에 대한 정보(파일 ID, 파일 오프셋, 올드 디스크 위치 및 새 디스크 위치)가 포함되어 있다. 마스터 커밋 블록은 트랜잭션 멤버쉽 내의 각 파일에 대한 마지막 노드 블록의 디스크 위치를 보유한다. 마스터 커밋 블록과 함께 트랜잭션 파일 그룹을 사용하면 트랜잭션이 여러 파일에 걸쳐 있을 수 있다. 재배치 리스트(Relocation List)는 스틸링 및 쉐도우 가비지 콜렉션에 사용된다.Transactional file groups allow an application to specify which files should be included in a transaction. A dirty page list is a set of dirty pages for a transaction member file. There are two separate dirty page lists in the dirty page list: a dirty data page list and a dirty node page list. A relocation list is a set of relocation records. A relocation record contains information about an evicted page (file ID, file offset, old disk location, and new disk location). A master commit block holds the disk location of the last node block for each file in the transaction membership. Using a transactional file group with a master commit block allows a transaction to span multiple files. The relocation list is used for stealing and shadow garbage collection.

<트랜잭션 API><Transaction API>

애플리케이션은 명시적 호출(explicit call)로 트랜잭션 파일 그룹을 생성한다. 애플리케이션이 트랜잭션 파일 그룹을 생성하면 트랜잭션 파일 그룹의 ID가 애플리케이션에 반환된다. 애플리케이션은 트랜잭션 파일 그룹에서 파일을 추가하거나 제거할 수 있다. 진행 중인 트랜잭션 간의 충돌을 방지하기 위해 애플리케이션이 진행 중인 트랜잭션의 트랜잭션 파일 그룹에서 파일을 추가하거나 제거하는 것을 금지한다. 트랜잭션이 파일을 생성할 때 새로 생성된 파일은 멤버십 상속이라고 하는 상위 디렉터리에서 멤버십을 상속한다. 멤버십 상속은 새로 생성된 파일이 외부에 표시되기 전에 트랜잭션 파일 그룹에 추가되기 때문에 트랜잭션 충돌로부터 트랜잭션에 의해 생성된 파일을 저장한다. 디렉터리가 트랜잭션 파일 그룹에서 제거되면 멤버쉽 자격을 상속한 하위 파일도 트랜잭션 파일 그룹에서 제거된다.An application creates a transaction file group with an explicit call. When an application creates a transaction file group, the ID of the transaction file group is returned to the application. The application can add or remove files from the transaction file group. To avoid conflicts between ongoing transactions, an application is prohibited from adding or removing files from the transaction file group of an ongoing transaction. When a transaction creates a file, the newly created file inherits membership from its parent directory, which is called membership inheritance. Membership inheritance saves files created by a transaction from transaction conflicts because newly created files are added to the transaction file group before they are made visible to the outside world. When a directory is removed from a transaction file group, the child files that inherited the membership are also removed from the transaction file group.

애플리케이션은 트랜잭션을 시작할 때 트랜잭션 파일 그룹의 ID를 지정한다. 트랜잭션이 시작되면 파일시스템은 파일이 진행 중인 트랜잭션과 연결되어 있음을 나타내는 트랜잭션 멤버 파일의 inode에 플래그를 설정한다. 애플리케이션은 트랜잭션 커밋을 호출할 때 트랜잭션 파일 그룹의 ID를 지정한다. exF2FS는 트랜잭션 중단 및 트랜잭션 삭제를 위한 API를 제공한다. 애플리케이션이 트랜잭션 파일 그룹 삭제를 요구할 때 트랜잭션 파일 그룹에 대해 진행 중인 트랜잭션이 없으면 트랜잭션 파일 그룹 및 관련 개체의 할당이 해제된다. 애플리케이션이 트랜잭션 파일 그룹 삭제를 요구할 때 진행 중인 트랜잭션이 있으면 exF2FS는 먼저 트랜잭션을 중단한 다음 트랜잭션 파일 그룹을 삭제한다. An application specifies the ID of a transaction file group when it starts a transaction. When a transaction starts, the file system sets a flag in the inode of the transaction member file to indicate that the file is associated with an ongoing transaction. An application specifies the ID of a transaction file group when it calls transaction commit. exF2FS provides APIs for aborting and deleting transactions. When an application requests to delete a transaction file group, if there are no ongoing transactions for the transaction file group, the transaction file group and its associated objects are deallocated. If an application requests to delete a transaction file group and there are ongoing transactions, exF2FS first aborts the transaction and then deletes the transaction file group.

exF2FS에서 트랜잭션은 rename(), unlink() 및 create()와 같은 디렉터리 업데이트를 포함할 수 있다. F2FS 트랜잭션은 트랜잭션에서 디렉터리 업데이트를 지원하지 않는다.In exF2FS, transactions can include directory updates such as rename(), unlink(), and create(). F2FS transactions do not support directory updates in transactions.

<커밋(commit) 및 중단(abort)> <Commit and Abort>

트랜잭션이 트랜잭션 파일 그룹의 파일을 업데이트하면 업데이트된 페이지 캐시 항목을 트랜잭션 파일 그룹의 더티 데이터 페이지 리스트에 삽입한다.When a transaction updates a file in a transaction file group, the updated page cache entry is inserted into the list of dirty data pages in the transaction file group.

트랜잭션을 커밋 할 때 파일시스템은 트랜잭션 커밋을 위해 더티 데이터 페이지, 더티 노드 페이지 및 마스터 커밋 블록을 준비한다. 먼저, 파일시스템은 더티 페이지 리스트의 더티 데이터 페이지를 활성 데이터 세그먼트에 삽입하고 각 더티 데이터 페이지에 대한 디스크 위치를 얻는다. 둘째, 파일시스템은 각 데이터 페이지의 새 디스크 위치로 관련 노드 페이지를 업데이트하고 업데이트된 노드 페이지를 더티 노드 페이지 리스트에 삽입하고 각 더티 노드 페이지의 디스크 위치를 결정한다. 셋째, 파일시스템은 마스터 커밋 블록을 할당하고 마스터 커밋 블록의 더티 노드 페이지 리스트에 각 노드 페이지의 디스크 위치를 저장한다. 그런 다음 파일시스템은 마스터 커밋 블록에서 FSYNC_BIT 플래그를 설정한다.When committing a transaction, the file system prepares dirty data pages, dirty node pages, and a master commit block for the transaction commit. First, the file system inserts the dirty data pages in the dirty page list into the active data segment and obtains the disk location for each dirty data page. Second, the file system updates the associated node page with the new disk location for each data page, inserts the updated node page into the dirty node page list, and determines the disk location for each dirty node page. Third, the file system allocates a master commit block and stores the disk location of each node page in the dirty node page list of the master commit block. Then the file system sets the FSYNC_BIT flag in the master commit block.

이러한 단계가 완료되면 exF2FS는 더티 데이터 페이지, 더티 노드 페이지 및 마스터 커밋 블록을 플러시 한다. 데이터 블록과 노드 블록이 내구성을 갖게 된 후에야 마스터 커밋 블록이 내구성을 갖게 된다. 마스터 커밋 블록은 여러 파일의 더티 페이지를 단일 다중 파일 트랜잭션으로 조작하는 핵심 구성 요소이다. 마스터 커밋 블록이 지속되면 파일시스템은 재배치 리스트를 스캔하고 재배치 레코드의 올드 디스크 위치를 무효화한다. After these steps are completed, exF2FS flushes dirty data pages, dirty node pages, and the master commit block. Only after the data blocks and node blocks are durable does the master commit block become durable. The master commit block is the core component that manipulates dirty pages from multiple files as a single multifile transaction. When the master commit block is persistent, the file system scans the relocation list and invalidates the old disk locations of the relocation records.

트랜잭션이 중단되면 더티 페이지 리스트의 모든 항목이 삭제되고 더티 페이지 리스트가 비게 된다. 중단된 트랜잭션에 제거된 페이지가 있는 경우 파일 매핑 정보는 재배치 레코드를 기반으로 원래 위치로 취소된다.When a transaction is aborted, all entries in the dirty page list are deleted and the dirty page list becomes empty. If the aborted transaction has removed pages, the file mapping information is canceled to the original location based on the relocation record.

시스템이 충돌하면 복구 모듈이 롤백 복구를 수행하고 파일시스템 상태를 가장 최근 체크포인트로 설정한다. 그런 다음 exF2FS는 롤 포워드 복구를 수행한다. 체크포인트에 기록된 마지막 로깅 오프셋에서 시작하여 로그를 스캔한다. 마스터 커밋 블록을 만나면 복구 모듈이 이를 검사하고 트랜잭션에 있는 파일의 노드 블록 디스크 위치를 식별한다. 그런 다음 exF2FS의 복구 모듈은 스톡 F2FS의 롤 포워드 복구 루틴을 사용하여 각 노드 블록과 관련된 파일을 복구한다. 마스터 커밋 블록이 지속되기 전에 시스템이 충돌하면 메모리에 있던 트랜잭션의 임시 상태가 완전히 손실된다. 이러한 복구 메커니즘을 통해 exF2FS는 트랜잭션의 원자성과 내구성을 보장한다.When the system crashes, the recovery module performs a rollback recovery and sets the filesystem state to the most recent checkpoint. Then, exF2FS performs a rollforward recovery. It scans the log starting from the last logging offset recorded in the checkpoint. When it encounters a master commit block, the recovery module examines it and identifies the node block disk locations of the files in the transaction. The recovery module of exF2FS then uses the rollforward recovery routine of the stock F2FS to recover the files associated with each node block. If the system crashes before the master commit block is persisted, the temporary state of the transaction held in memory is completely lost. Through this recovery mechanism, exF2FS guarantees the atomicity and durability of transactions.

<동시성 제어 및 격리> <Concurrency Control and Isolation>

본격적인 DBMS가 아니기 때문에, 본 발명에서는 대략적인 파일 단위 동시성 제어를 사용한다. 파일은 한 번에 하나의 트랜잭션 파일 그룹에만 속할 수 있다. 트랜잭션 파일 그룹에 파일을 추가할 때 애플리케이션은 파일이 이미 다른 트랜잭션 파일 그룹에 있는지 확인한다. 파일이 이미 다른 트랜잭션 파일 그룹에 있는 경우 add_tx_file_group은 오류를 반환한다.Since it is not a full-fledged DBMS, the present invention uses a rough file-level concurrency control. A file can belong to only one transaction file group at a time. When adding a file to a transaction file group, the application checks whether the file is already in another transaction file group. If the file is already in another transaction file group, add_tx_file_group returns an error.

본 발명에서 다른 트랜잭션 파일시스템이 하는 것처럼 격리 지원을 애플리케이션에 맡긴다. 범용 파일시스템으로서 다양한 어플리케이션 프로그램에서 동시에 모든 다른 수준의 격리 요구 사항을 충족하기는 어렵다. 파일시스템에서 지원하는 격리 수준이 어플리케이션 프로그램에서 요구하는 격리 수준과 잘 일치하지 않는 한 격리를 위한 파일시스템의 제한된 지원이 기껏해야 중복된다는 점을 신중하게 고려한다. 텍스트 편집기, 애플리케이션 설치 프로그램, git 및 LSM 기반 키 값 스토리지의 압축에는 격리가 필요하지 않다. SQLite와 MySQL은 자체적으로 여러 수준의 격리를 구현한다. 이러한 애플리케이션에서 격리를 위한 파일시스템의 제한된 지원은 큰 도움이 될 수 없다. TxFS는 "반복 가능한 읽기" 의 격리를 지원한다. 텍스트 편집기에는 지나치게 강력하고 SQLite의 "Serializable Read"와 같은 일부 어플리케이션 프로그램에는 너무 느슨하다. SQLite는 기본 파일시스템으로 TxFS를 사용하는 경우에도 공유 잠금을 사용하여 자체 데이터베이스 계층에서 "Serializable Read" 격리를 구현해야 한다. 격리를 위한 파일시스템 지원에는 비용이 든다. 실험에 따르면 TxFS의 격리 지원은 트랜잭션에서 업데이트된 페이지의 쉐도우 복사본을 생성하는 오버헤드로 인해 10%의 성능 오버헤드를 렌더링 한다. 그러나 격리 지원이 없기 때문에 발생하는 한 가지 제한 사항은 다른 프로세스가 다른 프로세스의 트랜잭션에 포함된 디렉터리에서 파일을 동시에 추가, 삭제 또는 이름을 바꿀 수 없다는 것이다. 동시 디렉토리 수정 지원은 향후 작업으로 남겨둔다.In this invention, we leave isolation support up to the application, as other transactional file systems do. As a general-purpose file system, it is difficult to meet all different levels of isolation requirements simultaneously for various applications. We carefully consider that the limited support of the file system for isolation is redundant at best, unless the isolation level supported by the file system matches well with the isolation level required by the application program. Text editors, application installers, git, and compression for LSM-based key-value storage do not require isolation. SQLite and MySQL implement various levels of isolation themselves. For these applications, the limited support of the file system for isolation cannot be of much help. TxFS supports isolation for "repeatable read". It is too strong for text editors and too loose for some applications, such as SQLite's "Serializable Read". SQLite must implement "Serializable Read" isolation in its own database layer using shared locks, even when using TxFS as the underlying file system. File system support for isolation comes at a cost. Experiments show that isolation support in TxFS renders a 10% performance overhead due to the overhead of creating shadow copies of pages updated in a transaction. However, one limitation that arises due to the lack of isolation support is that other processes cannot concurrently add, delete, or rename files in directories involved in other processes' transactions. Support for concurrent directory modifications is left for future work.

이하 본 발명이 일 양상에 따라 제공되는, 파일시스템 트랜잭션 내에서의 스틸링(Stealing) 방법을 설명한다.Below, a stealing method within a file system transaction is described according to one aspect of the present invention.

본 발명에서 제안하는 스틸링(Stealing)은 커밋 되지 않은 트랜잭션의 더티 페이지 이빅션(eviction)을 허용하는 버퍼 관리 정책을 나타낸다. DBMS의 스틸(Steal) 정책과 운영체제(또는 파일시스템)의 페이지 재확보(reclamation)는 더티 페이지를 디스크에게 이빅트(evict)하고 물리적 메모리를 해제(free up)하는 것과 같은 동일한 필수 동작의 다른 표현이다. 이 두 개는 필수적인 행동(essential behavior)을 공유하지만 극단의 다른 끝에 있다. 데이터베이스 트랜잭션에서의 스틸링의 경우, DBMS는 이빅트 된 더티 페이지가 외부에 표시되는 것을 금지하고(격리, isolation) 트랜잭션 중단(원자성)의 경우 스틸(Steal)을 실행 취소(undo)한다. 운영체제가 파일 지원(file-backed) 더티 페이지를 회수(reclaim)하면 페이지 이빅션(eviction) 결과가 외부에 표시되며 실행 취소할 수 없다. 저널링 파일시스템에서는 이빅트 된 페이지(evicted page)가 이전(old) 파일 블록을 덮어쓰고, 로그 구조 파일시스템에서는 파일 매핑 업데이트로 인해 이빅트 된 페이지(evicted page)의 올드(old) 파일 블록에 접근할 수 없게 된다.Stealing, proposed in this invention, refers to a buffer management policy that allows dirty page eviction of uncommitted transactions. Stealing policy of DBMS and page reclamation of operating system (or file system) are different expressions of the same essential behavior, such as evicting dirty pages to disk and freeing up physical memory. These two share essential behavior but are at opposite ends of the spectrum. In case of stealing in database transaction, DBMS prevents evicted dirty pages from being visible to the outside (isolation) and undoes Steal in case of transaction abort (atomicity). When operating system reclaims file-backed dirty pages, the result of page eviction becomes visible to the outside and cannot be undone. In a journaling file system, an evicted page overwrites the old file block, and in a log-structured file system, the old file block of an evicted page becomes inaccessible due to file mapping updates.

<스틸링 및 파일시스템><Stilling and Filesystem>

기존 트랜잭션 파일시스템의 스틸링 지원은 상당한 개선의 여지가 있다. TxFS, F2FS, Isotope 및 Libnvmmio는 트랜잭션에서 스틸링을 지원하지 않는다. Stealing support in existing transactional file systems leaves significant room for improvement. TxFS, F2FS, Isotope, and Libnvmmio do not support stealing in transactions.

TxFS는 근본적인 설계 한계로 인해 트랜잭션에서 스틸링을 지원할 수 없다. 트랜잭션에 대한 TxFS의 지원은 EXT4 저널링 위에 구축된다. EXT4 저널링은 저널 트랜잭션이 커밋 될 때까지 메모리에 로그 블록을 피닝 한다. EXT4는 저널 트랜잭션의 크기를 제한한다(기본적으로 256MB). 저널 트랜잭션의 크기가 한계에 도달하면 EXT4 저널링 모듈이 저널 트랜잭션을 커밋 한다. EXT4에서 단일 시스템 호출과 관련된 더티 페이지는 둘 이상의 저널 커밋으로 분할될 수 있다. TxFS는 트랜잭션의 일시적인 상태를 조기에 지속시켜 트랜잭션의 원자성을 손상시킬 수 있으므로 이러한 일이 발생하지 않도록 해야 한다. 원자성 보장을 위해 TxFS는 트랜잭션 크기가 한도를 초과하면 트랜잭션을 중단한다. TxFS cannot support stealing in transactions due to a fundamental design limitation. TxFS support for transactions is built on top of EXT4 journaling. EXT4 journaling pins log blocks in memory until the journal transaction is committed. EXT4 limits the size of a journal transaction (by default 256MB). When the journal transaction size reaches the limit, the EXT4 journaling module commits the journal transaction. In EXT4, dirty pages associated with a single system call can be split across two or more journal commits. TxFS must ensure that this does not happen, as it would prematurely persist the transient state of the transaction, thereby compromising the atomicity of the transaction. To ensure atomicity, TxFS aborts the transaction if the transaction size exceeds the limit.

F2FS는 커밋 될 때까지 트랜잭션의 더티 페이지를 메모리에 피닝 한다. F2FS는 커밋 되지 않은 트랜잭션의 더티 페이지가 특정 임계값(기본적으로 전체 물리적 페이지 프레임의 15%)을 초과하면 모든 미결 트랜잭션을 중단한다. 이와 관련된 예를 도 4를 통해 설명한다.F2FS pins the dirty pages of a transaction in memory until they are committed. F2FS aborts all pending transactions when the dirty pages of uncommitted transactions exceed a certain threshold (by default, 15% of the total physical page frames). An example of this is illustrated in Figure 4.

도 4를 참조하여 설명하면, 메모리(13)에 로그 블록들 '1', '2', '3', '4', '5', '6'이 피닝 될 수 있다. F2FS는 커밋 될 때까지 트랜잭션의 더티 페이지를 메모리 내의 페이지 캐시(133)에 피닝 한다. F2FS는 커밋 되지 않은 트랜잭션의 더티 페이지가 특정 임계값(ex: 도 4에 제시한 블록들 6개)을 초과하면 모든 미결 트랜잭션을 중단한다. Referring to Fig. 4, log blocks '1', '2', '3', '4', '5', and '6' can be pinned in memory (13). F2FS pins dirty pages of transactions in the page cache (133) in memory until they are committed. F2FS aborts all pending transactions when dirty pages of uncommitted transactions exceed a certain threshold (ex: 6 blocks as shown in Fig. 4).

도 4에 제시된 사각형(133)은 메모리의 페이지 캐시를 의미할 수 있다.The square (133) presented in Fig. 4 may mean a page cache of the memory.

CFS는 스틸링을 지원한다. 그러나 CFS는 스틸링 지원을 위해 존재하지 않는 트랜잭션 블록 장치에 의존한다. CFS supports stealing. However, CFS relies on a non-existent transaction block device to support stealing.

AdvFS는 상용 하드웨어로 스틸링을 지원한다. AdvFS는 트랜잭션 업데이트에 쓰기 가능한 파일 복제본을 사용한다. 트랜잭션이 커밋 되면 잘못된 방식으로 작성된 업데이트된 파일 블록을 참조하도록 파일 맵이 업데이트된다. 이러한 특성으로 인해 AdvFS는 스틸링을 자유롭게 지원할 수 있다. 그러나 AdvFS의 트랜잭션은 트랜잭션이 커밋 될 때마다 파일시스템이 이전 파일 블록을 삭제하므로 파일을 조각화 할 수 있다. AdvFS의 파일 조각 모음 오버헤드는 아직 알려지지 않았다. AdvFS가 독점 파일시스템이고 트랜잭션 모듈의 소스 코드가 공개적으로 사용할 수 없기 때문에 AdvFS에 대한 분석은 제한적으로 이루어질 수밖에 없다.AdvFS supports stealing with commodity hardware. AdvFS uses a writable file copy for transaction updates. When a transaction is committed, the file map is updated to reference the updated file block that was incorrectly written. This property allows AdvFS to support stealing freely. However, transactions in AdvFS can fragment files because the file system deletes old file blocks whenever a transaction is committed. The file defragmentation overhead of AdvFS is not yet known. Analysis of AdvFS is limited because AdvFS is a proprietary file system and the source code of the transaction module is not publicly available.

도 4에서, 페이지 캐시(133)는 호스트의 운영제체가 관리하는 메모리, 예컨대 DRAM 내에 존재할 수 있다. 도 4에 제시한 스토리지(20)은 호스트와는 구분되는 별도의 장치일 수 있다. 스토리지(20) 내의 비휘발성 메모리에 저장된 데이터는 스토리지(20) 내의 휘발성 메모리에 캐싱될 수 있다. 다시, 상기 휘발성 메모리에 캐싱된 내용은 호스트의 DRAM에 캐싱될 수 있다. 이때, 상기 캐싱의 단위를 스토리지(20)에서는 블록이라고 지칭할 수 있다. 상기 블록은 캐싱의 단위일 뿐만 아니라 스토리지(20)의 쓰기/읽기 단위이기도 하다. 스토리지는 블록들의 배열이라고 간주할 수도 있다. 상기 각 블록에는 번호가 할당되어 있고, 이 번호가 디스크 위치인 것으로 간주될 수 있다. 호스트에서는 상기 블록의 내용을 캐싱할 때에 DRAM의 일부분인 페이지 캐시를 사용할 수 있다. 페이지 캐시의 캐싱 단위는 페이지이다. 따라서 스토리지의 블록의 내용은 페이지 캐시의 페이지에 캐싱될 수 있다.In Fig. 4, the page cache (133) may exist in the memory managed by the operating system of the host, for example, in DRAM. The storage (20) presented in Fig. 4 may be a separate device distinct from the host. Data stored in the nonvolatile memory in the storage (20) may be cached in the volatile memory in the storage (20). Again, the content cached in the volatile memory may be cached in the DRAM of the host. At this time, the unit of the caching may be referred to as a block in the storage (20). The block is not only a unit of caching, but also a write/read unit of the storage (20). The storage may be considered as an array of blocks. Each block is assigned a number, and this number may be considered as a disk location. When caching the content of the block, the host may use a page cache, which is a part of the DRAM. The caching unit of the page cache is a page. Therefore, the content of the block of the storage may be cached in a page of the page cache.

<지연된 무효화 및 노드 페이지 피닝(pinning)><Delayed invalidation and node page pinning>

본 발명에서는 파일시스템 트랜잭션에서 스틸링을 활성화한다. The present invention enables stealing in file system transactions.

이하, 일 실시예에 따라 제공되는 로그 구조 파일시스템의 동작 방법을 도 5 및 도 6을 참조하여 설명한다. Below, the operation method of the log structure file system provided according to one embodiment is described with reference to FIGS. 5 and 6.

도 5 및 도 6에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. The rectangle presented within the memory (13) in FIGS. 5 and 6 represents the page cache (133).

도 5는 일 실시예에 따라 제공되는 로그 구조 파일시스템의 페이지 이빅션 방법을 나타낸 것이다.FIG. 5 illustrates a page eviction method of a log structure file system provided according to one embodiment.

본 명세서에서, 데이터 "X"가 저장되는 메모리 내의 공간을 "페이지"라고 지칭하고, 데이터 "X"가 저장된 페이지를 "페이지 X"라고 지칭할 수 있다. 상기 "페이지 X"는 문맥에 따라 페이지 X에 저장된 데이터 "X"를 지칭할 수 있다. 상기 메모리는 호스트의 운영체제가 관리하는 호스트 내의 메모리(ex: DRAM)를 의미할 수 있다. 본 명세서에서, 데이터 "X"가 저장되는 스토리지 내의 공간을 "블록"이라고 지칭하고, 데이터 "X"가 저장된 블록을 "블록 X"라고 지칭할 수 있다. 상기 "블록 X"는 문맥에 따라 블록 X에 저장된 데이터 "X"를 지칭할 수 있다. 본 명세서에서, 문맥에 따라, "데이터 X", "페이지 X", 및 "블록 X"는 모두 "데이터 X"를 의미할 수 있다. 본 명세서에서, 문맥에 따라, "페이지 X"는 데이터 X가 저장된 페이지를 의미하고, "블록 X"는 데이터 X가 저장된 블록을 의미할 수 있다. In this specification, a space in memory where data "X" is stored may be referred to as a "page", and a page where data "X" is stored may be referred to as a "page X". The "page X" may refer to data "X" stored in page X depending on the context. The memory may refer to memory (ex: DRAM) in a host managed by an operating system of the host. In this specification, a space in storage where data "X" is stored may be referred to as a "block", and a block where data "X" is stored may be referred to as a "block X". The "block X" may refer to data "X" stored in block X depending on the context. In this specification, depending on the context, "data X", "page X", and "block X" may all mean "data X". In this specification, depending on the context, "page X" may refer to a page where data X is stored, and "block X" may refer to a block where data X is stored.

로그 구조 파일시스템은 다음과 같이 더티 페이지를 이빅트(evict)한다: 이빅트 된 페이지는 새 디스크 위치(232)에 기록되고, 이빅트 된 페이지의 올드 디스크 위치(231)는 무효화되며 파일 매핑(F2FS의 노드 페이지)은 연관된 파일 블록의 새 위치(231)를 참조하도록 업데이트된다. A log-structured file system evicts dirty pages as follows: the evicted page is written to a new disk location (232), the old disk location (231) of the evicted page is invalidated, and the file mapping (node page in F2FS) is updated to refer to the new location (231) of the associated file block.

상기 페이지 이빅트 방법(페이지 이빅트 루틴)은 두 가지 중요한 이유로 본 발명의 일 실시예에 따라 제공되는 스틸링과 함께 사용할 수 없다. The above page evict method (page evict routine) cannot be used with the stilling provided according to one embodiment of the present invention for two important reasons.

첫 번째는 올드 디스크 위치(231)의 무효화이다. 올드 디스크 위치(231)가 무효화되면 이전 파일 블록(231)은 가비지 콜렉션 될 수 있으며 트랜잭션이 커밋되기 전에 재활용될 수 있다. 트랜잭션이 커밋되기 전에 이전 파일 블록(231)이 재활용되면 트랜잭션이 중단될 때 트랜잭션을 취소할 수 없다. The first is invalidation of the old disk location (231). When the old disk location (231) is invalidated, the previous file block (231) can be garbage collected and recycled before the transaction is committed. If the previous file block (231) is recycled before the transaction is committed, the transaction cannot be canceled when the transaction is aborted.

도 5에서 스토리지(20) 내에 제시된 파일 블록들 및 노드 페이지들은 스토리지(20) 내의 휘발성 메모리에 있을 수도 있고 비휘발성 메모리에 있을 수도 있다. 트랜잭션 과정에서 이빅트 된 블록은 상기 트랜잭션이 커밋 되지 이전이라도 스토리지(20)의 비휘발성 메모리에 써질 수 있다.The file blocks and node pages presented in the storage (20) in Fig. 5 may be in volatile memory or nonvolatile memory within the storage (20). A block evicted during a transaction process may be written to the nonvolatile memory of the storage (20) even before the transaction is committed.

도 5는 종래 기술에 상술한 이빅트 과정을 적용하는 경우에 발생하는 문제를 나타낸다. 트랜잭션이 실행된 경우, 상기 트랜잭션이 데이터 A를 데이터 A'로 수정할 수 있다. 이때, 데이터 A'의 내용을 스토리지(20) 내의 휘발성 메모리에 캐싱할 수 있는데, 이 캐싱은 상기 스토리지(20)의 느린 속도를 감추기 위한 것이다. 상기 스토리지(20) 내의 휘발성 메모리에 캐싱된 내용은 호스트가 관리하는 휘발성 메모리에 한 번 더 캐싱될 수 있는데, 이 캐싱은 상기 호스트가 상기 스토리지(20)에 접근하는 수고를 감소시켜 주기 위한 것이다. 호스트는 호스트 메모리(=호스트가 관리하는 메모리로서 예컨대 DRAM)에 캐싱된 내용을 A'로 수정할 수 있다. 상기 트랜잭션에 의해 A'은 호스트 메모리에 피닝 될 수 있다. 호스트 메모리가 부족해진 상황이 발생하면 도 5의 단계(S12)와 같이 페이지 A'을 이빅트 하여, 데이터 A'를 스토리지(20)로 전송할 수 있다. 상기 전송된 내용은 상기 스토리지(20)의 휘발성 메모리에 저장될 수 있다. 상기 이빅트 과정을 통해 상기 호스트 메모리에는 빈 공간이 확보된다. 스토리지(20)로 전송된 데이터 A'는 호스트가 플러시 명령어를 호출하거나, 또는 스토리지(20) 내의 휘발성 메모리에 빈 공간이 부족해지면 스토리지(20) 내의 비휘발성 메모리에 써질 수 있다. 상기 이빅션에 의해 데이터 A'는 블록(231)이 아니라 블록(232)에 써진다. 그리고 호스트는 블록(231)에 기록된 데이터를 무효화된 데이터인 것으로 취급할 수 있으며, 그 결과 그 후에 블록(231)을 가비지 컬렉션에 의해 청소할 수 있다. 상기 트랜잭션 동안 커밋이 호출되지 않은 상태에서 도 5의 단계(S13)이 실행될 수 있다. 즉, 호스트가 스토리지(20)에 데이터 B를 쓰려고 할 때에, 스토리지 (20) 내의 비휘발성 메모리에 공간이 부족한 상황이 발생할 수 있다. 이때, 호스트는 블록(231)에 기록된 데이터가 무효화된 것이라는 것을 알 수 있다. 따라서 데이터 B는 블록(231)에 써질 수 있다. 그 결과 블록(231)에 기록되어 있던 데이터 A가 데이터 B로 변경되며, 그 결과 데이터 A를 잃는다. 이제, 만일 트랜잭션을 취소하게 된다면, 취소로 인해 복구되는 데이터는 A가 아닌 B가 된다는 문제가 발생한다. FIG. 5 shows a problem that occurs when applying the eviction process described above in the prior art. When a transaction is executed, the transaction can modify data A to data A'. At this time, the contents of data A' can be cached in a volatile memory within the storage (20), and this caching is intended to hide the slow speed of the storage (20). The contents cached in the volatile memory within the storage (20) can be cached once more in a volatile memory managed by the host, and this caching is intended to reduce the effort of the host to access the storage (20). The host can modify the contents cached in the host memory (= memory managed by the host, for example, DRAM) to A'. A' can be pinned to the host memory by the transaction. When a situation occurs where the host memory is insufficient, page A' can be evictioned as in step (S12) of FIG. 5 to transfer data A' to the storage (20). The above-described transmitted content may be stored in the volatile memory of the storage (20). Through the above-described eviction process, an empty space is secured in the host memory. The data A' transmitted to the storage (20) may be written to the non-volatile memory in the storage (20) when the host calls a flush command or when the volatile memory in the storage (20) runs out of empty space. Through the above-described eviction, the data A' is written to the block (232) instead of the block (231). Then, the host may treat the data written to the block (231) as invalidated data, and as a result, the block (231) may be cleaned by garbage collection thereafter. The step (S13) of FIG. 5 may be executed in a state where a commit is not called during the transaction. That is, when the host attempts to write data B to the storage (20), a situation may occur where there is an insufficient space in the non-volatile memory in the storage (20). At this time, the host may know that the data written to the block (231) is invalidated. Therefore, data B can be written to block (231). As a result, data A recorded in block (231) is changed to data B, and as a result, data A is lost. Now, if the transaction is canceled, a problem arises in that the data recovered due to the cancellation is B, not A.

도 6은 일 실시예에 따라 제공되는 로그 구조 파일시스템의 체크포인트 방법을 나타낸 것이다.FIG. 6 illustrates a checkpoint method of a log structure file system provided according to one embodiment.

두 번째는 업데이트된 노드 페이지의 조기(premature) 체크포인트이다. 더티 페이지가 이빅트 되면 파일시스템이 트랜잭션 커밋 전에 주기적인 체크포인트 작업을 실행하는 경우 업데이트된 파일 매핑정보를 포함하는 업데이트된 노드 페이지(135)를 체크포인트 할 수 있다. 그런 다음 디스크(20)에 체크포인트 된 업데이트된 노드 블록(235)은 커밋 되지 않은 트랜잭션의 이빅트 된(evicted) 페이지의 새 디스크 위치(A:2)를 참조한다. 트랜잭션이 커밋되기 전에 파일시스템이 충돌하는 경우 복구 모듈은 디스크(20)에서 발견된 가장 최근 파일 매핑정보와 관련하여 커밋 되지 않은 트랜잭션의 이빅트 된(evicted) 페이지(A')를 복구(S241)할 수 있다. 결과적으로 파일시스템을 잘못된 상태로 복구할 수 있다.The second is a premature checkpoint of the updated node page. When a dirty page is evicted, the updated node page (135) containing the updated file mapping information can be checkpointed if the file system performs a periodic checkpoint operation before the transaction is committed. Then, the updated node block (235) checkpointed on the disk (20) refers to the new disk location (A:2) of the evicted page of the uncommitted transaction. If the file system crashes before the transaction is committed, the recovery module can recover (S241) the evicted page (A') of the uncommitted transaction with respect to the most recent file mapping information found on the disk (20). As a result, the file system can be recovered to an incorrect state.

로그 구조 파일시스템에서 본 발명의 스틸링 가능 트랜잭션을 지원하기 위해 해결해야 할 두 가지 주요 이슈가 있다: 첫 번째 이슈는 트랜잭션이 커밋 될 때까지 올드 디스크 위치(231)가 가비지 콜렉션 되는 것을 금지하는 것에 관한 것이고, 두 번째 이슈는 커밋 되지 않은 트랜잭션의 이빅트 된(evicted) 블록(232)이 시스템 충돌(crash) 후 복구(recover)되는 것을 금지하는 것에 관한 것이다. 시스템 충돌(crash)는 호스트와 스토리지 모두에서 걸쳐 발생할 수 있다. There are two major issues to be addressed to support the stealable transactions of the present invention in a log-structured file system: the first issue is to prevent old disk locations (231) from being garbage collected until a transaction is committed, and the second issue is to prevent evicted blocks (232) of uncommitted transactions from being recovered after a system crash. A system crash can occur across both the host and the storage.

본 발명에서는, 상기 첫 번째 이슈를 해결하기 위해 지연된 무효화 방법(Delayed Invalidation method)을 제안한다. 상기 지연된 무효화 방법은 도 7을 참조하여 설명한다. In the present invention, a delayed invalidation method is proposed to solve the first issue. The delayed invalidation method is explained with reference to Fig. 7.

도 7에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. The rectangle presented within the memory (13) in Fig. 7 represents the page cache (133).

지연된 무효화 방법에서 커밋 되지 않은 트랜잭션에서 더티 페이지를 이빅트한 후 파일시스템은 트랜잭션이 커밋 될 때까지는 올드 디스크 위치(231)의 무효화를 실행하지 않는다. In the delayed invalidation method, after evicting dirty pages from an uncommitted transaction, the file system does not perform invalidation of the old disk location (231) until the transaction is committed.

본 발명에서는, 상기 두 번째 이슈를 해결하기 위해 노드 페이지 피닝 방법(Node Page Pinning method)을 제안한다. 상기 노드 페이지 피닝 방법은 도 8을 참조하여 설명한다. In the present invention, a node page pinning method is proposed to solve the second issue. The node page pinning method is explained with reference to Fig. 8.

도 8에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. The rectangle presented within the memory (13) in Fig. 8 represents the page cache (133).

노드 페이지 피닝 방법에서 파일시스템은 업데이트된 노드 페이지(135)가 조기에(prematurely) 체크포인트 되는 것을 방지하기 위해 트랜잭션이 커밋 될 때까지 업데이트된 노드 페이지(135)를 메모리에 피닝 한다.In the node page pinning method, the file system pins the updated node page (135) in memory until the transaction is committed to prevent the updated node page (135) from being checkpointed prematurely.

이하, 본 명세서의 도면에서, 피닝된 페이지 캐시에는 피닝을 나타내는 아이콘이 표시되어 있다. 예컨대 도 8의 참조번호 135가 나타내는 사각형의 우측 상부에 상기 피닝 아이콘이 표시되어 있다.Hereinafter, in the drawings of this specification, a pinned page cache is indicated with an icon indicating pinning. For example, the pinning icon is indicated at the upper right of a square indicated by reference numeral 135 in FIG. 8.

상기 지연된 무효화 방법 및 노드 페이지 피닝 방법을 위해 새로운 인-메모리 개체(in-memory object)인 재배치 레코드(Relocation Record)를 도입했다. 재배치 레코드는 페이지 이빅트(evict)와 관련된 정보를 보유한다. 재배치 레코드에는 파일 블록 ID(inode 번호 및 파일 오프셋), 올드 디스크 위치(231) 및 이빅트 된 페이지의 파일 블록의 새 디스크 위치(232)가 포함된다. 재배치 레코드를 사용하면 파일시스템은 더티 페이지를 이빅트 하는 시점이 아니라 트랜잭션을 커밋 할 때 올드 디스크 위치(231)를 비동기적으로 무효화한다(S33). For the above delayed invalidation method and node page pinning method, a new in-memory object, Relocation Record, is introduced. The Relocation Record holds information related to page evict. The Relocation Record includes the file block ID (inode number and file offset), the old disk location (231), and the new disk location (232) of the file block of the evicted page. Using the Relocation Record , the file system asynchronously invalidates the old disk location (231) when committing a transaction, rather than when evicting a dirty page (S33).

상기 재배치 레코드는 호스트의 DRAM에 기록될 수 있다. 시스템 충돌이 발생하여 상기 재배치 레코드가 사라져도 문제가 없다. 그 이유는, 시스템 충돌 이후 재부팅하면 노드 페이지와 블록 비트맵이 변경되지 않기 때문에 트랜잭션 이전 상태로 복구되기 때문이다. The above relocation record can be written to the host's DRAM. There is no problem even if the above relocation record disappears due to a system crash. This is because when rebooting after a system crash, the node page and block bitmap are not changed, so they are restored to the state before the transaction.

각 트랜잭션 파일 그룹은 재배치 리스트(Relocation List)라는 재배치 레코드의 집합을 유지 관리한다. 파일시스템은 재배치 레코드를 생성하고 트랜잭션에서 더티 페이지를 이빅트 할 때 재배치 리스트에 추가한다.Each transaction file group maintains a set of relocation records called a relocation list . The file system creates a relocation record and adds it to the relocation list when it evicts dirty pages from a transaction.

도 9는 exF2FS에서 스틸링을 실행하는 예를 보여준다. Figure 9 shows an example of running stilling on exF2FS.

도 9에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. The rectangle presented within the memory (13) in Fig. 9 represents the page cache (133).

파일 블록 A의 더티 페이지는 처음에 LBA 1에 매핑 된다(S51). 파일 블록 A는 LBA 8에게 이빅트(evict)된다(S52). 메모리(13)의 노드 페이지(250)는 파일 블록 A를 LBA 8로 매핑 하도록 업데이트된다(S53). LBA 8의 블록 비트맵(260)이 설정된다(S54). LBA 1에 대한 블록 비트맵(260)은 지연된 무효화로 인해 이빅션(eviction) 시 무효화되지 않는다. 파일시스템은 재배치 레코드(271)를 생성하고 새로 생성된 레코드(271)를 재배치 리스트(270)에 삽입한다(S55). 새로 생성된 재배치 레코드(271)에는 이빅트(evict)된 블록의 파일 블록 ID(파일 블록 A), 이전 위치(LBA 1) 및 새 위치(LBA 8)가 포함된다. LBA 1은 디스크(20)에서 이빅트(evict)되므로 연결된 트랜잭션 파일 그룹의 더티 페이지 리스트에서 제거된다. 트랜잭션이 커밋 되면(S56) LBA가 무효화되고(S57) 업데이트된 노드 페이지가 지속된다(S58).A dirty page of file block A is initially mapped to LBA 1 (S51). File block A is evicted to LBA 8 (S52). A node page (250) of memory (13) is updated to map file block A to LBA 8 (S53). A block bitmap (260) of LBA 8 is set (S54). The block bitmap (260) for LBA 1 is not invalidated upon eviction due to delayed invalidation. The file system creates a relocation record (271) and inserts the newly created record (271) into the relocation list (270) (S55). The newly created relocation record (271) includes a file block ID (file block A) of the evicted block, a previous location (LBA 1), and a new location (LBA 8). LBA 1 is evicted from disk (20) and is therefore removed from the dirty page list of the associated transaction file group. When the transaction is committed (S56), the LBA is invalidated (S57) and the updated node page is persisted (S58).

<스틸링에서의 커밋 및 어보트><Commit and Abort in Stilling>

트랜잭션이 커밋 되면(S56) 파일시스템은 이빅트(evict)된 페이지의 이전 위치(LBA 1)에 더 이상 도달할 수 없도록 만든다. 더티 페이지 플러시를 시작하기 전에 파일시스템은 시간 순으로 재배치 리스트(270)을 검색하고 이빅트(evict)된 블록의 올드 디스크 위치(LBA 1)를 무효화한다(지연된 무효화)(S57). 이 작업이 완료되면 트랜잭션의 더티 데이터 페이지를 플러시 한다(S59). 더티 페이지가 지속가능하게 되면(durable) 파일시스템은 이빅션(eviction)에 의해 업데이트된 노드 페이지(250)를 피닝 해제(unpin)하고 더티 노드 페이지 리스트에 삽입한다. 그런 다음 파일시스템은 더티 노드 페이지를 플러시 한다. 마스터 커밋 블록이 지속가능하게 되는(durable) 경우에만 트랜잭션이 성공적으로 커밋 된다.When a transaction is committed (S56), the file system makes the previous location (LBA 1) of the evicted page no longer reachable. Before starting the dirty page flush, the file system searches the relocation list (270) in chronological order and invalidates the old disk location (LBA 1) of the evicted block (delayed invalidation) (S57). When this task is completed, the dirty data page of the transaction is flushed (S59). If the dirty page becomes durable, the file system unpins the node page (250) updated by the eviction and inserts it into the dirty node page list. Then, the file system flushes the dirty node page. The transaction is successfully committed only if the master commit block becomes durable.

이와 달리, 파일시스템이 트랜잭션을 중단(abort)하면 파일시스템은 시간 역순으로 재배치 리스트(270)을 검색한다. 각 재배치 레코드에 대해 파일시스템은 새 디스크 위치(ex: LBA 8)를 무효화하고 메모리(13)의 노드 페이지(250)를 되돌려 파일 블록을 올드 디스크 위치(LBA 1)에 매핑 한다. 노드 페이지(250)를 되돌린 후 피닝이 해제(unpin)된다. In contrast, when the file system aborts a transaction, the file system searches the relocation list (270) in reverse chronological order. For each relocation record, the file system invalidates the new disk location (ex: LBA 8) and reverts the node page (250) in memory (13) to map the file block to the old disk location (LBA 1). After the node page (250) is reverted, the pinning is unpinned.

도 10은 이 예를 보여준다. Figure 10 shows this example.

트랜잭션 중단(Tx Abort) 시 'A', 'E', 'F'의 세 페이지가 이미 이빅트 되었다. 페이지 'A'의 이전 위치와 새 위치는 각각 '1'과 '8'에 해당한다. 중단 시 파일시스템은 재배치 리스트(270)에 따라 'A', 'E' 및 'F'에 대한 노드 페이지(250)를 각각 페이지 '1', '10' 및 '11'을 참조하도록 되돌린다. 또한 새 디스크 위치인 LBA 8, LBA 29 및 LBA 32에 대한 비트맵(260)을 무효화한다.At the time of transaction abort (Tx Abort), three pages of 'A', 'E', and 'F' have already been evicted. The old and new locations of page 'A' correspond to '1' and '8', respectively. At the time of abort, the file system reverts the node pages (250) for 'A', 'E', and 'F' to refer to pages '1', '10', and '11', respectively, according to the relocation list (270). It also invalidates the bitmaps (260) for the new disk locations, LBA 8, LBA 29, and LBA 32.

시스템 충돌 시 지연 무효화는, 할당되었지만(allocated) 도달할 수 없는(unreachable) 파일시스템 블록을 남길 수 있다. 지연된 무효화는 페이지가 이빅트(evict)된 시점부터 트랜잭션이 커밋 될 때까지 일시적으로 올드 디스크 위치(231)와 새 디스크 위치(232)를 모두 유효한 상태로 둔다. 이 기간 동안 시스템이 충돌하면 파일시스템은 올드 디스크 위치(231)와 새 디스크 위치(232)가 모두 유효하지만 올드 디스크 위치(231)만 파일에 매핑 된 상태로 복구될 수 있다. 이 경우 fsck(오프라인) 또는 온라인 변형을 통해 새 디스크 위치(232)를 수집해야 한다.In the event of a system crash, delayed invalidation can leave allocated but unreachable filesystem blocks. Delayed invalidation temporarily leaves both the old disk location (231) and the new disk location (232) valid from the time the page is evicted until the transaction is committed. If the system crashes during this period, the filesystem can be recovered with both the old disk location (231) and the new disk location (232) valid, but only the old disk location (231) mapped to a file. In this case, the new disk location (232) must be collected via fsck (offline) or an online variant.

본 발명의 일 관점에 따라, 호스트의 운영체제가, 페이지 캐시의 크기가 제1트랜잭션에 속한 복수 개의 쓰기 페이지들의 크기보다 작으면, 상기 복수 개의 쓰기 페이지들 중 일부의 쓰기 페이지를 스토리지에 쓰는 이빅트(evict) 단계; 및 상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계;를 포함하는, 트랜잭션 실행방법이 제공될 수 있다. According to one aspect of the present invention, a transaction execution method may be provided, including: an evict step in which an operating system of a host writes some of the write pages among the plurality of write pages belonging to the first transaction to storage if the size of the page cache is smaller than the sizes of the plurality of write pages; and a commit step in which the operating system commits the first transaction.

이때, 상기 커밋이 실행되기 직전에 상기 페이지 캐시에 고정된 데이터들은 상기 복수 개의 쓰기 페이지들 중 상기 일부의 쓰기 페이지를 제외한 나머지 쓰기 페이지일 수 있다.At this time, the data fixed in the page cache immediately before the commit is executed may be the remaining write pages excluding some of the write pages among the multiple write pages.

이때, 상기 커밋 단계는, 상기 운영체제가 상기 어플리케이션 프로그램으로부터 상기 제1트랜잭션의 커밋 콜을 수신하면 실행될 수 있다. At this time, the commit step can be executed when the operating system receives a commit call of the first transaction from the application program.

이때, 상기 트랜잭션 실행방법은, 상기 이빅트 단계 이전에, 상기 운영체제가, 어플리케이션 프로그램으로부터 상기 복수 개의 쓰기 페이지들에 관한 한 세트의 쓰기 오퍼레이션 콜들을 수신하는 단계; 및 상기 이빅트 단계와 상기 커밋 단계 사이에, 상기 운영체제가 상기 어플리케이션 프로그램으로부터 상기 제1트랜잭션의 커밋 콜을 수신하는 단계;를 더 포함할 수 있다.At this time, the transaction execution method may further include, prior to the eviction step, a step in which the operating system receives a set of write operation calls regarding the plurality of write pages from an application program; and, between the eviction step and the commit step, a step in which the operating system receives a commit call of the first transaction from the application program.

이때, 상기 운영체제의 파일시스템은 로그 구조 파일시스템일 수 있다.At this time, the file system of the above operating system may be a log structure file system.

이때, 상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들(a first set of old blocks)에 저장되어 있는 올드 데이터를 대체하는 데이터이고, 상기 일부의 쓰기 페이지의 데이터는 상기 이빅트 단계에 의해 상기 스토리지 내의 제1그룹의 신규 블록들(a first set of new blocks)에 저장되며, 상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 제1그룹의 올드 블록들을 무효화(invalidation)하지 않도록 되어 있을 수 있다.At this time, data of some of the write pages is data that replaces old data stored in a first set of old blocks in the storage, and data of some of the write pages is stored in a first set of new blocks in the storage by the evict step, and the operating system may be configured not to invalidate old blocks of the first group before the commit is executed.

이때, 상기 운영체제는, 상기 커밋의 실행과 동시에 또는 상기 커밋이 실행된 이후에 상기 제1그룹의 올드 블록들을 무효화하도록 되어 있을 수 있다. At this time, the operating system may be configured to invalidate the old blocks of the first group simultaneously with the execution of the commit or after the execution of the commit.

이때, 상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들(a first set of old blocks)에 저장되어 있는 올드 데이터를 대체하는 데이터이고, 상기 일부의 쓰기 페이지의 데이터는 상기 이빅트 단계에 의해 상기 스토리지 내의 제1그룹의 신규 블록들(a first set of new blocks)에 저장되며, 상기 이빅트 단계가 실행되기 이전에, 상기 스토리지에는 상기 올드 데이터와 상기 제1그룹의 올드 블록들을 서로 매핑한 올드 매핑정보가 기록되어 있고, 그리고 상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 스토리지에 기록된 상기 올드 매핑정보를 제거하지 않도록 되어 있을 수 있다.At this time, data of some of the write pages is data that replaces old data stored in a first set of old blocks in the storage, and data of some of the write pages is stored in a first set of new blocks in the storage by the evict step, and before the evict step is executed, old mapping information that maps the old data and the old blocks of the first group to each other is recorded in the storage, and the operating system may be configured not to remove the old mapping information recorded in the storage before the commit is executed.

이때, 상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들(a first set of old blocks)에 저장되어 있는 올드 데이터를 대체하는 데이터이고, 상기 일부의 쓰기 페이지의 데이터는 상기 이빅트 단계에 의해 상기 스토리지 내의 제1그룹의 신규 블록들(a first set of new blocks)에 저장되며, 상기 이빅트 단계는, 상기 운영체제가, 상기 페이지 캐시에 상기 일부의 쓰기 페이지와 상기 제1그룹의 신규 블록들 간의 매핑관계를 나타내는 신규 매핑정보를 저장하는 단계를 포함할 수 있다. At this time, data of some of the write pages is data that replaces old data stored in a first set of old blocks in the storage, and data of some of the write pages is stored in a first set of new blocks in the storage by the eviction step, and the eviction step may include a step in which the operating system stores new mapping information indicating a mapping relationship between some of the write pages and the first set of new blocks in the page cache.

이때, 상기 운영체제는, 상기 커밋이 실행되기 이전에는 페이지 캐시에 저장된 상기 신규 매핑정보에 대한 체크포인트 연산을 실행하지 않도록 되어 있을 수 있다. 또는, 상기 커밋의 실행과 동시에 또는 상기 커밋이 실행된 이후에 상기 신규 매핑정보에 대한 체크포인트 연산을 실행하도록 되어 있을 수 있다.At this time, the operating system may be configured not to perform a checkpoint operation on the new mapping information stored in the page cache before the commit is executed. Alternatively, the operating system may be configured to perform a checkpoint operation on the new mapping information simultaneously with the execution of the commit or after the commit is executed.

본 발명의 다른 관점에 따라, 호스트의 운영체제가, 제1데이터(a first data) 및 제2데이터(a second data)를 포함하는 제1트랜잭션을 시작하는 단계; 상기 운영제체가, 상기 제1트랜잭션에 대한 커밋 콜을 어플리케이션으로부터 수신하기 이전에, 메모리의 페이지 캐시 중 제1페이지에 피닝되어 있는(pinned at a first page of a page cache of a memory) 상기 제1데이터를 스토리지의 제1신규 블록(a first new block)에 쓰는 이빅트 단계(an evict step); 상기 운영체제가, 상기 제1페이지에 상기 제2데이터를 피닝하는 단계(pinning the second data at the first page); 및 상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계(a commit step of committing the first transaction);를 포함하는, 트랜잭션 실행방법이 제공될 수 있다. According to another aspect of the present invention, a transaction execution method may be provided, including: a step in which an operating system of a host initiates a first transaction including a first data and a second data; an evict step in which the operating system writes the first data, pinned at a first page of a page cache of a memory, to a first new block of storage before receiving a commit call for the first transaction from an application; a step in which the operating system pins the second data at the first page; and a commit step of committing the first transaction, by the operating system.

이때, 상기 트랜잭션 실행방법은, 상기 이빅트 단계 이전에, 상기 운영체제가, 어플리케이션 프로그램으로부터 제1트랜잭션에 속한 복수 개의 데이터들에 관한 한 세트의 쓰기 오퍼레이션 콜들을 수신하는 단계;를 더 포함할 수 있다. 그리고 상기 이빅트 단계는, 상기 페이지 캐시의 크기가 상기 복수 개의 데이터들 전체의 크기보다 작은 경우에만 실행될 수 있다. At this time, the transaction execution method may further include, prior to the eviction step, a step in which the operating system receives a set of write operation calls regarding a plurality of data belonging to the first transaction from an application program; and the eviction step may be executed only when the size of the page cache is smaller than the size of the entire plurality of data.

이때, 상기 트랜잭션 실행방법은, 상기 이빅트 단계와 상기 커밋 단계 사이에, 상기 운영체제가, 상기 제1데이터가 상기 제1신규 블록에 매핑되어 있음을 나타내는 제1파일 매핑정보를 상기 메모리의 제1노드 페이지에 피닝(pinning)하는 단계(pinning a first file mapping information indicating that the first data is mapped to the first new block at a first node page of the memory)(S53); 상기 운영체제가, 상기 제1신규 블록의 상태가 사용 상태(in-use)가 되도록 블록 비트맵(260)을 수정하는 단계(modifying a block bitmap so that the first new block is in an in-use state); 상기 운영체제가, 상기 제1데이터의 식별자, 상기 제1데이터의 올드 블록인 제1올드 블록의 위치, 및 상기 제1데이터의 상기 제1신규 블록의 위치를 포함하는 제1재배치 레코드(271)를 생성하는 단계; 및 상기 운영체제가, 상기 생성된 제1재배치 레코드를 재배치 리스트(270)에 삽입하는 삽입단계;를 더 포함할 수 있다. At this time, the transaction execution method may further include, between the evict step and the commit step, a step of the operating system pinning first file mapping information indicating that the first data is mapped to the first new block at a first node page of the memory (S53); a step of the operating system modifying a block bitmap (260) so that the state of the first new block is in an in-use state (modifying a block bitmap so that the first new block is in an in-use state); a step of the operating system generating a first relocation record (271) including an identifier of the first data, a location of a first old block which is an old block of the first data, and a location of the first new block of the first data; and an insertion step of the operating system inserting the generated first relocation record into a relocation list (270).

이때, 상기 트랜잭션 실행방법은, 상기 삽입단계와 상기 커밋 단계 사이에, 상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1데이터의 제1올드 블록의 위치를 확인하는 단계; 상기 운영체제가, 상기 확인된 상기 제1데이터의 제1올드 블록을 무효화(invalidating)하는 단계; 상기 운영체제가, 상기 페이지 캐시의 더티 페이지들을 플러시하는 단계; 상기 운영체제가, 상기 더티 페이지들이 지속가능한 것으로 결정되면(if the dirty pages are determined to be durable), 상기 제1노드 페이지를 언핀하는 단계(unpinning the first node page); 상기 운영체제가, 상기 제1노드 페이지를 더티 노드 페이지 리스트에 삽입하는 단계(inserting the first node page into a dirty node page list); 및 상기 운영체제가, 상기 더티 노드 페이지 리스트를 플러시하는 단계(flushing the dirty node page list);를 더 포함할 수 있다.At this time, the transaction execution method may further include, between the insertion step and the commit step, a step of the operating system searching the relocation list to confirm the location of the first old block of the first data; a step of the operating system invalidating the confirmed first old block of the first data; a step of the operating system flushing dirty pages of the page cache; a step of the operating system unpinning the first node page if the dirty pages are determined to be durable; a step of the operating system inserting the first node page into a dirty node page list; and a step of the operating system flushing the dirty node page list.

이때, 상기 트랜잭션 실행방법은, 만일 상기 제1트랜잭션이 중단(aborted)되면, 상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1데이터의 제1신규 블록의 위치를 확인하는 단계; 상기 운영체제가, 상기 제1데이터의 제1신규 블록을 무효화하는 단계; 상기 운영체제가, 상기 제1데이터가 상기 제1올드 블록에 매핑되어 있음을 나타내는 파일 매핑정보를 상기 제1노드 페이지에 기록하는 단계; 및 상기 운영체제가, 상기 제1노드 페이지를 언핀 하는 단계;를 더 포함할 수 있다.At this time, the transaction execution method may further include a step of the operating system searching the relocation list to confirm the location of the first new block of the first data if the first transaction is aborted; a step of the operating system invalidating the first new block of the first data; a step of the operating system recording file mapping information indicating that the first data is mapped to the first old block in the first node page; and a step of the operating system unpinning the first node page.

이때, 커밋 블록이 지속가능한 것으로 결정된 경우에만 상기 제1트랜잭션을 커밋 하도록 되어 있을 수 있다.At this time, the first transaction may be committed only if the commit block is determined to be sustainable.

본 발명의 일 관점에 따라 메모리; 및 운영체제를 실행하는 처리부;를 포함하는 호스트가 제공될 수 있다. 상기 운영체제는, 상술한 트랜잭션 실행방법에 포함된 각 단계들을 실행하도록 되어 있을 수 있다. According to one aspect of the present invention, a host including a memory; and a processing unit executing an operating system; may be provided. The operating system may be configured to execute each step included in the transaction execution method described above.

본 발명에 따르면, 트랜잭션을 지원하는 운영체제의 파일시스템에서 트랜잭션의 크기가 운영제체가 관리하는 메모리의 크기에 의해 제한된다는 문제를 해결하는 기술을 제공할 수 있다.According to the present invention, a technology can be provided for solving a problem in which the size of a transaction in a file system of an operating system supporting transactions is limited by the size of memory managed by the operating system.

도 1은 종래기술 및 본 발명의 일 실시예에 따라 제공되는 호스트의 구성을 나타낸 것이다.
도 2는 SQLite가 다중 파일 트랜잭션의 실행을 위해 실시하는 단계들과 IO 동작과의 연관성을 나타낸다.
도 3은 트랜잭션 파일 그룹의 구성을 나타낸다.
도 4는 F2FS가 완료되지 않은 트랜잭션을 중단하는 예를 나타낸다.
도 5는 일 실시예에 따라 제공되는 로그 구조 파일시스템의 페이지 이빅션 방법을 나타낸 것이다.
도 6은 일 실시예에 따라 제공되는 로그 구조 파일시스템의 체크포인트 방법을 나타낸 것이다.
도 7은 본 발명의 일 실시예에 따라 제공되는 지연된 무효화 방법을 설명하기 위한 것이다.
도 8은 본 발명의 일 실시예에 따라 제공되는 노드 페이지 피닝 방법을 설명하기 위한 것이다.
도 9는 본 발명의 일 실시예에 따라 제공되는 exF2FS에서 스틸링을 실행하는 예를 보여준다.
도 10은 본 발명의 일 실시예에 따라 재배치 리스트를 이용하여 트랜잭션의 중단 상황을 처리하는 방법을 나타낸 것이다.
도 11은 본 발명의 일 실시예에 따라 제공되는 쉐도우 가비지 콜렉션의 실행 방법의 예를 보여준다.
도 12는 본 발명의 일 실시예에 따라, 가비지 콜렉션의 희생 블록이 커밋 되지 않은 트랜잭션의 캐시된 블록의 이전 버전에 해당하는 경우에 희생 블록을 마이그레이션 하는 방법을 나타낸다.
도 13은 본 발명의 일 실시예에 따라, 가비지 콜렉션의 희생 블록이 이빅트 된 페이지의 이전 버전에 해당하는 경우에 희생 블록을 마이그레이션 하는 방법을 나타낸다.
도 14는 가비지 콜렉션의 희생 블록이 이빅트 된 페이지의 신규 버전에 해당하는 경우 희생 블록을 마이그레이션 하는 방법을 나타낸다.
도 15는 일 실시예에 따라 호스트가 스토리지에 정보를 기록하는 개념을 나타낸 것이다.
도 16은 호스트가 실행하는 서로 다른 트랜잭션들을 나타낸 것이다.
도 17은 본 발명의 일 실시예에 따라 제공되는 다중파일 트랜잭션의 커밋 방법을 나타낸 순서도이다.
도 18은 본 발명의 일 관점에 따라 제공되는 마스터 커밋 블록의 구조를 보여준다.
도 19는 도 17에 설명한 다중파일 트랜잭션의 커밋 방법에 의해 스토리지에 저장된 MCB 및 아이노드 정보의 관계를 나타낸 것이다.
도 20a 및 도 20b는 본 발명의 일 실시예에 따라 대용량 트랜잭션을 위해 트랜잭션 데이터를 중간 저장하는 방법을 나타낸 순서도이다.
도 21은 본 발명의 일 실시예에 따라 운영체제가 트랜잭션을 실행하는 방법을 나타낸 순서도이다.
도 22는 본 발명의 일 실시예에 따라 운영체제가 트랜잭션을 커밋 하는 방법을 나타낸 순서도이다.
도 23은 본 발명의 일 실시예에 따라, 트랜잭션이 취소된 경우에 있어서, 파일시스템의 상태를 상기 취소된 트랜잭션의 시작 이전 상태로 복원하는 방법을 나타낸 순서도이다.
Figure 1 illustrates the configuration of a host provided according to the prior art and one embodiment of the present invention.
Figure 2 shows the steps that SQLite takes to execute a multi-file transaction and their relationship to IO operations.
Figure 3 shows the configuration of a transaction file group.
Figure 4 shows an example of F2FS aborting an uncompleted transaction.
FIG. 5 illustrates a page eviction method of a log structure file system provided according to one embodiment.
FIG. 6 illustrates a checkpoint method of a log structure file system provided according to one embodiment.
FIG. 7 is intended to explain a delayed invalidation method provided according to one embodiment of the present invention.
FIG. 8 is a diagram for explaining a node page pinning method provided according to one embodiment of the present invention.
FIG. 9 shows an example of executing stilling in exF2FS provided according to one embodiment of the present invention.
FIG. 10 illustrates a method for handling a transaction interruption situation using a relocation list according to one embodiment of the present invention.
FIG. 11 shows an example of a method of executing shadow garbage collection provided according to one embodiment of the present invention.
FIG. 12 illustrates a method of migrating a victim block when the victim block of garbage collection corresponds to a previous version of a cached block of an uncommitted transaction, according to one embodiment of the present invention.
FIG. 13 illustrates a method of migrating a victim block of garbage collection when the victim block corresponds to a previous version of an evicted page, according to one embodiment of the present invention.
Figure 14 shows how to migrate a victim block for garbage collection when the victim block corresponds to a new version of an evicted page.
Figure 15 illustrates a concept in which a host writes information to storage according to one embodiment.
Figure 16 illustrates different transactions executed by the host.
FIG. 17 is a flowchart illustrating a commit method of a multi-file transaction provided according to one embodiment of the present invention.
Figure 18 shows the structure of a master commit block provided according to one aspect of the present invention.
Figure 19 shows the relationship between MCB and inode information stored in storage by the commit method of the multi-file transaction described in Figure 17.
FIGS. 20A and 20B are flowcharts illustrating a method for intermediately storing transaction data for a large-capacity transaction according to one embodiment of the present invention.
FIG. 21 is a flowchart illustrating a method for an operating system to execute a transaction according to one embodiment of the present invention.
FIG. 22 is a flowchart illustrating a method for an operating system to commit a transaction according to one embodiment of the present invention.
FIG. 23 is a flowchart illustrating a method for restoring the state of a file system to a state prior to the start of a cancelled transaction when a transaction is cancelled, according to one embodiment of the present invention.

이하, 본 발명의 실시예를 첨부한 도면을 참고하여 설명한다. 그러나 본 발명은 본 명세서에서 설명하는 실시예에 한정되지 않으며 여러 가지 다른 형태로 구현될 수 있다. 본 명세서에서 사용되는 용어는 실시예의 이해를 돕기 위한 것이며, 본 발명의 범위를 한정하고자 의도된 것이 아니다. 또한, 이하에서 사용되는 단수 형태들은 문구들이 이와 명백히 반대의 의미를 나타내지 않는 한 복수 형태들도 포함한다.Hereinafter, embodiments of the present invention will be described with reference to the attached drawings. However, the present invention is not limited to the embodiments described in this specification and may be implemented in various other forms. The terminology used in this specification is intended to help understanding of the embodiments and is not intended to limit the scope of the present invention. In addition, the singular forms used below also include the plural forms unless the phrases clearly indicate the opposite meaning.

도 15는 일 실시예에 따라 호스트가 스토리지에 정보를 기록하는 개념을 나타낸 것이다.Figure 15 illustrates a concept in which a host writes information to storage according to one embodiment.

호스트(10)와 스토리지(20)은 각각 전원장치로부터 전력을 공급하여 동작하는 컴퓨팅 장치일 수 있다. 상기 호스트(10)와 상기 스토리지(20)은 한 개 이상의 전송채널들(30)을 통해 데이터 및 명령을 교환할 수 있다. 상기 전송채널들(30)은 무선채널 또는 유선채널일 수 있다. 상기 호스트(10)와 상기 스토리지(20)은 한 개의 전원장치로부터 제공되는 전원을 공유할 수도 있고, 또는 서로 다른 두 개의 전원장치들로부터 각각 전력을 공급받을 수도 있다.The host (10) and the storage (20) may each be computing devices that operate by supplying power from a power supply. The host (10) and the storage (20) may exchange data and commands through one or more transmission channels (30). The transmission channels (30) may be wireless channels or wired channels. The host (10) and the storage (20) may share power provided from one power supply, or may each receive power from two different power supplies.

상기 호스트(10)는 CPU, 메모리, 전원장치, 및 통신장치를 포함할 수 있다. The above host (10) may include a CPU, memory, power supply, and communication device.

상기 스토리지(20)는 콘트롤러(21), 휘발성 메모리(22), 및 비휘발성 메모리(23)를 포함할 수 있다.The above storage (20) may include a controller (21), volatile memory (22), and non-volatile memory (23).

상기 호스트(10)는 상기 전송채널들(30)을 통해 각종 명령 및 데이터를 상기 스토리지(20)에게 전송할 수 있다. 상기 명령에는 쓰기 명령이 포함될 수 있다.The above host (10) can transmit various commands and data to the storage (20) through the above transmission channels (30). The commands may include a write command.

상기 스토리지(20)의 상기 콘트롤러(21)는 상기 전송채널들(30)로부터 수신한 명령을 기초로 상기 전송채널들(30)로부터 수신한 데이터를 상기 휘발성 메모리(22)에 저장할 수 있다. 상기 휘발성 메모리(22)에 저장된 데이터는 상기 콘트롤러(21)가 따르는 규칙에 의해 상기 비휘발성 메모리(23)에 저장될 수 있다. 상기 휘발성 메모리(22) 저장된 데이터는 상기 스토리지(20)에 공급되는 전원이 차단되면 삭제될 수 있지만, 상기 비휘발성 메모리(23)에 저장된 데이터는 상기 스토리지(20)에 공급되는 전원이 차단되더라도 삭제되지 않는다.The controller (21) of the storage (20) can store data received from the transmission channels (30) in the volatile memory (22) based on the command received from the transmission channels (30). The data stored in the volatile memory (22) can be stored in the nonvolatile memory (23) according to the rule followed by the controller (21). The data stored in the volatile memory (22) can be deleted when the power supplied to the storage (20) is cut off, but the data stored in the nonvolatile memory (23) is not deleted even when the power supplied to the storage (20) is cut off.

상기 호스트(10)는 어플리케이션(11)과 운영체제(12)를 실행할 수 있다. 상기 어플리케이션(11)과 상기 운영체제(12)는 상기 호스트(10)가 액세스하는 메모리에 저장된 소정의 명령코드들이 상기 호스트(10)에 포함된 CPU에 의해 실행됨으로써 실행되는 것일 수 있다. The above host (10) can execute an application (11) and an operating system (12). The above application (11) and the operating system (12) may be executed by executing predetermined command codes stored in a memory accessed by the host (10) by a CPU included in the host (10).

일 실시예에서, 상기 어플리케이션(11)은 상기 호스트(10)는 사용하는 사용자가 상기 호스트(10)이 제공하는 사용자 인터페이스를 통해 사용자 입력을 제공함으로써 실행되거나 종료되는 프로그램일 수 있다. In one embodiment, the application (11) may be a program that is executed or terminated by a user providing user input through a user interface provided by the host (10).

일 실시예에서, 상기 운영체제(12)는 상기 호스트(10)에 전원이 인가되거나 리셋이 이루어지면 상기 호스트(10)에 의해 자동으로 실행되는 프로그램일 수 있다.In one embodiment, the operating system (12) may be a program that is automatically executed by the host (10) when power is applied to the host (10) or a reset is performed.

상기 어플리케이션(11)은 상기 운영체제(12)에게 다양한 시스템 콜을 보낼 수 있다. 상기 운영체제(12)는 상기 시스템 콜에 대응하는 작업을 실행할 수 있다. The above application (11) can send various system calls to the operating system (12). The operating system (12) can execute a task corresponding to the system call.

상기 호스트(10)는 트랜잭션을 실행할 수 있다. 특정 트랜잭션이 시작되어 종료될 때까지 소정의 시간이 소요될 수 있다. The above host (10) can execute a transaction. It may take a certain amount of time from the time a specific transaction starts until it ends.

트랜잭션의 시작 및 커밋을 상기 어플리케이션(11)가 제어할 수 있다. 그리고 상기 트랜잭션 도중 실행되어야 하는 한 개 이상의 오퍼레이션들을 상기 어플리케이션(11)가 제어할 수 있다. 상기 어플리케이션(11)는 스타트 콜, 한 세트의 오퍼레이션 콜, 및 커밋 콜을 포함하는 시스템 콜들을 상기 운영체제(12)에 전송할 수 있다. The application (11) can control the start and commit of a transaction. And the application (11) can control one or more operations to be executed during the transaction. The application (11) can transmit system calls including a start call, a set of operation calls, and a commit call to the operating system (12).

상기 스타트 콜에 의해 특정 트랜잭션이 시작되고, 상기 한 세트의 오퍼레이션 콜들에 의해 상기 호스트(10)으로부터 상기 스토리지(20)에게 전달되어야 하는 명령들이 준비되고, 그리고 상기 커밋 콜에 의해 상기 준비된 명령들이 상기 전송채널들(30)을 통해 상기 스토리지(20)에게 전달될 수 있다.A specific transaction is started by the start call, commands to be transmitted from the host (10) to the storage (20) are prepared by the set of operation calls, and the prepared commands can be transmitted to the storage (20) through the transmission channels (30) by the commit call.

도 16은 호스트가 실행하는 서로 다른 트랜잭션들을 나타낸 것이다.Figure 16 illustrates different transactions executed by the host.

복수 개의 오퍼레이션들의 집합이 하나의 트랜잭션을 구성할 수 있다.A set of multiple operations can constitute a single transaction.

제1트랜잭션(41)은 4개의 쓰기 오퍼레이션들(WO#1~WO#4)로 구성될 수 있다. 도 16에서는 각 트랜잭션에 쓰기 오퍼레이션들만이 포함된 예를 제시하였지만, 다른 종류의 오퍼레이션들도 포함될 수 있다.The first transaction (41) may consist of four write operations (WO#1 to WO#4). In Fig. 16, an example is presented in which only write operations are included in each transaction, but other types of operations may also be included.

도 17은 본 발명의 일 실시예에 따라 제공되는 다중파일 트랜잭션의 커밋 방법을 나타낸 순서도이다.FIG. 17 is a flowchart illustrating a commit method of a multi-file transaction provided according to one embodiment of the present invention.

단계(S110)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 스타트 콜을 송신(transmit)할 수 있다. 이로써 제1트랜잭션일 시작될 수 있다. 상기 운영체제(12)는 상기 스타트 콜을 수신하면 제1트랜잭션을 위한 프로세스를 시작할 수 있다.In step (S110), the application (11) can transmit a start call to the operating system (12). This allows the first transaction to start. When the operating system (12) receives the start call, it can start a process for the first transaction.

단계(S121)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제1파일의 제1페이지에 대한 쓰기 오퍼레이션 콜(WO#1)을 호출할 수 있다. In step (S121), the application (11) can call a write operation call (WO#1) for the first page of the first file to the operating system (12).

단계(S122)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제1파일의 제1아이노드에 대한 쓰기 오퍼레이션 콜(WO#2)을 호출할 수 있다. In step (S122), the application (11) can call a write operation call (WO#2) for the first inode of the first file to the operating system (12).

단계(S131)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제2파일의 제2페이지에 대한 쓰기 오퍼레이션 콜(WO#3)을 호출할 수 있다. In step (S131), the application (11) can call a write operation call (WO#3) for the second page of the second file to the operating system (12).

단계(S132)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제2파일의 제2아이노드에 대한 쓰기 오퍼레이션 콜(WO#4)을 호출할 수 있다. In step (S132), the application (11) can call a write operation call (WO#4) for the second inode of the second file to the operating system (12).

단계(S140)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 커밋 콜을 호출할 수 있다. In step (S140), the application (11) can call a commit call to the operating system (12).

단계(S150)에서, 상기 운영체제(12)는 상기 커밋 콜에 대응하여 상기 제1트랜잭션을 처리할 수 있다. 즉, 상기 제1트랜잭션에 포함된 모든 파일의 페이지들을 상기 스토리지(20)에 반영할 수 있다.In step (S150), the operating system (12) can process the first transaction in response to the commit call. That is, pages of all files included in the first transaction can be reflected in the storage (20).

단계(S150)는 단계(S151) 내지 단계(S158)을 포함할 수 있다.Step (S150) may include steps (S151) to (S158).

단계(S151)에서, 상기 운영체제(12)는 본 발명의 일 실시예에 따른 구조를 갖는 한 개의 MCB(Master Commit Block)을 생성할 수 있다.In step (S151), the operating system (12) can create one MCB (Master Commit Block) having a structure according to one embodiment of the present invention.

도 18은 본 발명의 일 관점에 따라 제공되는 마스터 커밋 블록의 구조를 보여준다. Figure 18 shows the structure of a master commit block provided according to one aspect of the present invention.

일 구현예에서 상기 마스터 커밋 블록(300)의 총 크기는 N바이트다(ex: N=4,096). In one implementation example, the total size of the master commit block (300) is N bytes (ex: N=4,096).

이때, 가장 상위 N1 바이트(301)(ex: N1=4)에는 마스터 커밋 블록(300)이 갖고 있는 아이노드 블록 위치들의 개수가 저장된다. 상기 마스터 커밋 블록(300) 중 나머지 {N-N1}바이트 공간에는 N1 바이트 크기의 블록 주소들이 N/N1-1 개만큼 저장될 수 있다. At this time, the number of inode block locations that the master commit block (300) has is stored in the uppermost N1 bytes (301) (ex: N1=4). In the remaining {N-N1} byte space of the master commit block (300), N/N1-1 block addresses of N1 byte size can be stored.

상기 마스터 커밋 블록(300)의 각 부분(302, 303, 304)에는 상기 제1트랜잭션에 의한 다중파일 트랜잭션이 쓰는 아이노드들의 블록 위치(블록 번호)가 저장될 수 있다.In each part (302, 303, 304) of the above master commit block (300), the block locations (block numbers) of the inodes written by the multi-file transaction by the above first transaction can be stored.

여기서 상기 각각의 아이노드들의 블록 위치는, 상기 스토리지(20) 내에서 상기 아이노드가 저장된 블록의 위치를 나타내는 주소일 수 있다.Here, the block location of each of the above inodes may be an address indicating the location of the block where the inode is stored within the storage (20).

예컨대 제1부분(302)에는 제1파일(File#1)(401)의 제1아이노드의 블록 위치가 저장될 수 있고, 제2부분(303)에는 제2파일(File#2)(402)의 제2아이노드의 블록 위치가 저장될 수 있다. 여기서 상기 제1파일(File#1)(401) 및 상기 제2파일(File#2)(402)은 상기 제1트랜잭션에 포함된 파일들이다.For example, the block location of the first inode of the first file (File#1) (401) may be stored in the first part (302), and the block location of the second inode of the second file (File#2) (402) may be stored in the second part (303). Here, the first file (File#1) (401) and the second file (File#2) (402) are files included in the first transaction.

아이노드 블록에는 FSYNC_BIT 플래그를 붙이지 않고, 그 대신, 마스터 커밋 블록에 FSYNC_BIT 플래그(307)를 붙일 수 있다. Instead of attaching the FSYNC_BIT flag to the inode block, the FSYNC_BIT flag (307) can be attached to the master commit block.

아이노드와 트랜잭션 내용 간의 순서도 보장하지 않을 수 있다.The order between inodes and transaction contents may not be guaranteed.

대신 아이노드를 포함한 트랜잭션 전체 내용과 마스터 커밋 블록(300) 간의 순서가 보장될 수 있다. Instead, the order between the entire transaction contents including the inode and the master commit block (300) can be guaranteed.

로그 구조 파일시스템에 크래시가 발생하면 스토리지에서 FSYNC_BIT 플래그(307)가 붙은 마스터 커밋 블록(300)을 찾을 수 있다. If a crash occurs in a log-structured file system, a master commit block (300) with the FSYNC_BIT flag (307) can be found in storage.

마스터 커밋 블록(300)은 나머지 트랜잭션 내용과의 쓰기 순서가 보장된 상태로 기록된 것이다. 따라서 마스터 커밋 블록(300)이 발견되었다는 것은 다른 트랜잭션 내용들이 전부 기록되었다는 것을 의미한다. The master commit block (300) is recorded in a state where the write order with the remaining transaction contents is guaranteed. Therefore, the discovery of the master commit block (300) means that all other transaction contents have been recorded.

다시 도 17로 돌아가면, 단계(S152)에서, 상기 운영체제(12)는 상기 스토리지(20)에게 상기 쓰기 오퍼레이션 콜(WO#1, WO#2)에 대응하는 쓰기명령(WC#1, WC#2)을 전송할 수 있다. 상기 쓰기명령(WC#1, WC#2)에는 제1파일(File#1)의 제1아이노드(Inode#1)에 관한 정보가 포함되어 있을 수 있다.Returning to FIG. 17 again, in step (S152), the operating system (12) may transmit a write command (WC#1, WC#2) corresponding to the write operation call (WO#1, WO#2) to the storage (20). The write command (WC#1, WC#2) may include information about the first inode (Inode#1) of the first file (File#1).

단계(S153)에서, 상기 운영체제(12)는 상기 마스터 커밋 블록(300)의 일부분에 상기 제1아이노드(Inode#1)의 블록 위치(블록 번호)를 저장할 수 있다.In step (S153), the operating system (12) can store the block location (block number) of the first inode (Inode#1) in a part of the master commit block (300).

도 17의 단계(S153)는 트랜잭션에 포함된 파일들 중 i번째 파일의 내용을 스토리지에 반영하는 단계이다. 이때 파일 내용에는 i번째 파일의 아이노드도 포함된다. 즉, 도 17의 단계(S153)는 아이노드가 비휘발성 메모리에 저장된 직후의 동작이기 때문에, 상기 운영체제(12)는 아이노드의 블록 위치를 알 수 있다.Step (S153) of Fig. 17 is a step of reflecting the contents of the i-th file among the files included in the transaction to the storage. At this time, the file contents also include the inode of the i-th file. That is, since step (S153) of Fig. 17 is an operation immediately after the inode is stored in non-volatile memory, the operating system (12) can know the block location of the inode.

단계(S152) 및 단계(S153)는 상기 제1트랜잭션에 포함된 다른 모든 파일들에 대하여 반복하여 실행될 수 있다.Steps (S152) and (S153) can be repeatedly executed for all other files included in the first transaction.

예컨대, 단계(S154)에서, 상기 운영체제(12)는 상기 스토리지(20)에게 상기 쓰기 오퍼레이션 콜(WO#3, WO#4)에 대응하는 쓰기명령(WC#3, WC#4)을 전송할 수 있다. 상기 쓰기명령(WC#3, WC#4)에는 제3파일(File#1)의 제3아이노드(Inode#3)에 관한 정보가 포함되어 있을 수 있다.For example, in step (S154), the operating system (12) may transmit a write command (WC#3, WC#4) corresponding to the write operation call (WO#3, WO#4) to the storage (20). The write command (WC#3, WC#4) may include information about the third inode (Inode#3) of the third file (File#1).

단계(S155)에서, 상기 운영체제(12)는 상기 마스터 커밋 블록(300)의 일부분에 상기 제2아이노드(Inode#2)의 블록 위치(블록 번호)를 저장할 수 있다.In step (S155), the operating system (12) can store the block location (block number) of the second inode (Inode#2) in a part of the master commit block (300).

상기 제1트랜잭션에 포함된 모든 파일들이 상기 스토리지(20)의 상기 휘발성 메모리(22)에 기록되면, 단계(S157)에서 상기 운영체제(12)는 플러시 명령(FC)을 상기 스토리지(20)에게 전송할 수 있다.When all files included in the first transaction are written to the volatile memory (22) of the storage (20), the operating system (12) can transmit a flush command (FC) to the storage (20) in step (S157).

그 다음, 단계(S158)에서, 상기 운영체제(12)는 상기 마스터 커밋 블록(300)을 상기 스토리지(20)에 기록하라는 MCB 쓰기 명령을 상기 스토리지(20)에게 전송할 수 있다. 상기 MCB 쓰기 명령에는 상기 마스터 커밋 블록(300)의 내용이 포함될 수 있다.Next, in step (S158), the operating system (12) may transmit an MCB write command to the storage (20) to write the master commit block (300) to the storage (20). The MCB write command may include the contents of the master commit block (300).

상기 스토리지(20)는 상기 운영체제(12)로부터 수신한 명령들에 대응하여 다음과 같은 단계들을 수행할 수 있다.The above storage (20) can perform the following steps in response to commands received from the operating system (12).

단계(S161)에서, 상기 스토리지(20)가 상기 쓰기명령(WC#1, WC#2)을 수신하면, 상기 휘발성 메모리(22)에 제1페이지(Page#1) 및 상기 제1아이노드(Inode#1)를 저장한다.In step (S161), when the storage (20) receives the write command (WC#1, WC#2), it stores the first page (Page#1) and the first inode (Inode#1) in the volatile memory (22).

단계(S162)에서, 상기 스토리지(20)가 상기 쓰기명령(WC#3, WC#4)을 수신하면, 상기 휘발성 메모리(22)에 제2페이지(Page#2) 및 상기 제2아이노드(Inode#2)를 저장한다.In step (S162), when the storage (20) receives the write command (WC#3, WC#4), it stores the second page (Page#2) and the second inode (Inode#2) in the volatile memory (22).

단계(S163)에서, 상기 스토리지(20)가 상기 플러시 명령(FC)을 수신하면, 상기 스토리지(20)는 상기 휘발성 메모리(22)에 저장되어 있던 상기 제1트랜잭션에 관한 정보를 상기 비휘발성 메모리(23)에 저장한다. In step (S163), when the storage (20) receives the flush command (FC), the storage (20) stores information about the first transaction stored in the volatile memory (22) in the non-volatile memory (23).

단계(S164)에서, 상기 스토리지(20)가 상기 마스터 커밋 블록(300)을 상기 비휘발성 메모리(23)에 저장할 수 있다.In step (S164), the storage (20) can store the master commit block (300) in the non-volatile memory (23).

만일 단계(S152)가 시작된 이후, 그리고 상기 단계(S164)가 완료되기 이전에 상기 스토리지(20)에 정전 등 문제가 발생한다면, 상기 비휘발성 메모리(23)에 기록된 상기 제1트랜잭션에 관련된 파일들의 내용은 무효화 된다.If a problem such as a power outage occurs in the storage (20) after step (S152) is started and before step (S164) is completed, the contents of the files related to the first transaction recorded in the non-volatile memory (23) are invalidated.

도 19는 도 17에 설명한 다중파일 트랜잭션의 커밋 방법에 의해 스토리지에 저장된 MCB 및 아이노드 정보의 관계를 나타낸 것이다.Figure 19 shows the relationship between MCB and inode information stored in storage by the commit method of the multi-file transaction described in Figure 17.

도 19에서, 참조번호 231은 제1아이노드(Inode#1)가 저장된 제1블록(231)을 나타내고, 참조번호 232는 제2아이노드(Inode#2)가 저장된 제2블록(232)을 나타내고, 그리고 참조번호 233은 상기 마스터 커밋 블록(300)이 저장된 제3블록(233)을 나타낸다. In FIG. 19, reference number 231 represents a first block (231) in which a first inode (Inode#1) is stored, reference number 232 represents a second block (232) in which a second inode (Inode#2) is stored, and reference number 233 represents a third block (233) in which the master commit block (300) is stored.

상기 제3블록(233)에 포함된 상기 제1아이노드 포인터(2331)는 상기 제1블록(231)의 주소에 관한 값을 갖고, 상기 제2아이노드 포인터(2332)는 상기 제2블록(232)의 주소에 관한 값을 갖는다.The first inode pointer (2331) included in the third block (233) has a value related to the address of the first block (231), and the second inode pointer (2332) has a value related to the address of the second block (232).

도 20a 및 도 20b는 본 발명의 일 실시예에 따라 대용량 트랜잭션을 위해 트랜잭션 데이터를 중간 저장하는 방법을 나타낸 순서도이다.FIGS. 20A and 20B are flowcharts illustrating a method for intermediately storing transaction data for a large-capacity transaction according to one embodiment of the present invention.

도 20a 및 도 20b를 통칭하여 도 20이라고 지칭할 수 있다.FIG. 20a and FIG. 20b may be collectively referred to as FIG. 20.

단계(S210)에서, 운영체제(12)는 어플리케이션(11)으로부터 트랜잭션 스타트 콜을 수신할 수 있다. At step (S210), the operating system (12) can receive a transaction start call from the application (11).

단계(S220)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제1파일(fd#1)의 제1페이지 내지 제3페이지(pages1~3)에 대한 제1쓰기 오퍼레이션 콜(WO#1)을 수신할 수 있다. In step (S220), the operating system (12) can receive a first write operation call (WO#1) for the first to third pages (pages1~3) of the first file (fd#1) from the application (11).

단계(S310)에서, 상기 운영체제(12)는 상기 운영체제(12)가 관리하는 메모리(ex: DRAM)의 페이지 캐시에 상기 제1페이지의 데이터 내지 제3페이지의 데이터를 피닝(pinning)할 수 있다. In step (S310), the operating system (12) can pin the data of the first page to the data of the third page to the page cache of the memory (ex: DRAM) managed by the operating system (12).

상기 단계(S310)는, 상기 페이지 캐시에 상기 제1쓰기 오퍼레이션 콜(WO#1)에 의해 지정된 페이지들(도 20의 예에서는 상기 제1페이지 내지 제3페이지)을 저장할 공간이 이미 준비되어 있다는 상태를 전제로 실행될 수 있다.The above step (S310) can be executed on the assumption that space for storing pages (the first to third pages in the example of FIG. 20) specified by the first write operation call (WO#1) in the page cache has already been prepared.

단계(S230)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제1파일(fd#1)의 제4페이지 내지 제8페이지(pages4~8)에 대한 제2쓰기 오퍼레이션 콜(WO#2)을 수신할 수 있다. In step (S230), the operating system (12) can receive a second write operation call (WO#2) for the 4th to 8th pages (pages4~8) of the first file (fd#1) from the application (11).

상기 페이지 캐시에 상기 제2쓰기 오퍼레이션 콜(WO#2)에 의해 지정된 페이지들(도 20의 예에서는 상기 제4페이지 내지 제8페이지) 모두를 저장할 장소가 준비되어 있지 않다고 결정된 경우에는, 상기 운영체제(12)는 단계(S320)를 실행할 수 있다.If it is determined that there is no place prepared to store all of the pages (the 4th to 8th pages in the example of Fig. 20) specified by the second write operation call (WO#2) in the above page cache, the operating system (12) can execute step (S320).

단계(S320)는 아래의 단계(S321), 단계(S322), 단계(S323)를 포함할 수 있다. Step (S320) may include steps (S321), (S322), and (S323) below.

단계(S321)에서, 상기 운영체제(12)는 상기 제2쓰기 오퍼레이션 콜(WO#2)에 의해 지정된 페이지들 중 상기 페이지 캐시의 남아 있는 공간에 저장될 수 있는 모든 페이지들(도 20의 예에서는 제4페이지 내지 제6페이지)을 피닝 할 수 있다. In step (S321), the operating system (12) can pin all pages (4th to 6th pages in the example of FIG. 20) that can be stored in the remaining space of the page cache among the pages specified by the second write operation call (WO#2).

단계(S322)에서, 상기 운영체제(12)는 상기 제2쓰기 오퍼레이션 콜(WO#2)에 의해 지정된 페이지들 중 상기 페이지 캐시에 아직 피닝 되지 않은 페이지들인 대기 페이지들(도 20의 예에서는 제7페이지 내지 제8페이지)을 저장할 공간을 확보하기 위하여, 상기 페이지 캐시에 이미 피닝 되어 있던 페이지들 중 일부인 이빅트 페이지들(도 20의 예에서는 제1페이지 내지 제2페이지)을 스토리지(20)로 이빅트 할 수 있다. 이를 위해 상기 운영체제(12)는 상기 페이지 캐싱에 이미 피닝 되어 있던 상기 이빅트 페이지들에 대한 이빅트 명령을 상기 스토리지(20)에게 전송할 수 있다. In step (S322), the operating system (12) may evict some of the eviction pages (the first to second pages in the example of FIG. 20), which are already pinned in the page cache, to storage (20) in order to secure space for storing standby pages (the seventh to eighth pages in the example of FIG. 20), which are pages not yet pinned in the page cache among the pages specified by the second write operation call (WO#2). To this end, the operating system (12) may transmit an eviction command for the eviction pages that were already pinned in the page cache to the storage (20).

이때, 상기 대기 페이지들의 크기와, 상기 이빅트 페이지들의 크기는 서로 동일할 수 있다. At this time, the sizes of the above waiting pages and the sizes of the above evict pages may be the same.

단계(S410)에서, 상기 스토리지(20)는, 상기 이빅트 페이지들에 대한 이빅트 명령을 상기 운영체제(12)부터 수신하면, 상기 스토리지(20)의 비휘발성 메모리 내에 상기 이빅트 페이지들을 저장할 수 있다.In step (S410), when the storage (20) receives an Evict command for the Evict pages from the operating system (12), the storage (20) can store the Evict pages in the nonvolatile memory of the storage (20).

단계(S323)에서, 상기 운영체제(12)는 상기 이빅트 페이지들과, 상기 이빅트 페이지들이 저장된 상기 스토리지(20) 내의 블록들 간의 매핑정보인 신규 파일 매핑정보를 상기 페이지 캐시에 피닝(pinning)할 수 있다.In step (S323), the operating system (12) can pin new file mapping information, which is mapping information between the Evict pages and blocks in the storage (20) where the Evict pages are stored, to the page cache.

단계(S330)에서, 상기 운영체제(12)는 상기 페이지 캐시 중 상기 이빅트 페이지들이 차지하던 공간에 상기 대기 페이지들을 피닝 할 수 있다.In step (S330), the operating system (12) can pin the standby pages to the space occupied by the evict pages in the page cache.

이때, 상기 이빅트 페이지들에 대한 쓰기 우선순위는, 상기 이빅트 명령의 실행 이후에 상기 페이지 캐시에 피닝 되어 있는 페이지들의 쓰기 우선순위보다 높을 수 있다. At this time, the write priority for the above Evict pages may be higher than the write priority of the pages pinned in the page cache after execution of the Evict instruction.

단계(S240)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 커밋 콜을 수신할 수 있다. In step (S240), the operating system (12) can receive a commit call from the application (11).

단계(S340)에서, 상기 운영체제(12)는 트랜잭션#1을 처리할 수 있으며, 구체적으로는 단계(S341) 내지 단계(S345)를 포함할 수 있다. In step (S340), the operating system (12) can process transaction #1, and specifically, can include steps (S341) to (S345).

단계(S341)에서, 상기 운영체제(12)는 쓰기 명령을 상기 스토리지(20)에게 전송할 수 있다. 이때 상기 쓰기 명령은 상기 페이지 캐시에 피닝된 제1세트의 페이지들에 대한 쓰기 명령일 수 있다. In step (S341), the operating system (12) may transmit a write command to the storage (20). At this time, the write command may be a write command for the first set of pages pinned to the page cache.

단계(S420)에서, 상기 스토리지(20)는 상기 스토리지(20) 내의 휘발성 메모리 내에 상기 제1세트의 페이지들을 저장할 수 있다. 도 20의 예에서 상기 제1세트의 페이지들은 제3페이지 내지 제8페이지이다.In step (S420), the storage (20) can store the first set of pages in the volatile memory within the storage (20). In the example of Fig. 20, the pages of the first set are the third to eighth pages.

단계(S342)에서, 상기 운영체제(12)는 플러시 명령을 상기 스토리지(20)에게 전송할 수 있다.In step (S342), the operating system (12) can transmit a flush command to the storage (20).

단계(S430)에서, 상기 스토리지(20)는 상기 스토리지(20) 내의 휘발성 메모리에 저장된 정보를 상기 스토리지(20) 내의 비휘발성 메모리에 저장할 수 있다(플러시).In step (S430), the storage (20) can store (flush) information stored in the volatile memory within the storage (20) to the non-volatile memory within the storage (20).

단계(S343)에서, 상기 이빅트 페이지들이 상기 스토리지(20) 내에서 상기 이빅트 명령의 실행 이전에 차지하고 있던 올드 블록들을 무효화하는 명령을 상기 운영체제(12)가 상기 스토리지(20)에게 전송할 수 있다. In step (S343), the operating system (12) can transmit a command to the storage (20) to invalidate old blocks that the Evict pages occupied before the execution of the Evict command within the storage (20).

단계(S440)에서, 상기 스토리지(20)는 상기 올드 블록들을 무효화할 수 있다.In step (S440), the storage (20) can invalidate the old blocks.

단계(S344)에서, 상기 운영체제(12)는 상기 신규 파일 매핑정보의 피닝을 해제할 수 있다. In step (S344), the operating system (12) can release the pinning of the new file mapping information.

단계(S345)에서, 상기 운영체제(12)는 상기 신규 파일 매핑정보에 대한 체크포인트 명령을 상기 스토리지(20)에게 전송할 수 있다. In step (S345), the operating system (12) can transmit a checkpoint command for the new file mapping information to the storage (20).

단계(S450)에서, 상기 스토리지(20)는 상기 신규 파일 매핑정보를 상기 스토리지(20) 내의 비휘발성 메모리에 저장할 수 있다.In step (S450), the storage (20) can store the new file mapping information in non-volatile memory within the storage (20).

도 20에 제시한 트랜잭션을 처리하는 방법에서는 상기 단계(S345) 및 단계(S450)이 생략될 수도 있다. In the method of processing a transaction presented in Fig. 20, the above steps (S345) and (S450) may be omitted.

도 21은 본 발명의 일 실시예에 따라 운영체제가 트랜잭션을 실행하는 방법을 나타낸 순서도이다. FIG. 21 is a flowchart illustrating a method for an operating system to execute a transaction according to one embodiment of the present invention.

단계(S810)에서, 호스트의 운영체제가, 제1데이터 및 제2데이터를 포함하는 제1트랜잭션을 시작할 수 있다.At step (S810), the host's operating system can start a first transaction including first data and second data.

단계(S820)에서, 상기 운영체제가, 어플리케이션 프로그램으로부터 제1트랜잭션에 속한 복수 개의 데이터들에 관한 한 세트의 쓰기 오퍼레이션 콜들을 수신할 수 있다.In step (S820), the operating system can receive a set of write operation calls regarding a plurality of data belonging to a first transaction from an application program.

단계(S830)에서, 상기 운영제체가, 상기 제1트랜잭션에 대한 커밋 콜을 어플리케이션으로부터 수신하기 이전에, 메모리의 페이지 캐시 중 제1페이지에 피닝 되어 있는 상기 제1데이터를 스토리지의 제1신규 블록에 쓰는 이빅트를 실행할 수 있다. In step (S830), the operating system may execute an evict to write the first data pinned to the first page of the page cache of the memory to the first new block of the storage before receiving a commit call for the first transaction from the application.

상기 이빅트 단계는, 상기 페이지 캐시의 크기가 상기 복수 개의 데이터들 전체의 크기보다 작은 경우에만 실행될 수 있다. The above Evict step can be executed only when the size of the page cache is smaller than the size of the entire plurality of data.

상기 단계(S830) 이후에, 상기 운영체제가, 상기 제1페이지에 상기 제2데이터를 피닝 하는 단계가 실행될 수 있다. After the above step (S830), the operating system may execute a step of pinning the second data to the first page.

단계(S841)에서, 상기 운영체제가, 상기 제1데이터가 상기 제1신규 블록에 매핑 되어 있음을 나타내는 제1파일 매핑정보를 상기 메모리의 제1노드 페이지에 피닝(pinning)할 수 있다.In step (S841), the operating system can pin first file mapping information indicating that the first data is mapped to the first new block to the first node page of the memory.

단계(S842)에서, 상기 운영체제가, 상기 제1신규 블록의 상태가 사용 상태(in-use)가 되도록 블록 비트맵(260)을 수정할 수 있다.In step (S842), the operating system can modify the block bitmap (260) so that the status of the first new block becomes in-use.

단계(S843)에서, 상기 운영체제가, 상기 제1데이터의 식별자, 상기 제1데이터의 올드 블록인 제1올드 블록의 위치, 및 상기 제1데이터의 상기 제1신규 블록의 위치를 포함하는 제1재배치 레코드(271)를 생성할 수 있다.In step (S843), the operating system can generate a first relocation record (271) including an identifier of the first data, a location of a first old block, which is an old block of the first data, and a location of the first new block of the first data.

단계(S844)에서, 상기 운영체제가, 상기 생성된 제1재배치 레코드를 재배치 리스트(270)에 삽입할 수 있다. In step (S844), the operating system can insert the generated first relocation record into the relocation list (270).

도 22는 본 발명의 일 실시예에 따라 운영체제가 트랜잭션을 커밋 하는 방법을 나타낸 순서도이다. FIG. 22 is a flowchart illustrating a method for an operating system to commit a transaction according to one embodiment of the present invention.

도 22에 나타낸 단계들은 도 21의 단계(S844) 이후에 실행될 수 있다. The steps shown in Fig. 22 can be executed after step (S844) of Fig. 21.

단계(S851)에서, 상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1데이터의 제1올드 블록의 위치를 확인할 수 있다.In step (S851), the operating system can search the relocation list to confirm the location of the first old block of the first data.

단계(S852)에서, 상기 운영체제가, 상기 확인된 상기 제1데이터의 제1올드 블록을 무효화할 수 있다.In step (S852), the operating system can invalidate the first old block of the confirmed first data.

단계(S853)에서, 상기 운영체제가, 상기 페이지 캐시의 더티 페이지들을 플러시 할 수 있다.In step (S853), the operating system can flush dirty pages of the page cache.

단계(S854)에서, 상기 운영체제가, 상기 더티 페이지들이 지속가능한 것으로 결정되면, 상기 제1노드 페이지를 언핀 할 수 있다.In step (S854), if the operating system determines that the dirty pages are sustainable, it can unpin the first node page.

단계(S855)에서, 상기 운영체제가, 상기 제1노드 페이지를 더티 노드 페이지 리스트에 삽입할 수 있다. In step (S855), the operating system can insert the first node page into the dirty node page list.

단계(S856)에서, 상기 운영체제가, 상기 더티 노드 페이지 리스트를 플러시 할 수 있다. In step (S856), the operating system can flush the dirty node page list.

단계(S870)에서, 상기 운영체제가, 상기 제1트랜잭션을 커밋 할 수 있다. At step (S870), the operating system can commit the first transaction.

이때, 커밋 블록이 지속가능한 것으로 결정된 경우에만 상기 제1트랜잭션을 커밋 하도록 되어 있을 수 있다. At this time, the first transaction may be committed only if the commit block is determined to be sustainable.

도 23은 본 발명의 일 실시예에 따라, 트랜잭션이 취소된 경우에 있어서, 파일시스템의 상태를 상기 취소된 트랜잭션의 시작 이전 상태로 복원하는 방법을 나타낸 순서도이다. FIG. 23 is a flowchart illustrating a method for restoring the state of a file system to a state prior to the start of a cancelled transaction when a transaction is cancelled, according to one embodiment of the present invention.

도 23에 나타낸 단계들은 상기 제1트랜잭션이 중단(aborted)되었다는 조건 아래에, 도 21의 단계(S844) 이후에 실행될 수 있다. The steps shown in Fig. 23 can be executed after step (S844) of Fig. 21 under the condition that the first transaction is aborted.

단계(S861)에서, 상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1데이터의 제1신규 블록의 위치를 확인할 수 있다.In step (S861), the operating system can search the relocation list to confirm the location of the first new block of the first data.

단계(S862)에서, 상기 운영체제가, 상기 제1데이터의 제1신규 블록을 무효화할 수 있다.In step (S862), the operating system can invalidate the first new block of the first data.

단계(S863)에서, 상기 운영체제가, 상기 제1데이터가 상기 제1올드 블록에 매핑 되어 있음을 나타내는 파일 매핑정보를 상기 제1노드 페이지에 기록할 수 있다. In step (S863), the operating system can record file mapping information indicating that the first data is mapped to the first old block in the first node page.

단계(S864)에서, 상기 운영체제가, 상기 제1노드 페이지를 언핀 할 수 있다.At step (S864), the operating system can unpin the first node page.

본 명세서에서 피닝(pinning)이란 페이지 캐시에 쓰인 내용이 스토리지에 써지지 못하도록 막는 작업을 의미할 수 있다. In this specification, pinning may mean the operation of preventing content written to the page cache from being written to storage.

상술한 본 발명의 실시예들을 이용하여, 본 발명의 기술 분야에 속하는 자들은 본 발명의 본질적인 특성에서 벗어나지 않는 범위 내에 다양한 변경 및 수정을 용이하게 실시할 수 있을 것이다. 특허청구범위의 각 청구항의 내용은 본 명세서를 통해 이해할 수 있는 범위 내에서 인용관계가 없는 다른 청구항에 결합될 수 있다.By using the embodiments of the present invention described above, those who belong to the technical field of the present invention will be able to easily perform various changes and modifications within the scope that does not depart from the essential characteristics of the present invention. The content of each claim of the patent claims can be combined with other claims that do not have a citation relationship within the scope that can be understood through this specification.

Claims (15)

호스트의 운영체제가, 페이지 캐시의 크기가 제1트랜잭션에 속한 복수 개의 쓰기 페이지들의 크기보다 작으면, 상기 복수 개의 쓰기 페이지들 중 일부의 쓰기 페이지를 스토리지에 쓰는 이빅트(evict) 단계; 및
상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계;
를 포함하며,
상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들에 저장되어 있는 올드 데이터를 대체하는 신규 데이터이고,
상기 일부의 쓰기 페이지의 데이터는, 상기 이빅트 단계에 의해, 상기 스토리지 내의 제1그룹의 신규 블록들에 저장되며,
상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 제1그룹의 올드 블록들을 무효화하지 않도록 되어 있는,
트랜잭션 실행방법.
An evict step in which the host's operating system writes some of the write pages among the plurality of write pages to storage if the size of the page cache is smaller than the size of the plurality of write pages belonging to the first transaction; and
A commit step in which the above operating system commits the first transaction;
Including,
The data of the above-mentioned part of the write page is new data that replaces the old data stored in the old blocks of the first group within the above-mentioned storage,
The data of the above part of the write page is stored in the new blocks of the first group in the storage by the above Evict step,
The above operating system is configured not to invalidate the old blocks of the first group before the above commit is executed.
How to execute a transaction.
제1항에 있어서, 상기 커밋이 실행되기 직전에 상기 페이지 캐시에 고정된 데이터들은 상기 복수 개의 쓰기 페이지들 중 상기 일부의 쓰기 페이지를 제외한 나머지 쓰기 페이지인 것을 특징으로 하는, 트랜잭션 실행방법.A transaction execution method in claim 1, characterized in that the data fixed in the page cache immediately before the commit is executed are the remaining write pages excluding some of the write pages among the plurality of write pages. 삭제delete 제1항에 있어서, 상기 운영체제는, 상기 커밋의 실행과 동시에 또는 상기 커밋이 실행된 이후에 상기 제1그룹의 올드 블록들을 무효화하도록 되어 있는, 트랜잭션 실행방법.A transaction execution method in the first paragraph, wherein the operating system is configured to invalidate old blocks of the first group simultaneously with execution of the commit or after execution of the commit. 제1항에 있어서,
상기 이빅트 단계가 실행되기 이전에, 상기 스토리지에는 상기 올드 데이터와 상기 제1그룹의 올드 블록들을 서로 매핑한 올드 매핑정보가 기록되어 있고,
상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 스토리지에 기록된 상기 올드 매핑정보를 제거하지 않도록 되어 있는,
트랜잭션 실행방법.
In the first paragraph,
Before the above Evict step is executed, the storage records old mapping information that maps the old data and the old blocks of the first group to each other.
The above operating system is configured not to remove the old mapping information recorded in the storage before the above commit is executed.
How to execute a transaction.
제1항에 있어서,
상기 이빅트 단계는, 상기 운영체제가, 상기 페이지 캐시에 상기 일부의 쓰기 페이지와 상기 제1그룹의 신규 블록들 간의 매핑관계를 나타내는 신규 매핑정보를 저장하는 단계를 포함하는,
트랜잭션 실행방법.
In the first paragraph,
The above Evict step includes a step in which the operating system stores new mapping information indicating a mapping relationship between some of the write pages and the new blocks of the first group in the page cache.
How to execute a transaction.
제1항, 제2항, 및 제4항 내지 제6항 중 어느 한 항에 있어서, 상기 운영체제의 파일시스템은 로그 구조 파일시스템인 것을 특징으로 하는, 트랜잭션 실행방법.A transaction execution method according to any one of claims 1, 2, and 4 to 6, characterized in that the file system of the operating system is a log structure file system. 호스트의 운영체제가, 제1데이터 및 제2데이터를 포함하는 제1트랜잭션을 시작하는 단계;
상기 운영제체가, 상기 제1트랜잭션에 대한 커밋 콜을 어플리케이션으로부터 수신하기 이전에, 메모리의 페이지 캐시 중 제1페이지에 피닝되어 있는 상기 제1데이터를 스토리지의 제1신규 블록에 쓰는 이빅트 단계;
상기 운영체제가, 상기 제1페이지에 상기 제2데이터를 피닝하는 단계; 및
상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계;
를 포함하며,
상기 제1데이터는 상기 스토리지 내의 제1올드 블록에 저장되어 있는 올드 데이터를 대체하는 신규 데이터이고,
상기 제1데이터는, 상기 이빅트 단계에 의해, 상기 스토리지 내의 제1신규 블록에 저장되며,
상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 제1올드 블록을 무효화하지 않도록 되어 있는,
트랜잭션 실행방법.
A step in which the host's operating system initiates a first transaction including first data and second data;
An evict step of writing the first data pinned to the first page of the page cache of the memory to the first new block of the storage before the operating system receives a commit call for the first transaction from the application;
The step of the above operating system pinning the second data to the first page; and
A commit step in which the above operating system commits the first transaction;
Including,
The above first data is new data that replaces the old data stored in the first old block in the storage,
The above first data is stored in the first new block within the storage by the above Evict step,
The above operating system is configured not to invalidate the first old block before the above commit is executed.
How to execute a transaction.
제8항에 있어서,
상기 이빅트 단계 이전에, 상기 운영체제가, 어플리케이션 프로그램으로부터 제1트랜잭션에 속한 복수 개의 데이터들에 관한 한 세트의 쓰기 오퍼레이션 콜들을 수신하는 단계;를 더 포함하며,
상기 이빅트 단계는, 상기 페이지 캐시의 크기가 상기 복수 개의 데이터들 전체의 크기보다 작은 경우에만 실행되는 것을 특징으로 하는,
트랜잭션 실행방법.
In Article 8,
Before the above Evict step, the operating system further includes a step of receiving a set of write operation calls regarding a plurality of data belonging to a first transaction from an application program;
The above Evict step is characterized in that it is executed only when the size of the page cache is smaller than the size of the entire plurality of data.
How to execute a transaction.
제8항에 있어서,
상기 이빅트 단계와 상기 커밋 단계 사이에,
상기 운영체제가, 상기 제1데이터가 상기 제1신규 블록에 매핑되어 있음을 나타내는 제1파일 매핑정보를 상기 메모리의 제1노드 페이지에 피닝하는 단계;
상기 운영체제가, 상기 제1신규 블록의 상태가 사용 상태가 되도록 블록 비트맵을 수정하는 단계;
상기 운영체제가, 상기 제1데이터의 식별자, 상기 제1올드 블록의 위치, 및 상기 제1데이터의 상기 제1신규 블록의 위치를 포함하는 제1재배치 레코드를 생성하는 단계; 및
상기 운영체제가, 상기 생성된 제1재배치 레코드를 재배치 리스트에 삽입하는 삽입단계;
를 더 포함하는,
트랜잭션 실행방법.
In Article 8,
Between the above Evict step and the above Commit step,
The step of the operating system pinning first file mapping information indicating that the first data is mapped to the first new block to the first node page of the memory;
The step of the above operating system modifying the block bitmap so that the status of the first new block becomes a used state;
The operating system generates a first relocation record including an identifier of the first data, a location of the first old block, and a location of the first new block of the first data; and
An insertion step in which the above operating system inserts the generated first relocation record into the relocation list;
Including more,
How to execute a transaction.
제10항에 있어서,
상기 삽입단계와 상기 커밋 단계 사이에,
상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1올드 블록의 위치를 확인하는 단계;
상기 운영체제가, 상기 확인된 상기 제1올드 블록을 무효화하는 단계;
상기 운영체제가, 상기 페이지 캐시의 더티 페이지들을 플러시하는 단계;
상기 운영체제가, 상기 더티 페이지들이 지속가능한 것으로 결정되면 상기 제1노드 페이지를 언핀하는 단계;
상기 운영체제가, 상기 제1노드 페이지를 더티 노드 페이지 리스트에 삽입하는 단계; 및
상기 운영체제가, 상기 더티 노드 페이지 리스트를 플러시하는 단계;
를 더 포함하는,
트랜잭션 실행방법.
In Article 10,
Between the above insert step and the above commit step,
The step of the above operating system searching the above relocation list to confirm the location of the first old block;
The step of the above operating system invalidating the confirmed first old block;
The step of the above operating system flushing dirty pages of the above page cache;
The step of the above operating system unpinning the first node page when the dirty pages are determined to be sustainable;
The step of the above operating system inserting the first node page into the dirty node page list; and
The step of the above operating system flushing the dirty node page list;
Including more,
How to execute a transaction.
제10항에 있어서,
상기 제1트랜잭션이 중단(aborted)되면,
상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1신규 블록의 위치를 확인하는 단계;
상기 운영체제가, 상기 제1신규 블록을 무효화하는 단계;
상기 운영체제가, 상기 제1데이터가 상기 제1올드 블록에 매핑되어 있음을 나타내는 파일 매핑정보를 상기 제1노드 페이지에 기록하는 단계; 및
상기 운영체제가, 상기 제1노드 페이지를 언핀하는 단계;
를 더 포함하는,
트랜잭션 실행방법.
In Article 10,
If the above first transaction is aborted,
A step in which the above operating system searches the above relocation list to determine the location of the first new block;
The step of the above operating system invalidating the first new block;
The step of the operating system recording file mapping information indicating that the first data is mapped to the first old block in the first node page; and
The above operating system unpins the first node page;
Including more,
How to execute a transaction.
제11항에 있어서, 커밋 블록이 지속가능한 것으로 결정된 경우에만 상기 제1트랜잭션을 커밋하도록 되어 있는, 트랜잭션 실행방법.A transaction execution method in accordance with claim 11, wherein the first transaction is committed only when the commit block is determined to be sustainable. 메모리; 및 운영체제를 실행하는 처리부;를 포함하는 호스트로서,
상기 운영체제가,
페이지 캐시의 크기가 제1트랜잭션에 속한 복수 개의 쓰기 페이지들의 크기보다 작으면, 상기 복수 개의 쓰기 페이지들 중 일부의 쓰기 페이지를 스토리지에 쓰는 이빅트(evict) 단계; 및
상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계;
를 실행하도록 되어 있으며,
상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들에 저장되어 있는 올드 데이터를 대체하는 신규 데이터이고,
상기 일부의 쓰기 페이지의 데이터는, 상기 이빅트 단계에 의해, 상기 스토리지 내의 제1그룹의 신규 블록들에 저장되며,
상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 제1그룹의 올드 블록들을 무효화하지 않도록 되어 있는,
호스트.
A host including a memory; and a processing unit executing an operating system;
The above operating system,
If the size of the page cache is smaller than the size of a plurality of write pages belonging to the first transaction, an evict step of writing some of the write pages among the plurality of write pages to storage; and
A commit step in which the above operating system commits the first transaction;
is designed to run,
The data of the above-mentioned part of the write page is new data that replaces the old data stored in the old blocks of the first group within the above-mentioned storage,
The data of the above part of the write page is stored in the new blocks of the first group in the storage by the above Evict step,
The above operating system is configured not to invalidate the old blocks of the first group before the above commit is executed.
Host.
제14항에 있어서, 상기 운영체제의 파일시스템은 로그 구조 파일시스템인 것을 특징으로 하는, 호스트.
In claim 14, the host is characterized in that the file system of the operating system is a log structure file system.
KR1020230010779A 2022-01-27 2023-01-27 Method and data structure to evict transaction data on disk intermediately Active KR102816588B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020220012633 2022-01-27
KR20220012633 2022-01-27

Publications (2)

Publication Number Publication Date
KR20230115930A KR20230115930A (en) 2023-08-03
KR102816588B1 true KR102816588B1 (en) 2025-06-04

Family

ID=87472035

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020230010779A Active KR102816588B1 (en) 2022-01-27 2023-01-27 Method and data structure to evict transaction data on disk intermediately

Country Status (2)

Country Link
KR (1) KR102816588B1 (en)
WO (1) WO2023146332A1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130166816A1 (en) * 2011-02-25 2013-06-27 Fusion-Io, Inc. Apparatus, System, and Method for Managing Contents of a Cache

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7082495B2 (en) * 2002-06-27 2006-07-25 Microsoft Corporation Method and apparatus to reduce power consumption and improve read/write performance of hard disk drives using non-volatile memory
US7506132B2 (en) * 2005-12-22 2009-03-17 International Business Machines Corporation Validity of address ranges used in semi-synchronous memory copy operations
US8095824B2 (en) * 2009-12-15 2012-01-10 Intel Corporation Performing mode switching in an unbounded transactional memory (UTM) system
US9430396B2 (en) * 2014-12-22 2016-08-30 Intel Corporation Updating persistent data in persistent memory-based storage
US9965350B2 (en) * 2016-09-30 2018-05-08 International Business Machines Corporation Maintaining cyclic redundancy check context in a synchronous I/O endpoint device cache system
KR102347871B1 (en) * 2017-11-14 2022-01-06 삼성전자주식회사 Computing system with cache management mechanism and method of operation thereof
KR102546229B1 (en) * 2018-10-05 2023-06-22 삼성전자주식회사 Storage device using buffer memory in read reclaim operation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130166816A1 (en) * 2011-02-25 2013-06-27 Fusion-Io, Inc. Apparatus, System, and Method for Managing Contents of a Cache

Also Published As

Publication number Publication date
WO2023146332A1 (en) 2023-08-03
KR20230115930A (en) 2023-08-03

Similar Documents

Publication Publication Date Title
US9946745B2 (en) Lock-free transactional support for large-scale storage systems
EP3596619B1 (en) Methods, devices and systems for maintaining consistency of metadata and data across data centers
US10216629B2 (en) Log-structured storage for data access
EP3418883B1 (en) Apparatus and method for read optimized bulk data storage
US7376674B2 (en) Storage of multiple pre-modification short duration copies of database information in short term memory
EP2378420B1 (en) Ownership reassignment in a shared-nothing database system
US7266669B2 (en) File system with file management function and file management method
US20180165324A1 (en) Space management for transactional consistency of in-memory objects on a standby database
JP2021513176A (en) Cache for efficient record lookup in LSM data structures
EP3477482A2 (en) Intelligent snapshot tiering
Hu et al. TxFS: Leveraging file-system crash consistency to provide ACID transactions
CN113220490A (en) Transaction persistence method and system for asynchronous write-back persistent memory
US10761936B2 (en) Versioned records management using restart era
US11593352B2 (en) Cloud-native object storage for page-based relational database
KR102816588B1 (en) Method and data structure to evict transaction data on disk intermediately
CN114528355B (en) Cloud native object storage of page-based relational databases
KR20230115931A (en) Method and data structure to perform a garbage collection and transactions concurrently by using shadow garbage collection
CN119088780A (en) A data storage method and device based on snapshot technology

Legal Events

Date Code Title Description
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20230127

PA0201 Request for examination
PG1501 Laying open of application
E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20240621

Patent event code: PE09021S01D

E701 Decision to grant or registration of patent right
PE0701 Decision of registration

Patent event code: PE07011S01D

Comment text: Decision to Grant Registration

Patent event date: 20250305

GRNT Written decision to grant
PR0701 Registration of establishment

Comment text: Registration of Establishment

Patent event date: 20250529

Patent event code: PR07011E01D

PR1002 Payment of registration fee

Payment date: 20250529

End annual number: 3

Start annual number: 1

PG1601 Publication of registration