KR100501414B1 - Method of and apparatus for logging and restoring the meta data in file system - Google Patents

Method of and apparatus for logging and restoring the meta data in file system Download PDF

Info

Publication number
KR100501414B1
KR100501414B1 KR10-2003-0085715A KR20030085715A KR100501414B1 KR 100501414 B1 KR100501414 B1 KR 100501414B1 KR 20030085715 A KR20030085715 A KR 20030085715A KR 100501414 B1 KR100501414 B1 KR 100501414B1
Authority
KR
South Korea
Prior art keywords
log
metadata
buffer
lsn
transaction
Prior art date
Application number
KR10-2003-0085715A
Other languages
Korean (ko)
Other versions
KR20050052016A (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 한국전자통신연구원
Priority to KR10-2003-0085715A priority Critical patent/KR100501414B1/en
Publication of KR20050052016A publication Critical patent/KR20050052016A/en
Application granted granted Critical
Publication of KR100501414B1 publication Critical patent/KR100501414B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion

Abstract

본 발명은 컴퓨터에서 시스템 고장이 발생하였을 때 파일 시스템의 메타 데이타를 일관된 상태로 회복하는 방법에 관한 것이다. 파일 시스템의 메타 데이터는 파일 시스템을 구성하고 관리하는 정보들로 시스템 고장으로 인한 메타 데이터의 손실은 파일 시스템 운영에 중요한 영향을 미친다. 따라서 파일 시스템의 메타 데이터를 일관된 상태로 회복하는 것은 매우 중요하다. 본 발명은 변경된 메타 데이터의 로그(log)를 기록하였다가 시스템 고장이 발생하였을 때, 기록된 로그를 이용하여 파일 시스템의 메타 데이타를 일관된 상태로 회복할 수 있도록 한다. 이러한 로그는 파일 시스템과 동일한 저장 장치에 저장되거나 또는 다른 저장 장치에 저장될 수 있다. 그리고 로그가 저장되는 로그 공간은 고정된 크기의 연속적인 공간을 반복적으로 재사용할 수 있도록 한다. 이때 로그 공간에는 회복을 위해 필요한 최소한의 로그만을 유지하도록 함으로써 시스템 고장이 발생하였을 때, 로그 공간을 보다 빨리 스캔하면서 파일 시스템의 메타 데이터를 일관된 상태로 회복할 수 있도록 한다.The present invention relates to a method for restoring file system metadata to a consistent state when a system failure occurs in a computer. The metadata of the file system is information that configures and manages the file system. The loss of metadata due to a system failure has an important effect on the file system operation. Therefore, it is very important to restore the file system's metadata to a consistent state. According to the present invention, when a log of changed metadata is recorded and a system failure occurs, the recorded log can be used to restore the metadata of the file system to a consistent state. Such logs may be stored on the same storage device as the file system or on another storage device. In addition, the log space in which logs are stored allows repetitive reuse of a fixed amount of contiguous space. In this case, the log space should be kept only the minimum log needed for recovery, so that when a system failure occurs, the log space can be scanned more quickly and the file system metadata can be restored to a consistent state.

Description

파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 방법 및 장치{ Method of and apparatus for logging and restoring the meta data in file system } Method and device for logging and restoring the meta data in file system}

본 발명은 컴퓨터의 파일 시스템에 관한 것으로, 더욱 상세하게는 파일 시스템의 메타 데이터를 로깅하는 방법 및 시스템 고장이 발생하였을 때 로깅된 데이터에 의해 파일 시스템의 메타 데이타를 일관된 상태로 회복하는 방법 및 장치에 관한 것이다.The present invention relates to a file system of a computer, and more particularly, to a method for logging metadata of a file system and a method and apparatus for recovering the metadata of a file system to a consistent state by the logged data when a system failure occurs. It is about.

일반적으로, 파일 시스템의 메타 데이터는 파일 시스템을 구성하고 관리하는 정보들로서, 시스템 고장으로 인한 메타 데이터의 손실은 파일 시스템 운영에 중요한 영향을 미친다. 따라서 파일 시스템의 메타 데이터를 일관된 상태로 회복하는 것은 매우 중요하다.In general, the metadata of the file system is information for configuring and managing the file system, and the loss of the metadata due to a system failure has an important effect on the file system operation. Therefore, it is very important to restore the file system's metadata to a consistent state.

즉, 파일 시스템의 메타 데이터는 슈퍼 블록, 비트맵, 아이노드(inode), 디렉토리 등과 같이 파일 시스템을 구성하고 관리하기 위한 정보들로서, 만약 시스템 고장이 발생하였을 때 이러한 메타 데이터를 일관성 있는 상태로 회복하지 못한다면 추후 파일 동작에 중대한 문제를 발생시킬 수 있으며, 파일 시스템 전체를 불능의 상태로도 만들 수 있다. 따라서 최근의 파일 시스템들에서는 메타 데이터에 대한 일관성을 보장하기 위하여 갱신된 메타 데이터의 내용을 로그(log)에 저장하고, 시스템 고장이 발생하면 그 로그를 재수행함으로써 메타 데이터를 일관된 상태로 회복하는 방법들이 개발되고 있다.That is, the metadata of the file system is information for configuring and managing the file system such as a super block, a bitmap, an inode, a directory, and the like. If a system failure occurs, the metadata is restored to a consistent state. Failure to do so can cause serious problems in future file operations and can even render the entire file system incapable. Therefore, in recent file systems, the updated metadata is stored in a log to ensure the consistency of the metadata, and when a system failure occurs, the metadata is restored to a consistent state by executing the log again. Methods are being developed.

본 발명은 상기와 같은 실정을 감안하여 창안된 것으로서, 고정된 크기의 로그 공간을 효율적으로 재사용할 수 있도록 하고 로그 공간에는 메타 데이터 회복을 위해 필요한 최소한의 로그만을 유지하면서 시스템 고장이 발생하였을 때 최소한의 로그 공간을 한번 스캔함으로써 메타 데이터를 일관된 상태로 빠르게 회복할 수 있는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 방법 및 그 장치를 제공하는데 그 목적이 있다. The present invention was devised in view of the above situation, and it is possible to efficiently reuse a fixed size of log space, and at least when a system failure occurs while maintaining only the minimum log necessary for metadata recovery in the log space. It is an object of the present invention to provide a logging and recovery method and apparatus for recovering metadata of a file system that can quickly recover meta data to a consistent state by scanning a log space of a single time.

상기와 같은 목적을 달성하기 위하여 본 발명의 방법은, 로깅된 데이터로부터 파일 시스템의 메타 데이터를 회복하는 방법에 있어서, 시스템 고장이 발생했을 당시의 최소 유효 로그의 LSN으로부터 로그를 읽는 단계; 읽은 로그가 유효한 로그인지를 검사하는 단계; 만약, 읽은 로그가 유효한 로그이면 그 로그의 타입에 따라 로그 재수행 절차를 결정하는 단계; 상기 로그타입이 '메타 데이터 로그'이면, 그 로그에 대한 실제 메타 데이터를 디스크로부터 버퍼로 읽어 들이고, 로그의 메타 데이터 버전과 디스크에 저장된 메타 데이터 버전을 비교하여, 로그에 저장된 메타 데이터의 버전이 크다면, 버퍼에 적재된 메타 데이터를 로그의 메타 데이터로 덮어씀으로써 재수행하는 단계; 상기 로그타입이 '트랜잭션 완료 로그'이면 정상적으로 완료된 트랜잭션에 의해 저장된 로그이므로 트랜잭션에 대한 모든 메타 데이터 로그를 재수행한 버퍼를 언픽스(unfix)하는 단계; 상기 로그타입이 '트랜잭션 철회 로그'의 경우에는 비정상적으로 완료된 트랜잭션에 의해 쓰여진 로그이므로, 기존에 이 트랜잭션의 메타 데이터 로그에 대해 재수행한 버퍼의 내용을 무시하고 버퍼들을 언픽스(unfix)하는 단계; 상기 로그의 타입에 따라 모두 처리가 끝나면, 최소 유효 로그의 LSN 값을 다음에 읽을 로그의 LSN 값으로 변경하는 단계; 및 로그 공간의 모든 유효한 로그에 대하여 상기 과정을 반복하고, 로그에 대한 재수행이 끝나면, 재수행이 진행된 모든 메타 데이터 버퍼들을 디스크로 저장하는 단계를 포함하는 것을 특징으로 한다.In order to achieve the above object, the present invention relates to a method of recovering metadata of a file system from logged data, the method comprising: reading a log from an LSN of a minimum valid log at the time of a system failure; Checking whether the read log is a valid login; If the read log is a valid log, determining a log redo procedure according to the log type; If the log type is 'meta data log', the actual metadata of the log is read from the disk into the buffer, and the metadata version stored in the log is compared by comparing the metadata version of the log with the metadata version stored on the disk. If large, redoing the metadata loaded in the buffer by overwriting the metadata of the log; If the log type is a 'transaction completion log', unfixing a buffer in which all metadata logs for a transaction are re-run because the log is stored by a normally completed transaction; If the log type is a 'transaction withdrawal log', the log is written by an abnormally completed transaction, and thus, ignoring the contents of the buffer that has been re-executed for the metadata log of the transaction and unfixing the buffers; Changing the LSN value of the minimum valid log to the LSN value of the next log to be read when all processing is completed according to the log type; And repeating the above process for all valid logs in the log space, and when the log is re-executed, storing all the metadata buffers that have been re-executed on disk.

또한 상기와 같은 목적을 달성하기 위하여 본 발명의 시스템은, 파일 저장공간에 파일을 저장하고 관리하기 위한 파일 시스템에 있어서, 파일 시스템의 메타 데이터를 변경하는 파일 동작들을 트랜잭션 단위로 수행함으로써 메타 데이터 변경 연산의 회복을 지원하기 위한 트랜잭션 관리기 모듈; 상기 트랜잭션의 요구에 따라 메타 데이터에 대한 연산이 이루어지는 버퍼 공간에 대한 관리를 하는 메타 데이터 버퍼 관리기 모듈; 상기 트랜잭션에서 변경한 메타 데이터에 대한 로그를 메타 데이터 버퍼에서 로그 공간에 전역 로그 버퍼 단위로 저장하는 로그 관리기 모듈; 및 시스템 고장이 발생하였을 때, 상기 로그 관리기 모듈을 통해 로그 공간에 저장된 로그를 이용하여 파일 시스템의 메타 데이터를 일관된 상태로 회복하기 위한 회복 관리기 모듈을 포함하여 구성되는 것을 특징으로 한다.In addition, in order to achieve the above object, the system of the present invention, in the file system for storing and managing files in the file storage space, by changing the metadata by performing file operations for changing the metadata of the file system on a transaction basis A transaction manager module for supporting recovery of the operation; A metadata buffer manager module configured to manage a buffer space in which operations on metadata are performed according to a request of the transaction; A log manager module for storing a log of meta data changed in the transaction in a global log buffer unit in a log space in a meta data buffer; And a recovery manager module for recovering the metadata of the file system to a consistent state by using the log stored in the log space through the log manager module when a system failure occurs.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 자세히 설명하기로 한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명이 적용되는 파일 시스템에서 회복과 관련된 모듈들의 구성도로서, 본 발명의 파일 시스템에는 파일 동작과 관련하여 트랜잭션 관리기 모듈(112)와 메타 데이터 버퍼 관리기 모듈(114), 파일 저장공간(116)이 있고, 회복동작과 관련하여 회복 관리기 모듈(122)와 로그 관리기 모듈(124), 로그공간(126)이 있다.1 is a block diagram of modules related to recovery in a file system to which the present invention is applied. In the file system according to the present invention, a transaction manager module 112, a metadata buffer manager module 114, and a file storage space are associated with file operations. 116, there is a recovery manager module 122, a log manager module 124, and a log space 126 with respect to the recovery operation.

도 1을 참조하면, 트랜잭션 관리기 모듈(112)은 파일 시스템의 메타 데이터를 변경하는 파일 동작들을 트랜잭션 단위로 수행함으로써 메타 데이터 변경 연산의 회복을 지원한다. 메타 데이터 버퍼 관리기 모듈(114)은 메타 데이터에 대한 연산이 이루어지는 버퍼 공간에 대한 관리를 하며, 로그 관리기 모듈(124)은 트랜잭션에서 변경한 메타 데이터에 대한 로그를 메타 데이터 버퍼에서 바로 로그 공간(105)에 저장한다. 회복 관리기 모듈(122)은 시스템 고장이 발생하였을 때, 로그 관리기 모듈(124)을 통해 로그 공간(126)에 저장된 로그를 이용하여 파일 시스템의 메타 데이터를 일관된 상태로 회복한다. 그리고 파일 저장 공간(116)과 로그 공간(126)은 동일한 장치에 있거나 또는 다른 장치에 있을 수 있다.Referring to FIG. 1, the transaction manager module 112 supports recovery of a metadata change operation by performing file operations that change metadata of a file system on a transaction basis. The metadata buffer manager module 114 manages the buffer space in which the operation on the metadata is performed, and the log manager module 124 logs the log space for the metadata changed in the transaction directly in the metadata buffer. ). The recovery manager module 122 uses the log stored in the log space 126 through the log manager module 124 to restore the metadata of the file system to a consistent state when a system failure occurs. File storage space 116 and log space 126 may be on the same device or on different devices.

도 2는 본 발명이 적용되는 파일 시스템에서 회복 관리기 모듈(122)의 전역 로그 버퍼(220-1,220-2)와 트랜잭션들 마다 할당되는 트랜잭션 로그 버퍼(210) 간의 관계를 도시한 개략도이다. 2 is a schematic diagram showing the relationship between the global log buffers 220-1 and 220-2 of the recovery manager module 122 and the transaction log buffer 210 allocated for each transaction in the file system to which the present invention is applied.

도 2를 참조하면, 로그는 전역 로그 버퍼(220-1,220-2)를 통하여 로그 공간(126)에 전역 로그 버퍼 단위(220)로 저장된다. 전역 로그 버퍼(220-1,220-2)는 로그를 기록하는 트랜잭션들의 동시성을 향상시키기 위해 두개를 둔다. 따라서 하나의 전역 로그 버퍼가 저장될 때, 트랜잭션들은 다른 전역 로그 버퍼에 로그를 계속 기록할 수 있다. 그리고 각 트랜잭션마다 트랜잭션 로그 버퍼(210)를 사용한다. 이 트랜잭션 로그 버퍼(210)에는 트랜잭션이 메타 데이터 로그를 기록할 때마다 그 메타 데이터 로그에 대한 정보를 기록한다. 이러한 메타 데이터 로그 정보는 추후에 시스템 고장으로 인한 회복시에 사용되게 된다. 트랜잭션 로그 버퍼(210)의 내용은 트랜잭션을 완료하거나 철회할 때, 전역 로그 버퍼(220-1,220-2)에 기록되어 로그 공간(126)에 저장된다.Referring to FIG. 2, the logs are stored in the global log buffer unit 220 in the log space 126 through the global log buffers 220-1 and 220-2. The global log buffers 220-1 and 220-2 are placed in order to improve the concurrency of the transactions recording the log. Thus, when one global log buffer is stored, transactions can continue to write logs to another global log buffer. The transaction log buffer 210 is used for each transaction. The transaction log buffer 210 records information about the metadata log each time a transaction records the metadata log. This metadata log information will be used later for recovery due to system failure. The contents of the transaction log buffer 210 are written to the global log buffers 220-1, 220-2 and stored in the log space 126 when completing or withdrawing a transaction.

도 3은 본 발명이 적용되는 파일 시스템에서 로그 공간(126)에 저장되는 로그 데이터의 포맷이다. 3 is a format of log data stored in log space 126 in a file system to which the present invention is applied.

도 3을 참조하면, 로그는 메타 데이터 로그(310)와 트랜잭션 종료 또는 철회 로그(320)가 있는데, 메타 데이터 로그(310)는 로그에 대한 헤더 정보(312)와 변경된 메타 데이터 블록(314)으로 구성된다. 그리고 트랜잭션 완료 또는 철회 로그(320)는 로그 헤더(322)와 트랜잭션이 기록한 메타 데이터 로그에 대한 정보(324)로 구성된다.Referring to FIG. 3, the log includes a metadata log 310 and a transaction termination or withdrawal log 320. The metadata log 310 includes header information 312 and changed metadata blocks 314 for the log. It is composed. The transaction completion or withdrawal log 320 is composed of a log header 322 and information 324 about the metadata log recorded by the transaction.

도 4는 본 발명이 적용되는 파일 시스템에서 전역 로그 버퍼와 로그 공간 간의 관계를 도시한 개략도이다. 4 is a schematic diagram showing a relationship between a global log buffer and a log space in a file system to which the present invention is applied.

도 4를 참조하면, 로그는 전역 로그 버퍼 단위(220)로 로그 공간(126)에 저장된다. 그리고 각 로그는 다른 로그와 구별할 수 있는 유일한 값인 로그 시퀀스번호(Log Sequence Number: LSN)를 갖는다. 이 로그 시퀀스번호(LSN)는 로그 공간(126)이 재사용된 회수를 나타내는 순차번호(sequence number)와 로그 공간(126)의 시작 위치로부터의 상대적인 변위(offset)로 구성되며, 이 값은 로그 공간(126)에서 로그의 위치를 나타낼 수도 있다.Referring to FIG. 4, the log is stored in the log space 126 in the global log buffer unit 220. Each log has a Log Sequence Number (LSN), which is the only value that can be distinguished from other logs. This log sequence number (LSN) consists of a sequence number representing the number of times log space 126 has been reused and a relative offset from the start of log space 126, which is the log space. The location of the log may be indicated at 126.

로그 관리기 모듈(124)에서는 이러한 로그의 저장과 관리를 위해 세가지 정보를 유지한다. 첫번째로 현재 추가된 로그의 로그 시퀀스번호(LSN)값(400)을 유지한다. 이 값은 현재 전역 로그 버퍼(220)에 추가된 로그의 시작 위치를 가리키며, 트랜잭션이 로그를 추가할 때마다 증가하면서 다음에 추가되는 로그의 LSN 값을 할당한다. 두번째로 최소 유효 로그의 LSN값(401)을 유지한다. 최소유효 로그의 LSN값(401)은 시스템 고장으로부터 메타 데이터를 일관된 상태로 회복하기 위하여 필요한 유효 로그들 중에서 가장 작은 LSN 값으로서, 시스템 회복을 위하여 로그공간(126)에 접근할 시작위치가 된다. 세번째로 최근에 로그 공간(126)에 저장된 로그의 LSN 값(402)이 유지된다. 최근 로그의 LSN값(402)은 마지막으로 로그 공간(126)에 저장된 로그의 시작 위치를 가리키며, 또한 마지막으로 유효한 로그의 시작 위치를 가리킨다. 따라서 시스템 고장으로부터 회복을 위해서 최소 유효 로그의 LSN(401)과 최근 저장 로그의 LSN(402) 사이에 있는 로그만 재수행하면 된다.The log manager module 124 maintains three pieces of information for storing and managing these logs. First, the log sequence number (LSN) value 400 of the currently added log is maintained. This value indicates the starting position of the log that is currently added to the global log buffer 220 and allocates the LSN value of the next added log, incrementing each time a transaction adds the log. Secondly, the LSN value 401 of the minimum valid log is maintained. The LSN value 401 of the least valid log is the smallest LSN value among the valid logs required to recover the metadata to a consistent state from a system failure, and is a starting position to access the log space 126 for system recovery. Thirdly, the LSN value 402 of the log most recently stored in the log space 126 is maintained. The LSN value 402 of the recent log points to the beginning of the log last stored in the log space 126, and also to the beginning of the last valid log. Therefore, only a log between the LSN 401 of the minimum valid log and the LSN 402 of the most recently stored log needs to be rerun to recover from a system failure.

도 5는 본 발명이 적용되는 파일 시스템에서 로그 공간을 반복적으로 재사용할 수 있도록 하는 개념을 도시한 개략도이다.5 is a schematic diagram illustrating a concept of repeatedly reusing log space in a file system to which the present invention is applied.

도 5를 참조하면, 고정된 크기의 로그 공간(126)을 효율적으로 재사용하기 위해서는 로그 공간(126)에 저장된 메타 데이터 로그(310)와 실제 메타 데이터에 대한 변경이 이루어지는 메타 데이터와의 연관 관계를 유지할 필요가 있다. 즉, 변경된 메타 데이터가 버퍼에서 디스크로 저장되면, 그 메타 데이터에 대한 로그는 더 이상 유효하지 않다. 따라서 이러한 로그는 계속해서 로그 공간(126)에 유지할 필요가 없다. Referring to FIG. 5, in order to efficiently reuse a fixed size log space 126, an association between the metadata log 310 stored in the log space 126 and the metadata in which the actual metadata is changed is described. You need to keep it. In other words, if the changed metadata is stored from the buffer to disk, the log for that metadata is no longer valid. Thus, these logs do not need to be kept in log space 126 continuously.

본 발명에서는 로그 공간(126)에 저장되는 전역 로그 버퍼 단위(220)로 '유효 로그 테이블'(500)을 유지한다. 그리고 유효 로그 테이블(500)에는 해당 로그에 저장된 메타 데이터 로그(310)에 대한 메타 데이터가 아직 버퍼에서 디스크로 저장되지 않은 개수인 메타 데이터 버퍼의 참조값을 기록한다. 또한 메타 데이터 버퍼의 헤더(503)에는 버퍼에 적재된 메타 데이터에 대한 로그가 저장된 로그 공간의 유효 로그 테이블 정보와 메타 데이터 로그(310)가 저장된 LSN 값을 유지한다. 그리고 유효 로그 테이블(500)의 메타 데이터 버퍼 참조값은 트랜잭션이 완료할 때, 해당 메타 데이터 로그를 저장한 후에 증가된다(501). 그리고 나중에 메타 데이터 버퍼가 디스크로 저장될 때 감소된다(502).In the present invention, the valid log table 500 is maintained in the global log buffer unit 220 stored in the log space 126. In addition, the valid log table 500 records the reference value of the metadata buffer, which is the number of metadata for the metadata log 310 stored in the log, which is not yet stored in the buffer to disk. In addition, the header 503 of the meta data buffer maintains valid log table information of a log space in which a log of meta data loaded in the buffer is stored, and an LSN value in which the meta data log 310 is stored. The metadata buffer reference value of the valid log table 500 is incremented 501 after storing the metadata log when the transaction completes. And later, when the metadata buffer is saved to disk, it is reduced (502).

도 6은 본 발명이 적용되는 파일 시스템에서 트랜잭션을 완료할 때 로깅에 대한 흐름도이다. 6 is a flow chart for logging when completing a transaction in a file system to which the present invention is applied.

도 6을 참조하면, 트랜잭션은 완료할 때 자신이 변경한 모든 메타 데이터 버퍼에 대하여 단계 600~603을 수행한다. 먼저, 메타 데이터 로그(310)를 전역 로그 버퍼(220-1,220-2)에 기록하고, 전역 로그 버퍼(220-1,220-2)에 해당하는 유효 로그 테이블(500)에서 메타 데이터 버퍼의 참조값을 증가한다(600). 그리고 메타 데이터 로그(310)에 대한 정보를 트랜잭션 로그 버퍼(210)에 기록한다(601). 그 다음 메타 데이터 버퍼의 헤더(503)에 유효 로그 테이블(500)에 대한 정보와 메타 데이터 로그(310)가 기록된 LSN 값을 설정한다(602). 이때 만약 이전에 메타 데이터 로그가 기록된 적이 있으면, 이전에 기록된 메타 데이터 로그의 LSN 값과 현재 기록된 메타 데이터 로그의 LSN 값을 비교하여, 그 값이 임계치 이상이면 모든 로그를 로그 공간(126)에 저장한 이후에 메타 데이터 버퍼를 저장하도록 표시한다(603). 이러한 처리가 모든 변경된 메타 데이터에 대해 수행된 다음에는 트랜잭션 로그 버퍼(210)의 트랜잭션 완료 로그(320)를 전역 로그 버퍼(220-1,220-2)에 기록하고(604), 전역 로그 버퍼(220-1,220-2)를 로그 공간(126)에 저장한다(605). 그리고 단계 603에서 디스크에 저장하도록 표시된 메타 데이터 버퍼를 디스크에 저장한(606) 후에, 모든 변경된 메타 데이터 버퍼들에 대한 래치를 해제함으로써 다른 트랜잭션이 변경된 메타 데이터 버퍼를 접근할 수 있도록 한다(607).Referring to FIG. 6, the transaction performs steps 600 to 603 on all metadata buffers changed by the transaction upon completion. First, the metadata log 310 is written to the global log buffers 220-1 and 220-2, and the reference value of the metadata buffer is increased in the valid log table 500 corresponding to the global log buffers 220-1 and 220-2. (600). In operation 601, information about the meta data log 310 is recorded in the transaction log buffer 210. Next, information about the valid log table 500 and the LSN value in which the metadata log 310 is recorded are set in the header 503 of the metadata buffer (602). At this time, if the metadata log has been recorded before, the LSN value of the previously recorded metadata log is compared with the LSN value of the currently recorded metadata log. In step 603, the metadata buffer is stored to be stored after the data storage is stored. After this processing is performed for all changed metadata, the transaction completion log 320 of the transaction log buffer 210 is written to the global log buffers 220-1 and 220-2 (604), and the global log buffer 220- 1,220-2 is stored in the log space 126 (605). And after storing (606) the metadata buffer marked for storage on disk in step 603, release the latch on all changed metadata buffers so that other transactions can access the modified metadata buffer (607). .

도 7은 본 발명이 적용되는 파일 시스템에서 메타 데이터 버퍼가 디스크에 저장될 때 로그 공간의 관리에 대한 흐름도이다. 7 is a flowchart illustrating management of log space when a metadata buffer is stored on a disk in the file system to which the present invention is applied.

메타 데이터에 대한 변경 작업은 메타 데이터 버퍼상에서 이루어진다. 따라서 트랜잭션은 메타 데이터를 변경하기 위하여 해당 메타 데이터를 메타 데이타 버퍼에 적재하고, 메타 데이터에 대한 변경 작업을 수행한다. 이때 트랜잭션은 변경된 메타 데이터를 다른 트랜잭션이 접근하지 못하도록 래치를 걸어두었다가 트랜잭션을 완료하거나 철회할 때 래치를 푼다. 따라서 디스크에 저장된 메타 데이터는 정상적으로 완료된 트랜잭션에 의해서만 쓰여진 것이다. 메타 데이터 버퍼가 디스크로 저장되는 경우는 버퍼 관리 정책에 의해 해당 버퍼가 디스크로 쓰여지도록 선정된 경우이거나 오랫동안 디스크에 반영되지 않고 버퍼에서만 변경된 경우에 디스크에 저장된다. 또한 파일 시스템을 언마운트할 때는 모든 변경된 메타 데이터 버퍼를 디스크로 내려쓴다. 여기서, 메타 데이터 버퍼를 디스크로 저장한다는 것은 해당 메타 데이터 로그가 더 이상 유효하지 않다는 것을 의미한다. 그러므로 메타 데이터 버퍼를 디스크에 반영할 때 로그 공간에 대한 적절한 처리를 함으로써 로그 공간을 순환하면서 재사용할 수 있다.Changes to the metadata are made on the metadata buffer. Therefore, the transaction loads the metadata into the metadata buffer and changes the metadata in order to change the metadata. At this point, the transaction latches the changed metadata so that no other transaction can access it, and then releases the latch when it completes or withdraws the transaction. Therefore, metadata stored on disk is written only by transactions that have completed normally. The metadata buffer is stored on disk when the buffer is selected to be written to disk by the buffer management policy or when the metadata buffer is changed on the buffer without being reflected on the disk for a long time. Also, when you unmount the file system, all changed metadata buffers are flushed to disk. Here, storing the metadata buffer to disk means that the metadata log is no longer valid. Therefore, when reflecting the metadata buffer to disk, the log space can be recycled and reused by appropriately handling the log space.

도 7을 참조하면, 메타 데이터 버퍼를 디스크에 저장하는 연산은 먼저 메타 데이터 버퍼에 적재된 메타 데이터가 변경되었는 지를 확인하고(700), 변경되었으면 바로 디스크로 저장한다(701). 그리고 현재 로그 공간의 최소 유효 로그의 LSN(401)과 최근에 저장된 로그의 LSN(402)의 차이가 전역 로그 버퍼의 크기 보다 크면(702), 메타 데이터 버퍼 헤더(503)에서 가리키고 있는 유효 로그 테이블(500)에서 메타 데이터 버퍼의 참조값에서 1을 뺀다(703).Referring to FIG. 7, the operation of storing the meta data buffer on the disk first checks whether the meta data loaded on the meta data buffer has changed (700), and immediately stores the meta data buffer on the disk (701). If the difference between the LSN 401 of the minimum valid log of the current log space and the LSN 402 of the recently stored log is greater than the size of the global log buffer (702), the valid log table indicated by the metadata buffer header 503 At (500), 1 is subtracted from the reference value of the metadata buffer (703).

도 8은 본 발명이 적용되는 파일 시스템에서 로그 버퍼를 저장할 때 로그 공간의 관리에 대한 흐름도이다. 8 is a flowchart illustrating the management of log space when storing a log buffer in a file system to which the present invention is applied.

로그 버퍼를 저장하는 경우는 로그 버퍼가 가득찬 경우이거나 또는 트랜잭션을 완료하면서 기록한 로그가 아직 로그 공간(126)에 반영되지 않은 경우에 전역 로그 버퍼의 내용을 로그 공간(126)에 저장하게 된다. 이때 로그 공간(126)에 최소한의 유효한 로그만을 유지하기 위한 처리를 해준다.The log buffer is stored in the log space 126 when the log buffer is full or when the log recorded while completing a transaction is not reflected in the log space 126. At this time, a process for maintaining only the minimum valid log in the log space 126 is performed.

먼저, 로그 버퍼를 저장한 후에 현재 최소 유효 로그의 LSN값(401)과 최근에 저장된 로그의 LSN값(402)의 차이와, 전역 로그 버퍼의 크기를 비교한다(800). 만약, 그 차이가 전역 로그 버퍼의 크기 보다 작으면 아직 전역 로그 버퍼에 계속해서 다른 트랜잭션에 의해 로그가 기록될 수 있으므로 최소 유효 로그 LSN 값(401)은 변경하지 않는다. 그렇지 않고 만약 그 차이가 전역 로그 버퍼의 크기 보다 크면 현재 최소 유효 로그 LSN(401)에 해당하는 유효 로그 테이블(500)이 메타 데이터 버퍼에 의해 참조되는 값을 비교한다(801). 그 값이 "0"이라면 최소 유효 로그 LSN(401)에 해당하는 로그에 쓰여진 메타 데이터 로그는 더 이상 유효하지 않다. 왜냐하면 해당 메타 데이터가 이미 디스크에 반영되었기 때문이다. 따라서 최소 유효 로그 LSN 값(401)을 다음 유효 로그 테이블에 해당하는 LSN 값으로 변경한다. 그리고 최소 유효 로그 LSN(401)과 최근 저장 로그 LSN(402)의 차이가 전역 로그 버퍼 크기 보다 작거나 또는 최소 유효 로그 LSN(401)에 해당하는 유효 로그 테이블의 메타 데이터 버퍼 참조값이 "0"보다 클 때까지 단계 800~802를 반복한다.First, after storing the log buffer, the difference between the LSN value 401 of the current minimum valid log and the LSN value 402 of the recently stored log is compared with the size of the global log buffer (800). If the difference is smaller than the size of the global log buffer, the minimum valid log LSN value 401 is not changed since the log may still be written by another transaction in the global log buffer. Otherwise, if the difference is greater than the size of the global log buffer, the valid log table 500 corresponding to the current minimum valid log LSN 401 compares the value referenced by the metadata buffer (801). If the value is "0", the metadata log written to the log corresponding to the minimum valid log LSN 401 is no longer valid. This is because the metadata has already been reflected on disk. Therefore, the minimum valid log LSN value 401 is changed to the LSN value corresponding to the next valid log table. And the difference between the minimum valid log LSN 401 and the last stored log LSN 402 is less than the global log buffer size, or the metadata buffer reference value of the valid log table corresponding to the minimum valid log LSN 401 is greater than " 0 ". Repeat steps 800-802 until large.

도 9는 본 발명이 적용되는 파일 시스템에서 파일 시스템을 정상적으로 언마운트할 때 로그 공간의 관리에 대한 흐름도이다. 9 is a flowchart illustrating management of log space when a file system is normally unmounted in a file system to which the present invention is applied.

도 9를 참조하면, 파일 시스템이 정상적으로 언마운트되면 파일 시스템이 마운트되어 있는 동안 수행된 파일 동작에 의해 변경된 메타 데이터는 모두 디스크로 반영된다. 따라서 이전의 파일 동작들에 의해 기록된 로그는 더 이상 유지할 필요가 없다. 본 발명에서는 고정된 크기의 로그 공간을 반복적으로 재이용하면서 파일 시스템을 다시 마운트하더라도 기존에 쓰여진 로그를 초기화하지 않고 로그를 기록할 수 있도록 한다. Referring to FIG. 9, if the file system is normally unmounted, all metadata changed by the file operation performed while the file system is mounted are reflected to the disk. Thus, logs recorded by previous file operations no longer need to be maintained. In the present invention, even if the file system is remounted while repeatedly reusing a fixed size log space, the log can be recorded without initializing the previously written log.

이를 위해 본 발명에서는 파일 시스템이 언마운트될 때, 변경된 메타 데이터를 모두 디스크에 저장한 이후에 최근에 저장된 로그가 있는지를 확인한다(900). 그리고 만약 최근에 저장된 로그가 있으면 최근에 저장된 로그의 LSN값으로 최소 유효 로그의 LSN값(401)을 변경한다(901). 이때 변경된 최소 유효 로그 LSN(401)의 변위가 로그 공간(126)의 끝에 도달하면 LSN의 순차 번호를 1 증가시킨다(902). 따라서 다시 로그 공간(126)의 처음부터 저장되는 로그가 유일한 LSN 값을 가질 수 있도록 한다.To this end, in the present invention, when the file system is unmounted, it is checked whether there are recently stored logs after storing all changed metadata on the disk (900). If there is a recently stored log, the LSN value 401 of the minimum valid log is changed to the LSN value of the recently stored log (901). If the changed displacement of the minimum valid log LSN 401 reaches the end of the log space 126, the sequence number of the LSN is increased by one (902). Thus, again, the log stored from the beginning of the log space 126 can have a unique LSN value.

도 10은 본 발명이 적용되는 파일 시스템에서 시스템 고장이 발생하였을 때 파일 시스템의 메타 데이터를 일관된 상태로 회복하는 과정에 대한 흐름도이다. 10 is a flowchart illustrating a process of restoring the metadata of the file system to a consistent state when a system failure occurs in the file system to which the present invention is applied.

먼저 시스템 고장이 발생했을 당시의 최소 유효 로그의 LSN(401)으로부터 로그를 읽는다(1000). 그리고 읽은 로그가 유효한 로그인지를 검사한다. 즉, 읽은 로그가 마지막이거나(1001) 또는 기존에 저장된 로그인지(1002)를 검사한다. 만약, 읽은 로그가 유효한 로그이면 그 로그의 타입에 따라 로그 재수행 절차를 결정한다(1003). 로그의 타입에 따라 세가지의 재수행 처리 과정이 있을 수 있다. First, the log is read from the LSN 401 of the minimum valid log at the time of a system failure (1000). It checks if the log read is a valid login. That is, the log read is the last 1001 or the previously stored login location 1002 is checked. If the read log is a valid log, the log re-execution procedure is determined according to the log type (1003). There can be three re-processing steps depending on the type of log.

첫번째로 실제 변경된 메타 데이터에 대한 정보를 가지고 있는 '메타 데이터 로그'(310)의 경우에는 그 로그에 대한 실제 메타 데이터를 디스크로부터 버퍼로 읽어 들인다(1004). 그리고 로그의 메타 데이터 버전과 디스크에 저장된 메타 데이터 버전을 비교하여, 만약 로그에 저장된 메타 데이터의 버전이 크다면(1007), 변경된 메타 데이터가 디스크에 저장되기 전에 시스템 고장이 발생하였으므로 버퍼에 적재된 메타 데이터를 로그의 메타 데이터로 덮어씀으로써 재수행을 한다(1008). First, in the case of the 'meta data log' 310 having information on the meta data actually changed, the meta data of the log is read from the disk into the buffer (1004). The metadata version of the log is compared with the metadata version stored in the disk. If the version of the metadata stored in the log is large (1007), a system failure occurs before the changed metadata is stored on the disk. Redo is performed by overwriting the metadata with the metadata of the log (1008).

두번째로 '트랜잭션 완료 로그'(320)이면 정상적으로 완료된 트랜잭션에 의해 저장된 로그로, 이 로그에는 해당 트랜잭션이 기록한 메타 데이터 로그에 대한 정보를 갖는다. 따라서 이 경우에는 트랜잭션에 대한 모든 메타 데이터 로그를 재수행한 버퍼를 언픽스(unfix)한다(1005). Secondly, if the transaction completion log 320 is a log stored by a normally completed transaction, the log has information about a metadata log recorded by the transaction. Therefore, in this case, the buffer which re-performed all the metadata logs for the transaction is unfixed (1005).

세번째로 '트랜잭션 철회 로그'(320)의 경우에는 비정상적으로 완료된 트랜잭션에 의해 쓰여진 로그로, 이 로그에는 트랜잭션이 철회되기 전까지 기록된 메타 데이터 로그의 정보를 갖는다. 따라서 이 로그에 대한 처리는 기존에 이 트랜잭션의 메타 데이터 로그에 대해 재수행한 버퍼의 내용을 무시하고 버퍼들을 언픽스(unfix)함으로써(1006) 철회된 트랜잭션에 의해 재수행된 결과가 남지 않도록 한다.Third, the transaction withdrawal log 320 is a log written by an abnormally completed transaction. The log has information of a metadata log recorded before the transaction is withdrawn. Therefore, the processing for this log ignores the contents of the buffer that was previously rerun for the metadata log of this transaction and unfixes the buffers (1006) so that the result of the rerun by the withdrawn transaction is not left.

이와 같이 읽은 로그의 타입에 따라 세가지 경우에 대한 처리가 끝나면, 최소 유효 로그의 LSN 값(401)을 다음에 읽을 로그의 LSN 값으로 변경한다(1009). 그리고 로그 공간의 모든 유효한 로그에 대하여 단계 1000~1009의 과정을 반복한다. 로그에 대한 재수행이 끝나면, 재수행이 진행된 모든 메타 데이터 버퍼들을 디스크로 저장함으로써(1010) 메타 데이터를 일관성 있는 상태로 만든다.After processing for the three cases according to the type of log read as described above, the LSN value 401 of the minimum valid log is changed to the LSN value of the next log to be read (1009). The process of steps 1000 to 1009 is repeated for all valid logs in the log space. When the log is rerun, all metadata buffers that have been rerun are saved to disk (1010) to make the metadata consistent.

이상에서 설명한 바와 같이, 본 발명은 시스템 고장이 발생하였을 때 보다 빨리 파일 시스템의 메타 데이터를 일관성 있는 상태로 회복하기 위하여 로그 공간에 최소의 로그만을 유지하면서 한번의 로그 스캔으로 파일 시스템의 메타 데이터를 일관된 상태로 회복할 수 있다. 또한, 고정된 크기의 로그 공간을 반복적으로 재사용함으로써 로그 공간을 효율적으로 관리할 수 있다. As described above, the present invention maintains a minimum number of logs in the log space and restores the file system metadata in a single log scan in order to recover the file system metadata to a consistent state more quickly when a system failure occurs. You can recover to a consistent state. In addition, log space can be efficiently managed by reusing fixed size log space.

도 1은 본 발명이 적용될 수 있는 파일 시스템에서 회복과 관련된 모듈들의 구성도,1 is a block diagram of modules related to recovery in a file system to which the present invention can be applied;

도 2는 본 발명이 적용되는 파일 시스템에서 회복 관리기 모듈의 로그 버퍼와 트랜잭션들의 로그 버퍼 간의 관계를 도시한 개략도,2 is a schematic diagram showing a relationship between a log buffer of a recovery manager module and a log buffer of transactions in a file system to which the present invention is applied;

도 3은 본 발명이 적용되는 파일 시스템에서 로그 공간에 저장되는 로그 데이터의 포맷,3 is a format of log data stored in log space in a file system to which the present invention is applied;

도 4는 본 발명이 적용되는 파일 시스템에서 로그 버퍼와 로그 공간 간의 관계를 도시한 개념도,4 is a conceptual diagram illustrating a relationship between a log buffer and a log space in a file system to which the present invention is applied;

도 5는 본 발명이 적용되는 파일 시스템에서 로그 공간을 반복적으로 재사용하기 위한 개념을 도시한 개략도,5 is a schematic diagram illustrating a concept for repeatedly reusing log space in a file system to which the present invention is applied;

도 6은 본 발명이 적용되는 파일 시스템에서 트랜잭션을 완료할 때 로깅에 대한 흐름도,6 is a flow chart for logging when completing a transaction in a file system to which the present invention is applied;

도 7은 본 발명이 적용되는 파일 시스템에서 메타 데이터 버퍼가 디스크에 저장될 때 로그 공간의 관리에 대한 흐름도,7 is a flowchart illustrating management of log space when a metadata buffer is stored on a disk in a file system to which the present invention is applied;

도 8은 본 발명이 적용되는 파일 시스템에서 로그 버퍼를 로그 공간에에 저장할 때 로그 공간의 관리에 대한 흐름도,8 is a flowchart illustrating management of log space when a log buffer is stored in log space in a file system to which the present invention is applied;

도 9는 본 발명이 적용되는 파일 시스템에서 파일 시스템을 언마운트할 때 로그 공간의 관리에 대한 흐름도,9 is a flowchart for managing log space when unmounting a file system in the file system to which the present invention is applied;

도 10은 본 발명이 적용되는 파일 시스템에서 시스템 고장이 발생하였을 때의 회복 과정에 대한 흐름도이다.10 is a flowchart illustrating a recovery process when a system failure occurs in a file system to which the present invention is applied.

<도면의 주요 부분에 대한 부호의 설명><Explanation of symbols for the main parts of the drawings>

112: 트랜잭션 관리기 모듈 114: 메타 데이터 버퍼 관리기 모듈112: transaction manager module 114: metadata buffer manager module

116: 파일 저장공간 122: 회복 관리기 모듈116: file storage 122: recovery manager module

124: 로그 관리기 모듈 126: 로그공간124: Log Manager Module 126: Log Space

210: 트랜잭션 로그 버퍼 220, 220-1,220-2: 전역 로그 버퍼210: Transaction log buffer 220, 220-1,220-2: Global log buffer

310: 메타 데이터 로그 322: 트랜잭션 종료/철회 로그310: Metadata Log 322: Transaction End / Cancel Log

Claims (12)

파일 저장공간에 파일을 저장하고 관리하기 위한 파일 시스템에 있어서,In the file system for storing and managing files in the file storage space, 파일 시스템의 메타 데이터를 변경하는 파일 동작들을 트랜잭션 단위로 수행함으로써 메타 데이터 변경 연산의 회복을 지원하기 위한 트랜잭션 관리기 모듈;A transaction manager module for supporting recovery of the metadata change operation by performing file operations for changing the metadata of the file system on a transaction basis; 상기 트랜잭션의 요구에 따라 메타 데이터에 대한 연산이 이루어지는 버퍼 공간에 대한 관리를 하는 메타 데이터 버퍼 관리기 모듈;A metadata buffer manager module configured to manage a buffer space in which operations on metadata are performed according to a request of the transaction; 상기 트랜잭션에서 변경한 메타 데이터에 대한 로그를 메타 데이터 버퍼에서 로그 공간에 전역 로그 버퍼 단위로 저장하는 로그 관리기 모듈; 및A log manager module for storing a log of meta data changed in the transaction in a global log buffer unit in a log space in a meta data buffer; And 시스템 고장이 발생하였을 때, 상기 로그 관리기 모듈을 통해 로그 공간에 저장된 로그를 이용하여 파일 시스템의 메타 데이터를 일관된 상태로 회복하기 위한 회복 관리기 모듈을 포함하여 구성되는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 시스템.File system metadata comprising a recovery manager module for recovering the metadata of the file system to a consistent state by using the log stored in the log space through the log manager module when a system failure occurs Logging and recovery system for recovery. 제1항에 있어서, 상기 로그 관리기 모듈은,The method of claim 1, wherein the log manager module, 로그를 기록하는 트랜잭션들의 동시성을 향상시키기 위해 두개의 전역 로그 버퍼를 구비하여 하나의 전역 로그 버퍼가 저장될 때, 트랜잭션들은 다른 전역 로그 버퍼에 로그를 계속 기록하도록 된 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 시스템.To improve the concurrency of the transactions that record the logs, two global log buffers are provided so that when one global log buffer is stored, the transactions are kept written to another global log buffer. Logging and recovery system for data recovery. 제1항에 있어서, 상기 트랜잭션 관리기 모듈은,The method of claim 1, wherein the transaction manager module, 각 트랜잭션마다 트랜잭션 로그 버퍼를 사용하고, 상기 트랜잭션 로그 버퍼에는 트랜잭션이 메타 데이터 로그를 기록할 때마다 그 메타 데이터 로그에 대한 정보를 기록한 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 시스템.A transaction log buffer is used for each transaction, and the transaction log buffer records and stores information on the metadata log every time a transaction writes the metadata log. . 제3항에 있어서, 상기 트랜잭션 로그 버퍼는,The method of claim 3, wherein the transaction log buffer, 트랜잭션을 완료하거나 철회할 때, 상기 전역 로그 버퍼에 기록되어 로그 공간에 저장되는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 시스템.Logging and recovery system for metadata recovery of a file system, characterized in that when the transaction is completed or withdrawn, it is written to the global log buffer and stored in log space. 제1항에 있어서, The method of claim 1, 상기 로그는 메타 데이터 로그와 트랜잭션 종료/철회 로그로 구분되고, 상기 메타 데이터 로그는 로그 헤더와 변경된 메타 데이터 블록으로 구성되고, 상기 트랜잭션 완료/철회 로그는 로그 헤더와 트랜잭션이 기록한 메타 데이터 로그에 대한 정보로 구성된 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 시스템.The log is divided into a metadata log and a transaction termination / retraction log, and the metadata log is composed of a log header and a changed metadata block, and the transaction completion / retraction log is a log header and a metadata log recorded by a transaction. A logging and retrieval system for file system metadata recovery, comprising information. 제5항에 있어서, The method of claim 5, 상기 로그는 다른 로그와 구별할 수 있는 유일한 값인 로그 시퀀스번호(Log Sequence Number: LSN)를 갖고, 상기 로그 시퀀스번호(LSN)는 로그 공간이 재사용된 회수를 나타내는 순차번호(sequence number)와, 로그 공간의 시작 위치로부터의 상대적인 변위(offset)로 구성되는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 시스템.The log has a Log Sequence Number (LSN), which is the only value that can be distinguished from other logs, and the Log Sequence Number (LSN) is a sequence number representing the number of times log space is reused, and a log. A logging and recovery system for metadata recovery of a file system, characterized by a relative offset from the start of space. 제1항에 있어서, 상기 로그 관리기 모듈은 The method of claim 1, wherein the log manager module 로그의 저장과 관리를 위해 로그공간에 저장되는 전역 로그 버퍼 단위로 유효 로그 테이블을 유지하고, 현재 추가된 로그의 로그 시퀀스번호(LSN)값과, 최소 유효 로그의 LSN값과, 최근에 로그 공간에 저장된 로그의 LSN 값을 관리하여It maintains a valid log table in units of global log buffers that are stored in log space for log storage and management.The log sequence number (LSN) value of the currently added log, the LSN value of the minimum valid log, and the recent log space The LSN value of the log stored in 시스템 고장으로부터 회복을 위해서 최소 유효 로그의 LSN과 최근 저장 로그의 LSN 사이에 있는 로그만 재수행하는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅과 회복 시스템.A logging and recovery system for recovering metadata of a file system, characterized in that only logs between the LSN of the least valid log and the LSN of the most recent stored log are rerun to recover from a system failure. 메타 데이터 로그를 전역 로그 버퍼에 기록하고, 전역 로그 버퍼에 해당하는 유효 로그 테이블에서 메타 데이터 버퍼의 참조값을 증가하는 단계;Writing the meta data log to a global log buffer and increasing a reference value of the meta data buffer in a valid log table corresponding to the global log buffer; 메타 데이터 로그에 대한 정보를 트랜잭션 로그 버퍼에 기록하는 단계;Writing information about the meta data log into a transaction log buffer; 메타 데이터 버퍼의 헤더에 유효 로그 테이블에 대한 정보와 메타 데이터 로그가 기록된 로그 시퀀스번호(LSN) 값을 설정하는 단계;Setting a log sequence number (LSN) value in which information about a valid log table and a metadata log are recorded in a header of the metadata buffer; 만약 이전에 메타 데이터 로그가 기록된 적이 있으면, 이전에 기록된 메타 데이터 로그의 로그 시퀀스번호(LSN) 값과 현재 기록된 메타 데이터 로그의 로그 시퀀스번호(LSN) 값을 비교하여 그 값이 임계치 이상이면 모든 로그를 로그 공간에 저장한 이후에 메타 데이터 버퍼를 저장하도록 표시하는 단계;If the metadata log has been recorded before, the log sequence number (LSN) value of the previously recorded metadata log is compared with the log sequence number (LSN) value of the currently recorded metadata log and the value is greater than or equal to the threshold. If so, marking all the logs in a log space and then storing a metadata buffer; 상기 과정이 모든 변경된 메타 데이터에 대해 수행된 다음에는 트랜잭션 로그 버퍼의 트랜잭션 완료 로그를 전역 로그 버퍼에 기록하고, 전역 로그 버퍼를 로그 공간에 저장하는 단계; 및After the process is performed on all changed metadata, recording the transaction completion log of the transaction log buffer in the global log buffer and storing the global log buffer in the log space; And 상기 디스크에 저장하도록 표시된 메타 데이터 버퍼를 디스크에 저장한 후에, 모든 변경된 메타 데이터 버퍼들에 대한 래치를 해제함으로써 다른 트랜잭션이 변경된 메타 데이터 버퍼를 접근할 수 있도록 하는 단계를 포함하는 파일 시스템의 메타 데이터 회복을 위한 로깅 방법.After storing the metadata buffer indicated on the disk to be stored on disk, unlocking all changed metadata buffers so that other transactions can access the changed metadata buffer. Logging method for recovery. 제8항에 있어서, 메타 데이터 버퍼를 디스크에 저장하는 경우는 The method of claim 8, wherein the metadata buffer is stored in a disk. 버퍼에 적재된 메타 데이터가 변경되었는지를 확인하고, 변경되었으면 바로 디스크로 저장하는 단계;Checking whether the metadata loaded in the buffer has been changed, and if the metadata has been changed, immediately storing the metadata in the disk; 현재 로그 공간의 최소 유효 로그의 로그 시퀀스번호(LSN)와, 최근에 저장된 로그의 시퀀스번호(LSN)의 차이가 전역 로그 버퍼의 크기 보다 크면, 메타 데이터 버퍼 헤더에서 가리키고 있는 유효 로그 테이블에서 메타 데이터 버퍼의 참조값에서 1을 빼는 단계를 더 구비하는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅 방법.If the difference between the log sequence number (LSN) of the minimum valid log in the current log space and the recently stored log sequence number (LSN) is greater than the size of the global log buffer, the metadata in the valid log table pointed to by the metadata buffer header And subtracting 1 from the reference value of the buffer. 제8항에 있어서, 로그 버퍼를 저장하는 경우는The method of claim 8, wherein when storing the log buffer 로그 버퍼를 저장한 후에 현재 최소 유효 로그의 LSN값과 최근에 저장된 로그의 LSN값의 차이와 로그 버퍼의 크기를 비교하는 단계;Comparing the size of the log buffer with the difference between the LSN of the current minimum valid log and the LSN of the most recently stored log after storing the log buffer; 비교결과 그 차이가 전역 로그 버퍼의 크기 보다 작으면 최소 유효 로그 LSN 값을 그대로 유지하는 단계;If the difference is less than the size of the global log buffer, maintaining the minimum valid log LSN value; 비교결과 그 차이가 전역 로그 버퍼의 크기 보다 크면 현재 최소 유효 로그 LSN에 해당하는 유효 로그 테이블이 메타 데이터 버퍼에 의해 참조되는 값을 비교하는 단계;Comparing the value referenced by the metadata buffer with a valid log table corresponding to the current minimum valid log LSN if the difference is greater than the size of the global log buffer; 참조되는 값이 "0"이라면, 최소 유효 로그 LSN에 해당하는 로그에 쓰여진 메타 데이터 로그는 더 이상 유효하지 않으므로 최소 유효 로그 LSN 값을 다음 유효 로그 테이블에 해당하는 LSN 값으로 변경하는 단계; 및If the referenced value is "0", changing the minimum valid log LSN value to an LSN value corresponding to the next valid log table since the metadata log written to the log corresponding to the minimum valid log LSN is no longer valid; And 최소 유효 로그 LSN과 최근 저장 로그 LSN의 차이가 로그 버퍼 크기 보다 작거나 또는 최소 유효 로그 LSN에 해당하는 유효 로그 테이블의 메타 데이터 버퍼 참조값이 "0"보다 클 때까지 상기 과정을 반복하는 단계를 더 구비하는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅 방법.Repeating the above steps until the difference between the minimum valid log LSN and the most recent stored log LSN is less than the log buffer size or the metadata buffer reference value of the valid log table corresponding to the minimum valid log LSN is greater than "0". Logging method for recovering metadata of the file system, characterized in that provided. 제8항에 있어서, 파일 시스템이 정상적으로 언마운트되는 경우, The method of claim 8 wherein the file system is normally unmounted, 변경된 메타 데이터를 모두 디스크에 저장한 이후에 최근에 저장된 로그가 있는지를 확인하는 단계;Checking whether there are recently stored logs after storing all changed metadata on the disk; 만약 최근에 저장된 로그가 있으면 최근에 저장된 로그의 LSN값으로 최소 유효 로그의 LSN값을 변경하는 단계; 및If there is a recently stored log, changing the LSN value of the minimum valid log to the LSN value of the recently stored log; And 변경된 최소 유효 로그 LSN의 변위가 로그 공간의 끝에 도달하면 LSN의 순차 번호를 1 증가시키는 단계를 더 구비하는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복을 위한 로깅 방법.And increasing the sequential number of the LSN by one when the changed displacement of the minimum valid log LSN reaches the end of the log space. 제8항의 방법으로 로깅된 데이터로부터 파일 시스템의 메타 데이터를 회복하는 방법에 있어서, A method for recovering metadata of a file system from data logged by the method of claim 8, 시스템 고장이 발생했을 당시의 최소 유효 로그의 LSN으로부터 로그를 읽는 단계;Reading a log from the LSN of the minimum valid log at the time of a system failure; 읽은 로그가 유효한 로그인지를 검사하는 단계;Checking whether the read log is a valid login; 만약, 읽은 로그가 유효한 로그이면 그 로그의 타입에 따라 로그 재수행 절차를 결정하는 단계;If the read log is a valid log, determining a log redo procedure according to the log type; 상기 로그타입이 '메타 데이터 로그'이면, 그 로그에 대한 실제 메타 데이터를 디스크로부터 버퍼로 읽어 들이고, 로그의 메타 데이터 버전과 디스크에 저장된 메타 데이터 버전을 비교하여, 로그에 저장된 메타 데이터의 버전이 크다면, 버퍼에 적재된 메타 데이터를 로그의 메타 데이터로 덮어씀으로써 재수행하는 단계;If the log type is 'meta data log', the actual metadata of the log is read from the disk into the buffer, and the metadata version stored in the log is compared by comparing the metadata version of the log with the metadata version stored on the disk. If large, redoing the metadata loaded in the buffer by overwriting the metadata of the log; 상기 로그타입이 '트랜잭션 완료 로그'이면 정상적으로 완료된 트랜잭션에 의해 저장된 로그이므로 트랜잭션에 대한 모든 메타 데이터 로그를 재수행한 버퍼를 언픽스(unfix)하는 단계;If the log type is a 'transaction completion log', unfixing a buffer in which all metadata logs for a transaction are re-run because the log is stored by a normally completed transaction; 상기 로그타입이 '트랜잭션 철회 로그'의 경우에는 비정상적으로 완료된 트랜잭션에 의해 쓰여진 로그이므로, 기존에 이 트랜잭션의 메타 데이터 로그에 대해 재수행한 버퍼의 내용을 무시하고 버퍼들을 언픽스(unfix)하는 단계;If the log type is a 'transaction withdrawal log', since the log is written by an abnormally completed transaction, ignoring the contents of the buffer that has been re-executed for the metadata log of the transaction and unfixing the buffers; 상기 로그의 타입에 따라 모두 처리가 끝나면, 최소 유효 로그의 LSN 값을 다음에 읽을 로그의 LSN 값으로 변경하는 단계; 및Changing the LSN value of the minimum valid log to the LSN value of the next log to be read when all processing is completed according to the log type; And 로그 공간의 모든 유효한 로그에 대하여 상기 과정을 반복하고, 로그에 대한 재수행이 끝나면, 재수행이 진행된 모든 메타 데이터 버퍼들을 디스크로 저장하는 단계를 포함하는 것을 특징으로 하는 파일 시스템의 메타 데이터 회복 방법.Repeating the above process for all valid logs in the log space, and if the log has been rerun, storing all the metadata buffers that have been rerun to the disk; .
KR10-2003-0085715A 2003-11-28 2003-11-28 Method of and apparatus for logging and restoring the meta data in file system KR100501414B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2003-0085715A KR100501414B1 (en) 2003-11-28 2003-11-28 Method of and apparatus for logging and restoring the meta data in file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2003-0085715A KR100501414B1 (en) 2003-11-28 2003-11-28 Method of and apparatus for logging and restoring the meta data in file system

Publications (2)

Publication Number Publication Date
KR20050052016A KR20050052016A (en) 2005-06-02
KR100501414B1 true KR100501414B1 (en) 2005-07-18

Family

ID=37248152

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2003-0085715A KR100501414B1 (en) 2003-11-28 2003-11-28 Method of and apparatus for logging and restoring the meta data in file system

Country Status (1)

Country Link
KR (1) KR100501414B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11042453B2 (en) 2016-04-06 2021-06-22 Iucf-Hyu(Industry-University Cooperation Foundation Hanyang University) Database journaling method and apparatus
US11301331B2 (en) 2018-09-20 2022-04-12 Samsung Electronics Co., Ltd. Storage device and operating method of storage device

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100678926B1 (en) 2006-01-05 2007-02-06 삼성전자주식회사 System and method for managing log information
KR101017067B1 (en) * 2008-04-08 2011-02-25 재단법인서울대학교산학협력재단 Locality-Aware Garbage Collection Technique for NAND Flash Memory-Based Storage Systems
KR101984495B1 (en) * 2012-03-19 2019-05-31 삼성전자 주식회사 Removable storage device and system comprising the same
KR101584760B1 (en) 2014-06-30 2016-01-22 성균관대학교산학협력단 Method and apparatus of journaling by block group unit for ordered mode journaling file system
KR101674176B1 (en) 2014-07-24 2016-11-08 성균관대학교산학협력단 Method and apparatus for fsync system call processing using ordered mode journaling with file unit
KR20170054767A (en) * 2015-11-10 2017-05-18 엘지전자 주식회사 Database management system and method for modifying and recovering data the same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11042453B2 (en) 2016-04-06 2021-06-22 Iucf-Hyu(Industry-University Cooperation Foundation Hanyang University) Database journaling method and apparatus
US11301331B2 (en) 2018-09-20 2022-04-12 Samsung Electronics Co., Ltd. Storage device and operating method of storage device

Also Published As

Publication number Publication date
KR20050052016A (en) 2005-06-02

Similar Documents

Publication Publication Date Title
US10949415B2 (en) Logging system using persistent memory
US9836362B2 (en) Cyclic commit transaction protocol
US5561795A (en) Method and apparatus for audit trail logging and data base recovery
US7640412B2 (en) Techniques for improving the reliability of file systems
US8738588B2 (en) Sequential media reclamation and replication
US7613743B1 (en) Methods and apparatuses for data protection
US6560615B1 (en) Method and apparatus for implementing a highly efficient, robust modified files list (MFL) for a storage system volume
US7107486B2 (en) Restore method for backup
CA2933790C (en) Apparatus and method for creating a real time database replica
US7107294B2 (en) Method and apparatus for interrupting updates to a database to provide read-only access
KR100689762B1 (en) A database system and method for storing a plurality of database components in main memory thereof
US9471622B2 (en) SCM-conscious transactional key-value store
CN1454349A (en) A method and system for highly-parallel logging and recovery operation in main-memory transaction processing systems
US5740434A (en) System for maintenance of database integrity
US20110145201A1 (en) Database mirroring
US11200122B2 (en) Barrierless snapshots
CN115145697B (en) Database transaction processing method and device and electronic equipment
Graefe et al. Definition, detection, and recovery of single-page failures, a fourth class of database failures
KR100501414B1 (en) Method of and apparatus for logging and restoring the meta data in file system
Lomet High speed on-line backup when using logical log operations
KR101966399B1 (en) Device and method on file system journaling using atomic operation
US9075819B1 (en) Method and apparatus for providing parallel backup set processing for creating a synthetic backup
CN114880277B (en) Block device snapshot method, system and storage medium
JP2708610B2 (en) Database log management processing method
JP4644446B2 (en) Method, system, and program for managing information about a relationship between a target volume and a source volume when performing additional operations on the relationship

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20100701

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee