JP2007200029A - File copying system - Google Patents

File copying system Download PDF

Info

Publication number
JP2007200029A
JP2007200029A JP2006017964A JP2006017964A JP2007200029A JP 2007200029 A JP2007200029 A JP 2007200029A JP 2006017964 A JP2006017964 A JP 2006017964A JP 2006017964 A JP2006017964 A JP 2006017964A JP 2007200029 A JP2007200029 A JP 2007200029A
Authority
JP
Japan
Prior art keywords
file
metadata
block
segment
replication
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.)
Pending
Application number
JP2006017964A
Other languages
Japanese (ja)
Inventor
Takayuki Tamura
孝之 田村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2006017964A priority Critical patent/JP2007200029A/en
Publication of JP2007200029A publication Critical patent/JP2007200029A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a file copying system for achieving high speed and flexible file copying by limiting network transfer, disk I/O and update block detection in file copying among a plurality of systems to the minimum block. <P>SOLUTION: This file copying system is provided with: a meta data block management means 106 for dividing a file stored in a disk device 108 into data blocks and regions as segments configured of a plurality of the continuous data blocks, and for hierarchically arranging meta data blocks including update decision information for deciding necessity of the update of each of the divided regions, and for storing the hierarchically arranged meta data blocks in a disk device 108 with a tree structure according to the size of the file; and a file copy control means 107 for comparing the update decision information included in the information blocks of the tree structure between the plurality of computers, and for detecting the updated data blocks, and for transferring only the updated data blocks from a copy source to a copy destination. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

この発明は、複数システム間のファイル複製におけるネットワーク転送、ディスクI/O、更新ブロック検出を最小限のブロックに限定すると共に、管理者の介在を必要とする情報への依存を排することで、高速かつ柔軟なファイル複製を実現するファイル複製システムに関するものである。   The present invention limits network transfer, disk I / O, and update block detection in file replication between multiple systems to a minimum number of blocks and eliminates dependence on information that requires administrator intervention. The present invention relates to a file replication system that realizes high-speed and flexible file replication.

コンピュータが扱うデータ規模の増大に伴い、不測の事態に備えたデータ複製が重要となっている。大量のデータを頻繁に複製するには複製の高速化が必要であり、ファイルより小さなブロックを単位とすることでこれを実現しようとする複製方式が提案されている。これはファイルの更新においては全体が置き換わるようなケースは稀であり、ログにおける末尾への追加やデータベースにおける固定長ページ単位での更新がほとんどであるという観察に基づき、更新されていないブロックを毎回複製しないようにすることで高速化を図るものである。従来のファイル複製方式では、ファイル複製の際にまずブロック毎の検算値(チェックサム、ハッシュ値)を計算し、複製元と複製先の間で各ブロックの検算値のみの転送・比較を行う。その結果、検算値が一致したブロックは更新のないブロックとしてデータ転送対象から除外し、残ったブロックのデータのみを複製元から複製先へ転送する(例えば、特許文献1参照)。また、別の従来方式では、ファイル更新の際、元のブロックを上書きするのではなく別のブロックに書き込むファイルシステムを利用する。すなわち、複製元において過去のある時点でのブロックアドレスをスナップショットとして保存しておき、ファイル複製時のブロックアドレスと比較することで更新のあったブロックを検出し、複製先に転送するものである(例えば、特許文献2参照)。   As the scale of data handled by computers increases, data replication in preparation for unforeseen circumstances has become important. In order to frequently replicate a large amount of data, it is necessary to increase the speed of replication, and a replication method has been proposed that realizes this by using blocks smaller than a file as a unit. This is rarely the case where the entire file is replaced in the update of the file. Based on the observation that the addition to the end of the log and the update in units of fixed-length pages in the database are mostly performed, the block that has not been updated is changed each time. The speed is increased by avoiding duplication. In the conventional file duplication method, when a file is duplicated, a check value (checksum, hash value) for each block is first calculated, and only the check value of each block is transferred and compared between the copy source and the copy destination. As a result, a block with a matching verification value is excluded from the data transfer target as an unupdated block, and only the remaining block data is transferred from the replication source to the replication destination (see, for example, Patent Document 1). In another conventional method, a file system is used in which, when a file is updated, the original block is not overwritten but written to another block. In other words, the block address at a certain point in the past is stored as a snapshot in the copy source, and an updated block is detected by comparing it with the block address at the time of file copy, and transferred to the copy destination. (For example, refer to Patent Document 2).

特開2005−100007号公報(第1頁、図2)Japanese Patent Laying-Open No. 2005-100007 (first page, FIG. 2) 特開2004−038928号公報(第34頁、図7)JP 2004-038928 A (page 34, FIG. 7)

上述したような従来のファイル複製方式では、ファイル複製の実行時に検算値を計算するためファイル全体を更新のないブロックも含めて読み出さなければならず、それに伴うディスクI/Oコストにより高速化が阻害されるという問題点があった。また、非常に大きなファイルにおいてはブロック数も多くなるため、全ブロックの検算値を転送するネットワークコストも性能低下要因となる。   In the conventional file duplication method as described above, since the verification value is calculated at the time of file duplication, the entire file must be read including the blocks that are not updated, and the speedup is hindered by the accompanying disk I / O cost. There was a problem of being. In addition, since the number of blocks increases in a very large file, the network cost for transferring the check values of all the blocks also causes a performance decrease.

また、上述したような別の従来方式では、複製元で予め作成しておいたスナップショットが更新検出の基準となるが、スナップショットは通常10個程度までしか作成できず、人手で管理(削除)する作業を要するため柔軟性に欠ける。例えば、耐障害性を高めるため複製先を複数にした場合、全ての複製先への複製が完了するまでは複製元のスナップショットを削除することができない。ファイル複製に要する時間とデータ消失リスクのトレードオフを考慮して、高頻度で複製を行う少数の複製先と低頻度で複製を行う多数の複製先を用いる場合、さらに管理は煩雑になる。また、障害時に任意の複製先を新たな複製元として使用できるようにするためには、複製先においてもスナップショットを適切に管理する必要がある。   In another conventional method as described above, a snapshot created in advance at the copy source is a reference for update detection. However, normally only about 10 snapshots can be created and manually managed (deleted). ) Is inflexible. For example, when a plurality of replication destinations are used to improve fault tolerance, the replication source snapshot cannot be deleted until replication to all the replication destinations is completed. Considering the trade-off between the time required for file replication and the risk of data loss, management is further complicated when a small number of replication destinations that perform high-frequency replication and a large number of replication destinations that perform low-frequency replication. Further, in order to be able to use an arbitrary replication destination as a new replication source in the event of a failure, it is necessary to appropriately manage snapshots at the replication destination.

この発明は、上述のような課題を解決するためになされたもので、その目的は、複数システム間のファイル複製におけるネットワーク転送、ディスクI/O、更新ブロック検出を最小限のブロックに限定すると共に、管理者の介在を必要とする情報への依存を排することで、高速かつ柔軟なファイル複製を実現することができるファイル複製システムを得るものである。   The present invention has been made to solve the above-described problems, and its object is to limit network transfer, disk I / O, and update block detection in file replication between a plurality of systems to a minimum number of blocks. By eliminating dependence on information that requires the intervention of an administrator, a file replication system capable of realizing high-speed and flexible file replication is obtained.

この発明に係るファイル複製システムは、第1のディスク装置に格納されるファイルを、データブロック及び連続する複数のデータブロックから構成されるセグメントである領域に分割し、分割した領域毎の更新有無が判定可能な更新判定情報を含む情報ブロックを階層的に配置し、階層的に配置された情報ブロックを前記ファイルの大きさに応じて木構造で第2のディスク装置に格納するメタデータブロック管理手段と、複数のコンピュータ間で前記木構造の情報ブロックに含まれる更新判定情報の比較を行って更新されたデータブロックを検出し、更新されたデータブロックのみを複製元から複製先へ転送するファイル複製制御手段とを設けたものである。   The file replication system according to the present invention divides a file stored in the first disk device into areas that are segments composed of a data block and a plurality of continuous data blocks, and whether or not each divided area is updated. Metadata block management means that hierarchically arranges information blocks including update determination information that can be determined, and stores the hierarchically arranged information blocks in a second disk device in a tree structure according to the size of the file File comparison that detects update data blocks by comparing update determination information included in the information block of the tree structure between a plurality of computers and transfers only the updated data blocks from the copy source to the copy destination And a control means.

この発明に係るファイル複製システムは、複数システム間のファイル複製におけるネットワーク転送、ディスクI/O、更新ブロック検出を最小限のブロックに限定すると共に、管理者の介在を必要とする情報への依存を排することで、高速かつ柔軟なファイル複製を実現することができるという効果を奏する。   The file replication system according to the present invention limits network transfer, disk I / O, and update block detection in file replication between a plurality of systems to a minimum number of blocks, and relies on information requiring administrator intervention. This eliminates the effect that a high-speed and flexible file replication can be realized.

実施の形態1.
この発明の実施の形態1に係るファイル複製システムについて図1から図33までを参照しながら説明する。図1は、この発明の実施の形態1に係るファイル複製システムの構成を示す図である。なお、以降では、各図中、同一符号は同一又は相当部分を示す。
Embodiment 1 FIG.
A file replication system according to Embodiment 1 of the present invention will be described with reference to FIGS. FIG. 1 is a diagram showing the configuration of a file replication system according to Embodiment 1 of the present invention. In the following, in each figure, the same reference numerals indicate the same or corresponding parts.

図1において、この実施の形態1に係るファイル複製システムは、ネットワーク300を介して、複製元システム100と、複製先システム200とが設けられている。   1, the file replication system according to the first embodiment is provided with a replication source system 100 and a replication destination system 200 via a network 300.

複製元システム100と複製先システム200は、それぞれコンピュータシステムであり、例えばIntel社Xeonプロセッサ、DRAM、SCSIインタフェースを備える固定ディスク装置、ギガビットイーサネット(登録商標)インタフェース、およびそれらを接続するPCI−Xバスなどのハードウェアと、GNU/Linuxオペレーティングシステムソフトウェアにより実現することができる。   Each of the replication source system 100 and the replication destination system 200 is a computer system. For example, an Intel Xeon processor, DRAM, a fixed disk device having a SCSI interface, a Gigabit Ethernet (registered trademark) interface, and a PCI-X bus connecting them. And hardware such as GNU / Linux operating system software.

複製元システム100には、ファイルシステム管理手段105と、メタデータブロック管理手段106と、複製元ファイル複製制御手段107と、ディスク装置108とが設けられている。同様に、複製先システム200には、ファイルシステム管理手段205と、メタデータブロック管理手段206と、複製元ファイル複製制御手段207と、ディスク装置208とが設けられている。   The replication source system 100 is provided with a file system management unit 105, a metadata block management unit 106, a replication source file replication control unit 107, and a disk device 108. Similarly, the replication destination system 200 is provided with a file system management unit 205, a metadata block management unit 206, a replication source file replication control unit 207, and a disk device 208.

複製元システム100は、ファイルをディスク装置108に格納する際、ファイルデータブロック(データブロック)102A〜Dと共に、ファイル管理情報101、ブロックメタデータブロック(情報ブロック)103A〜B、およびセグメントメタデータブロック104(情報ブロック)Aを併せて格納する。ファイルデータブロック102は、ファイルの内容を固定長に分割して格納するためのディスク装置108上の領域であり、ファイルのサイズに応じて必要な数を割り当てて使用する。   When the copy source system 100 stores a file in the disk device 108, the file management information 101, the block metadata blocks (information blocks) 103A to 103B, and the segment metadata block, as well as the file data blocks (data blocks) 102A to 102D, are stored. 104 (information block) A is also stored. The file data block 102 is an area on the disk device 108 for storing the contents of the file divided into fixed lengths, and a necessary number is allocated and used according to the size of the file.

ファイル管理情報101は、複数のファイルデータブロック102のディスク装置108上のアドレスを管理し、ファイルの任意の部分へのランダムアクセスを可能にする。また、ファイル管理情報101は、ファイルの更新日時や所有ユーザなど、メタデータと呼ばれる属性情報も格納する。ディスク装置108上の記憶領域の管理や、ファイル管理情報101を介したファイルアクセスの機能は、一般にオペレーティングシステムの一部であるファイルシステム管理手段105により提供される。   The file management information 101 manages addresses on the disk device 108 of a plurality of file data blocks 102 and enables random access to an arbitrary part of the file. The file management information 101 also stores attribute information called metadata, such as file update date and time and owner user. The management of the storage area on the disk device 108 and the function of file access via the file management information 101 are generally provided by the file system management means 105 which is a part of the operating system.

ファイルシステム管理手段105は、例えばGNU/Linuxオペレーティングシステムが備えるext3ファイルシステムなど、公知の技術により実現することができる。なお、GNU/Linuxを含むUnix(登録商標)系のオペレーティングシステムにおいては、ファイル管理情報101はiノードと称される。   The file system management means 105 can be realized by a known technique such as an ext3 file system provided in the GNU / Linux operating system. Note that in a UNIX (registered trademark) operating system including GNU / Linux, the file management information 101 is referred to as an i-node.

ブロックメタデータブロック103A〜Bおよびセグメントメタデータブロック104Aは、公知のファイルシステムには存在しないものであり、メタデータブロック管理手段106によりディスク装置108上に格納される。メタデータブロック管理手段106は、ファイルシステム管理手段105によりファイル更新の都度呼び出される。   The block metadata blocks 103 </ b> A to 103 </ b> B and the segment metadata block 104 </ b> A do not exist in a known file system, and are stored on the disk device 108 by the metadata block management unit 106. The metadata block management means 106 is called by the file system management means 105 every time a file is updated.

また、メタデータブロック管理手段106は、ファイルシステム管理手段105の機能の一部を利用してディスク装置108上の記憶領域の確保や解放を行う。ファイル管理情報101は、ファイルデータブロック102A〜Dのディスク装置108上のアドレスと共に、セグメントメタデータブロック104Aのアドレスも格納しており、さらにセグメントメタデータブロック104Aには、ブロックメタデータブロック103A〜Bのアドレスが格納されている。   Further, the metadata block management unit 106 secures or releases a storage area on the disk device 108 by using a part of the function of the file system management unit 105. The file management information 101 stores the address of the segment metadata block 104A as well as the address of the file data blocks 102A to 102D on the disk device 108. Further, the segment metadata block 104A includes block metadata blocks 103A to 103B. Is stored.

複製先システム200においても、複製元システム100と同様にしてファイルをディスク装置208に格納する。ファイル管理情報201、ファイルデータブロック202A〜D、ブロックメタデータブロック203A〜B、およびセグメントメタデータブロック204Aは、複製元システム100のファイル管理情報101、ファイルデータブロック102A〜D、ブロックメタデータブロック103A〜B、およびセグメントメタデータブロック104Aにそれぞれ対応しており、ある時点で複製元システム100から複製した際の内容を持っている。   Also in the copy destination system 200, the file is stored in the disk device 208 in the same manner as the copy source system 100. The file management information 201, the file data blocks 202A to 202D, the block metadata blocks 203A to 203B, and the segment metadata block 204A are the file management information 101, the file data blocks 102A to 102D, and the block metadata block 103A of the replication source system 100. ˜B and the segment metadata block 104 </ b> A, respectively, and have contents when copied from the copy source system 100 at a certain point of time.

ファイルシステム管理手段205は、ファイルシステム管理手段105と同一もしくは同等の動作を行う。メタデータブロック管理手段206は、メタデータブロック管理手段106と同一である。   The file system management unit 205 performs the same or equivalent operation as the file system management unit 105. The metadata block management unit 206 is the same as the metadata block management unit 106.

複製元ファイル複製制御手段107と複製先ファイル複製制御手段207は、複製元システム100から複製先システム200へのファイル複製において、ネットワーク300を介して互いに通信しながら、それぞれ複製元システム100と複製先システム200の制御を行う。   The replication source file replication control unit 107 and the replication destination file replication control unit 207 communicate with each other via the network 300 in the file replication from the replication source system 100 to the replication destination system 200, respectively. The system 200 is controlled.

図2は、この発明の実施の形態1に係るファイル複製システムのディスク装置の別の構成を示す図である。   FIG. 2 is a diagram showing another configuration of the disk device of the file replication system according to Embodiment 1 of the present invention.

図2は、図1と異なるサイズのファイルに対するファイルデータブロック、ブロックメタデータブロック、およびセグメントメタデータブロックの構成を示す。セグメントメタデータブロックとブロックメタデータブロックは、ファイルのサイズに応じて高さの変わる木構造を構成する。この木構造においては、一定数(図2では2個)のファイルデータブロック(102A〜G)毎に階層レベル0となるブロックメタデータブロック103A〜Dを配置する。また、一定数(図2では2個)のブロックメタデータブロック(103A〜D)毎に階層レベル1となるセグメントメタデータブロック104B〜Cを配置する。ここで、『セグメント』は、連続する複数のブロックを意味する。   FIG. 2 shows a structure of a file data block, a block metadata block, and a segment metadata block for a file having a size different from that of FIG. The segment metadata block and the block metadata block form a tree structure whose height changes according to the file size. In this tree structure, block metadata blocks 103A to 103D having a hierarchical level 0 are arranged for every predetermined number (two in FIG. 2) of file data blocks (102A to G). In addition, segment metadata blocks 104B to 104C that are at hierarchical level 1 are arranged for every certain number (two in FIG. 2) of block metadata blocks (103A to 103D). Here, “segment” means a plurality of consecutive blocks.

さらに、レベル1の一定数(図2では2個)のセグメントメタデータブロック(104B〜C)毎に階層レベル2となるセグメントメタデータブロック104Aを配置する。レベル2において必要なセグメントメタデータブロックの数が1となるため、このファイルに対するブロックメタデータブロックおよびセグメントメタデータブロックの木構造に必要な高さは3となる。   Furthermore, a segment metadata block 104A at hierarchical level 2 is arranged for every certain number of level 1 (two in FIG. 2) segment metadata blocks (104B to 104C). Since the number of segment metadata blocks required at level 2 is 1, the height required for the tree structure of block metadata blocks and segment metadata blocks for this file is 3.

ファイル管理情報(iノード)101には、木構造の最も高いレベルにある単一のセグメントメタデータブロック、すなわちセグメントメタデータブロック104Aのディスク装置108上のアドレスを格納する。このセグメントメタデータブロック104Aを『ルートメタデータブロック』と呼ぶ。高さ1の木構造、すなわち単一のブロックメタデータブロックで十分なサイズのファイルに対しては、ルートメタデータブロックは当該ブロックメタデータブロックとなる。   The file management information (i-node) 101 stores the address on the disk device 108 of a single segment metadata block at the highest level of the tree structure, that is, the segment metadata block 104A. This segment metadata block 104A is referred to as a “root metadata block”. For a tree structure with a height of 1, that is, a single block metadata block of sufficient size, the root metadata block is the block metadata block.

各レベル間のセグメント/ブロックメタデータブロック(104A〜C、103A〜D)の対応付けは、上位セグメントメタデータブロックに下位セグメント/ブロックメタデータブロックのディスク装置108上のアドレスを格納することにより行う。一方、ブロックメタデータブロックとファイルデータブロックの間はファイル中のオフセットにより間接的に対応付けられる。例えば、ブロックメタデータブロック103Aは、木構造中の位置からファイルの先頭および2番目のオフセットのファイルデータブロック、すなわちファイルデータブロック102Aおよび102Bに対応することが定まる。セグメント/ブロックメタデータブロックとファイルデータブロックの間で明示的な参照を行わないことにより、両者のディスク装置108上の配置の自由度を高めることが可能になる。   The association of the segment / block metadata block (104A to C, 103A to D) between the levels is performed by storing the address of the lower segment / block metadata block on the disk device 108 in the upper segment metadata block. . On the other hand, the block metadata block and the file data block are indirectly associated with each other by an offset in the file. For example, the block metadata block 103A is determined to correspond to the file data block of the first and second offset of the file from the position in the tree structure, that is, the file data blocks 102A and 102B. By not performing explicit reference between the segment / block metadata block and the file data block, it is possible to increase the degree of freedom of arrangement on both disk devices 108.

図3は、この発明の実施の形態1に係るファイル複製システムのディスク装置内のファイル管理情報の構成を示す図である。   FIG. 3 is a diagram showing the configuration of file management information in the disk device of the file replication system according to Embodiment 1 of the present invention.

図3は、ファイル管理情報(iノード)101の詳細を示す。ファイル管理情報(iノード)101は、ファイルサイズ1011、ファイルメタデータ1012、ルートメタデータブロックアドレス1013、およびデータブロックアドレスリスト1014を含む。ファイル管理情報(iノード)101は、この他にファイル作成日時や所有ユーザ、アクセス権に関する情報などを含んでいても良い。   FIG. 3 shows details of the file management information (i-node) 101. The file management information (i-node) 101 includes a file size 1011, file metadata 1012, a root metadata block address 1013, and a data block address list 1014. In addition to this, the file management information (i-node) 101 may include information on file creation date / time, owning user, access right, and the like.

ルートメタデータブロックアドレス1013は、ルートメタデータブロックとなるセグメントメタデータブロックまたはブロックメタデータブロックのディスク装置108上のアドレスを格納する。ルートメタデータブロックは、図1や図2においてはセグメントメタデータブロック104Aである。   The root metadata block address 1013 stores the address on the disk device 108 of the segment metadata block or block metadata block that becomes the root metadata block. The root metadata block is the segment metadata block 104A in FIGS.

また、データブロックアドレスリスト1014には、複数のファイルデータブロックのアドレスを格納するが、例えば上記のext3ファイルシステムのようにファイルデータブロックアドレスの配列、間接ブロック(ファイルデータブロックアドレスの配列を格納したブロック)のアドレス、二重間接ブロック(ファイルデータブロックアドレスの配列を格納した複数ブロックのアドレス配列を格納したブロック)のアドレス、および三重間接ブロックのアドレスなどにより実現することができる。
ファイルメタデータ1012には、ファイルに対する更新の有無を判定できる任意の情報を格納することができるが、ここではファイルの最終更新日時、ファイルを更新する都度増加する世代番号、およびファイルデータのチェックサム(例えば、公知のMD5やSHA−1など)を用いるものとする。
The data block address list 1014 stores the addresses of a plurality of file data blocks. For example, as in the above ext3 file system, an array of file data block addresses and an indirect block (an array of file data block addresses are stored). It can be realized by an address of a block), an address of a double indirect block (a block storing an address array of a plurality of blocks storing an array of file data block addresses), an address of a triple indirect block, and the like.
The file metadata 1012 can store arbitrary information that can determine whether or not the file is updated. Here, the file last update date and time, the generation number that increases each time the file is updated, and the checksum of the file data are stored. (For example, well-known MD5, SHA-1, etc.) shall be used.

図4は、この発明の実施の形態1に係るファイル複製システムのディスク装置内のブロックメタデータブロックの構成を示す図である。   FIG. 4 is a diagram showing a configuration of block metadata blocks in the disk device of the file replication system according to Embodiment 1 of the present invention.

図4は、ブロックメタデータブロック103(103A〜D)の詳細を示す。ブロックメタデータブロック103は、階層レベル1031、有効エントリ数1032、ブロックメタデータ(0)〜(n−1)(1033A〜Z)からなる。階層レベル1031には、常に値0が格納される。有効エントリ数1032には、有効な値が設定されたブロックメタデータのエントリ数が格納され、ブロックメタデータ(0)〜ブロックメタデータ(有効エントリ数−1)が有効であることを表す。有効エントリ数=0のブロックメタデータブロックは作成されず、有効エントリ数は1〜nまでの値を取る。nはブロックメタデータブロック103の領域サイズが許す範囲内で最大の値を用いる。ブロックメタデータの各エントリ(1033A〜Z)のサイズによっては、ブロックメタデータブロック103の末尾には空領域が存在することもある。   FIG. 4 shows details of the block metadata block 103 (103A to 103D). The block metadata block 103 includes a hierarchy level 1031, the number of valid entries 1032 and block metadata (0) to (n-1) (1033A to Z). The hierarchy level 1031 always stores the value 0. The number of valid entries 1032 stores the number of block metadata entries in which valid values are set, and represents that block metadata (0) to block metadata (number of valid entries-1) are valid. A block metadata block with the number of valid entries = 0 is not created, and the number of valid entries takes a value from 1 to n. n is the maximum value within the range allowed by the area size of the block metadata block 103. Depending on the size of each entry (1033A to Z) of the block metadata, an empty area may exist at the end of the block metadata block 103.

ブロックメタデータの各エントリ(1033A〜Z)には、ファイルデータブロックに対する更新の有無を判定する情報として、ファイルメタデータ1012に対応するものを格納する。すなわち、ファイルデータブロックの最終更新日時、ファイルデータブロックの世代番号、およびファイルデータブロックのチェックサムである。ブロックメタデータ(0)(1033A)に対応するファイルデータブロックはブロックメタデータブロック103の木構造中の位置に応じて定まり、ブロックメタデータ(1)〜(有効エントリ数−1)(1033B〜)にはファイル中のオフセットが当該ファイルデータブロックに引き続くファイルデータブロックが対応する。例えば、図2ではn=2であり、ブロックメタデータブロック103Aのブロックメタデータ(0)および(1)にはファイルデータブロック102Aおよび102Bが、ブロックメタデータブロック103Bのブロックメタデータ(0)および(1)にはファイルデータブロック102Cおよび102Dが、それぞれ対応する。   Each block metadata entry (1033A to Z) stores information corresponding to the file metadata 1012 as information for determining whether or not the file data block is updated. That is, the last update date and time of the file data block, the generation number of the file data block, and the checksum of the file data block. The file data block corresponding to the block metadata (0) (1033A) is determined according to the position in the tree structure of the block metadata block 103, and the block metadata (1) to (number of valid entries −1) (1033B to). Corresponds to a file data block in which an offset in the file follows the file data block. For example, in FIG. 2, n = 2, and file data blocks 102A and 102B are included in the block metadata (0) and (1) of the block metadata block 103A, and block metadata (0) and File data blocks 102C and 102D correspond to (1), respectively.

図5は、この発明の実施の形態1に係るファイル複製システムのディスク装置内のセグメントメタデータブロックの構成を示す図である。   FIG. 5 is a diagram showing the structure of the segment metadata block in the disk device of the file replication system according to Embodiment 1 of the present invention.

図5は、セグメントメタデータブロック104(104A〜C)の詳細を示す。セグメントメタデータブロック104は、階層レベル1041、有効エントリ数1042、セグメントメタデータ(0)〜(m−1)(1043A〜Z)、下位メタデータブロックアドレス(0)〜(m−1)(1044A〜Z)からなる。   FIG. 5 shows details of the segment metadata block 104 (104A-C). The segment metadata block 104 includes a hierarchy level 1041, the number of valid entries 1042, segment metadata (0) to (m-1) (1043A to Z), and lower metadata block addresses (0) to (m-1) (1044A). ~ Z).

階層レベル1041には、当該セグメントメタデータブロックが配置される木構造中の階層レベルの値(≧1)が格納される。有効エントリ数1042には、有効な値が設定されたセグメントメタデータおよび下位メタデータブロックアドレスのエントリ数が格納され、セグメントメタデータ(0)〜セグメントメタデータ(有効エントリ数−1)および下位メタデータブロックアドレス(0)〜下位メタデータブロックアドレス(有効エントリ数−1)が有効であることを表す。有効エントリ数=0のセグメントメタデータブロックは作成されず、有効エントリ数は1〜mまでの値を取る。mはセグメントメタデータブロック104の領域サイズが許す範囲内で最大の値を用いる。   The hierarchy level 1041 stores the value (≧ 1) of the hierarchy level in the tree structure in which the segment metadata block is arranged. The number of valid entries 1042 stores the number of entries of segment metadata and lower metadata block addresses for which valid values are set, and segment metadata (0) to segment metadata (number of valid entries −1) and lower metadata. This indicates that the data block address (0) to the lower metadata block address (valid entry number-1) are valid. The segment metadata block with the number of valid entries = 0 is not created, and the number of valid entries takes a value from 1 to m. The maximum value m is used within the range allowed by the area size of the segment metadata block 104.

セグメントメタデータの各エントリ(1043A〜Z)は、セグメントメタデータブロック104の先頭から末尾に向かって順に使用され、下位メタデータブロックアドレスの各エントリ(1044A〜Z)は、逆にセグメントメタデータブロック104の末尾から先頭に向かって順に使用される。セグメントメタデータ(m−1)(1043Z)と下位メタデータブロックアドレス(m−1)(1044Z)の間には空領域が存在することもある。これにより、下位メタデータブロックアドレスを参照しない場合にはセグメントメタデータブロック104とブロックメタデータブロック103の構造の違いを区別する必要がなくなる。一方、階層レベル1031または1041の値を参照すれば、値が0であればブロックメタデータブロック103、0でなければセグメントメタデータブロック104、と再び両者を識別することが可能である。以下、単にメタデータブロックと記した場合は、セグメントメタデータブロックおよびブロックメタデータブロックを総称するものとする。   Each entry (1043A to Z) of the segment metadata is used in order from the beginning to the end of the segment metadata block 104, and each entry (1044A to Z) of the lower metadata block address is conversely a segment metadata block. 104 are used in order from the end to the beginning. There may be an empty area between the segment metadata (m-1) (1043Z) and the lower metadata block address (m-1) (1044Z). This eliminates the need to distinguish between the structure differences between the segment metadata block 104 and the block metadata block 103 when the lower metadata block address is not referred to. On the other hand, if the value of the hierarchy level 1031 or 1041 is referred to, the block metadata block 103 can be identified again if the value is 0, and the segment metadata block 104 can be identified again if the value is not 0. Hereinafter, when simply referred to as a metadata block, the segment metadata block and the block metadata block are collectively referred to.

セグメントメタデータの各エントリ(1043A〜Z)には、セグメントに対する更新の有無を判定する情報として、ファイルメタデータ1012に対応するものを格納する。すなわち、セグメントの最終更新日時、セグメントの世代番号、およびセグメントのチェックサムである。セグメントメタデータ(0)(1043A)に対応するセグメントはセグメントメタデータブロック104の木構造中の位置に応じて定まり、セグメントメタデータ(1)〜(有効エントリ数−1)(1043B〜)にはファイル中のオフセットが当該セグメントに引き続くセグメントが対応する。例えば、図2では、n=2、m=2であり、セグメントメタデータブロック104Bのセグメントメタデータ(0)および(1)にはファイルデータブロック102A〜Bからなるセグメントおよびファイルデータブロック102C〜Dからなるセグメントが、セグメントメタデータブロック104Aのセグメントメタデータ(0)にはファイルデータブロック102A〜Dからなるセグメントが、それぞれ対応する。   Each entry (1043A to Z) of the segment metadata stores information corresponding to the file metadata 1012 as information for determining whether or not the segment is updated. That is, the segment last update date, segment generation number, and segment checksum. The segment corresponding to the segment metadata (0) (1043A) is determined according to the position in the tree structure of the segment metadata block 104, and the segment metadata (1) to (number of valid entries-1) (1043B to) The offset in the file corresponds to the segment following the segment. For example, in FIG. 2, n = 2 and m = 2, and the segment metadata (0) and (1) of the segment metadata block 104B includes a segment composed of file data blocks 102A to 102B and file data blocks 102C to 102D. The segment composed of the file data blocks 102A to 102D corresponds to the segment metadata (0) of the segment metadata block 104A.

下位メタデータブロックアドレスの各エントリ(1044A〜Z)には、木構造中で当該セグメントメタデータブロック104の下位に位置する各メタデータブロック(セグメント/ブロックメタデータブロック)のディスク装置108上のアドレスを格納する。例えば、図2では、m=2であり、セグメントメタデータブロック104Bの下位メタデータブロックアドレス(0)および(1)にはブロックメタデータブロック103Aおよび103Bのアドレスが、セグメントメタデータブロック104Aの下位メタデータブロックアドレス(0)および(1)にはセグメントメタデータブロック104Bおよび104Cのアドレスが、それぞれ格納される。   Each entry (1044A to Z) of the lower metadata block address includes an address on the disk device 108 of each metadata block (segment / block metadata block) positioned below the segment metadata block 104 in the tree structure. Is stored. For example, in FIG. 2, m = 2, and the lower metadata block addresses (0) and (1) of the segment metadata block 104B include the addresses of the block metadata blocks 103A and 103B, and the lower metadata metadata of the segment metadata block 104A. The metadata block addresses (0) and (1) store the addresses of the segment metadata blocks 104B and 104C, respectively.

次に、セグメント/ブロックメタデータブロックにより構成される木構造を特徴付けるパラメータについて一般的に成り立つ関係を説明する。ファイルデータブロックのサイズをBバイト、ブロックメタデータブロックの最大エントリ数をn、セグメントメタデータブロックの最大エントリ数をmとすると、Sバイトのファイルに必要な木構造の高さHは、式(1)で表される。   Next, the relationship that generally holds for the parameters that characterize the tree structure composed of segment / block metadata blocks will be described. If the size of the file data block is B bytes, the maximum number of entries in the block metadata block is n, and the maximum number of entries in the segment metadata block is m, the height H of the tree structure required for the S-byte file is given by the formula ( 1).

Figure 2007200029
Figure 2007200029

ただし、

Figure 2007200029
はxより小さくない最小の整数を表す(小数点以下の切り上げ)。ブロックメタデータブロックの階層レベルh=0であり、ルートメタデータブロックの階層レベルh=H(S)−1である。また、Sバイトのファイルに必要なファイルデータブロック数Iは、式(2)で、 However,
Figure 2007200029
Represents the smallest integer not smaller than x (rounded up after the decimal point). The hierarchical level h = 0 of the block metadata block and the hierarchical level h = H (S) −1 of the root metadata block. Also, the number I of file data blocks required for an S-byte file is given by equation (2):

Figure 2007200029
Figure 2007200029

階層レベルhに位置するメタデータブロック数Kは、式(3)で表される。 The number of metadata blocks K h located at the hierarchy level h is expressed by Expression (3).

Figure 2007200029
Figure 2007200029

各ファイルデータブロックにファイル中のオフセット順にブロック番号i(0≦i<I(S))を付与すると、オフセットsバイトのデータを含むファイルデータブロックのブロック番号iは、式(4)で与えられる。   When the block number i (0 ≦ i <I (S)) is assigned to each file data block in the order of the offset in the file, the block number i of the file data block including data of offset s bytes is given by Expression (4). .

Figure 2007200029
Figure 2007200029

ただし、

Figure 2007200029
はxを越えない最大の整数を表す(小数点以下の切り捨て)。同様に、階層レベルhのメタデータブロックにファイル中のオフセット順にブロック番号k(0≦k<K(S))を付与すると、オフセットsバイトの位置に対応する階層レベルhのメタデータブロックのブロック番号kは、式(5)で与えられる。 However,
Figure 2007200029
Represents the largest integer not exceeding x (rounded down). Similarly, when block numbers k h (0 ≦ k h <K h (S)) are assigned to the metadata block at the hierarchical level h in the order of the offset in the file, the metadata at the hierarchical level h corresponding to the position of the offset s bytes. The block number k h of the block is given by equation (5).

Figure 2007200029
Figure 2007200029

また、階層レベルhのメタデータブロックにおいて、セグメント/ブロックメタデータの各エントリに対応する最大セグメントサイズGは、式(6)で表される。 Further, in the metadata block at the hierarchical level h, the maximum segment size G h corresponding to each entry of the segment / block metadata is expressed by Expression (6).

Figure 2007200029
Figure 2007200029

ただし、ブロックメタデータブロックのブロックメタデータエントリに対応するファイルデータブロックを単一ファイルデータブロックからなるセグメントとみなしている。ファイルの末尾ではセグメントの一部しか使用されないため、実際のセグメントサイズgは、最大セグメントサイズGより小さくなることもある。階層レベルhのメタデータブロックにおいて、オフセットsバイトの位置のセグメント/ブロックメタデータエントリに対応するセグメントサイズgは、式(7)の通りとなる。 However, the file data block corresponding to the block metadata entry of the block metadata block is regarded as a segment composed of a single file data block. Since the end of the file is only used part of the segment, the actual segment size g h may also be less than the maximum segment size G h. In the metadata block hierarchical level h, segment size g h corresponding to the segment / block metadata entry position offset s byte becomes as Equation (7).

Figure 2007200029
Figure 2007200029

さらに、階層レベルhのメタデータブロックkにおいて、オフセットsバイトの位置に対応するセグメント/ブロックメタデータおよび下位メタデータブロックアドレスのエントリ番号jは、式(8)で与えられる。 Further, in the metadata block k h at the hierarchy level h, the segment / block metadata corresponding to the position of the offset s bytes and the entry number j h of the lower metadata block address are given by Expression (8).

Figure 2007200029
Figure 2007200029

ただし、x mod nは、xをnで割った剰余を表す。   Here, x mod n represents a remainder obtained by dividing x by n.

次に、メタデータブロック管理手段106の動作について説明する。図6は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段の動作を説明するための図である。   Next, the operation of the metadata block management unit 106 will be described. FIG. 6 is a diagram for explaining the operation of the metadata block management means of the file replication system according to Embodiment 1 of the present invention.

この図6は、ファイルへの書き込みに伴ってファイルサイズが拡張される際に、メタデータブロック管理手段106によりメタデータブロック木構造に加えられる変更を示す。ここでは、n=4、m=3としている。   FIG. 6 shows changes made to the metadata block tree structure by the metadata block management means 106 when the file size is expanded as the file is written. Here, n = 4 and m = 3.

書き込み前のファイルサイズを6・Bとすると、ブロック番号i=0〜5の6つのファイルデータブロック(斜線部分)が存在し、メタデータブロックが構成する木構造の高さは2となる(H(6・B)=2)。書き込み前の木構造のレベル0の位置には2つ(K(6・B)=2)のブロックメタデータブロックが存在し、レベル1の位置にはルートメタデータブロックとなるセグメントメタデータブロックが1つ(K(6・B)=1)存在する。k=0のブロックメタデータブロックのエントリは全て使用され、エントリ番号j=0,1,2,3にはファイルデータブロックi=0,1,2,3のメタデータがそれぞれ格納される。また、k=1のブロックメタデータブロックのエントリは先頭の2つのみ使用され、エントリ番号j=0,1にファイルデータブロックi=4,5のメタデータがそれぞれ格納される。k=0のセグメントメタデータブロックのエントリは先頭の2つのみ使用され、エントリ番号j=0,1の下位メタデータブロックアドレスにブロックメタデータブロックk=0,1のアドレスがそれぞれ格納される。また、エントリ番号j=0,1のセグメントメタデータには、ファイルデータブロックi=0〜3,4〜5に対応するセグメントのメタデータがそれぞれ格納される。 If the file size before writing is 6 · B, there are six file data blocks (shaded portions) with block numbers i = 0 to 5, and the height of the tree structure formed by the metadata block is 2 (H (6 · B) = 2). There are two (K 0 (6 · B) = 2) block metadata blocks at the level 0 position of the tree structure before writing, and the segment metadata block that becomes the root metadata block at the level 1 position There is one (K 1 (6 · B) = 1). All entries of the block metadata block of k 0 = 0 are used, and the metadata of the file data block i = 0, 1, 2, 3 is stored in the entry numbers j 0 = 0, 1, 2, 3 respectively. . Further, only the top two entries of the block metadata block of k 0 = 1 are used, and the metadata of the file data blocks i = 4 and 5 are stored in the entry numbers j 0 = 0 and 1, respectively. Only the first two segment metadata block entries of k 1 = 0 are used, and the addresses of block metadata blocks k 0 = 0 and 1 are stored in the lower metadata block addresses of entry numbers j 1 = 0 and 1, respectively. Is done. Further, the segment metadata corresponding to the file data blocks i = 0 to 3 and 4 to 5 are stored in the segment metadata of the entry numbers j 1 = 0 and 1, respectively.

ファイルへの書き込みによりファイルサイズが変化しない場合、すなわちファイルデータブロックi=0〜5のいずれかに対する書き込みの際は、メタデータブロックの木構造は変化せず、ファイル/セグメント/ブロックメタデータのみが更新される。例えば、ブロック番号i=4のファイルデータブロックへの書き込みに対しては、ブロックメタデータブロックk(4・B)=1のブロックメタデータ(j(4・B)=0)、セグメントメタデータブロックk(4・B)=0のセグメントメタデータ(j(4・B)=1)、およびファイルメタデータが更新対象となる。 When the file size is not changed by writing to the file, that is, when writing to any of the file data blocks i = 0 to 5, the tree structure of the metadata block is not changed, and only the file / segment / block metadata is stored. Updated. For example, for writing to a file data block with block number i = 4, block metadata block k 0 (4 · B) = 1 block metadata (j 0 (4 · B) = 0), segment metadata The segment metadata (j 1 (4 · B) = 1) of the data block k 1 (4 · B) = 0 and the file metadata are to be updated.

メタデータの内、最終更新日時と世代番号については各メタデータエントリに同一の値を設定する。すなわち、最終更新日時には現在の日時を、世代番号にはファイルメタデータの世代番号に1を加えた値をそれぞれ設定する。これらは書き込まれるデータ自体には影響されないデータ非依存メタデータであり、階層レベル間で次の関係が成り立つ。   Among the metadata, the same value is set in each metadata entry for the last update date and time and the generation number. That is, the current date and time are set as the last update date and time, and a value obtained by adding 1 to the generation number of the file metadata is set as the generation number. These are data-independent metadata that is not affected by the data to be written, and the following relationship is established between hierarchical levels.

データ非依存セグメントメタデータ(j)
=下位メタデータブロックアドレス(j)が指すメタデータブロックのデータ非依存セグメント/ブロックメタデータ(0)〜(有効エントリ数−1)の最大値
Data-independent segment metadata (j)
= Maximum value of data-independent segment / block metadata (0) to (number of valid entries-1) of the metadata block indicated by the lower metadata block address (j)

同様に、次の関係も成り立つ。   Similarly, the following relationship holds.

データ非依存ファイルメタデータ
=ルートメタデータブロックのデータ非依存セグメント/ブロックメタデータ(0)〜(有効エントリ数−1)の最大値
Data-independent file metadata = maximum value of data-independent segment / block metadata (0) to (number of valid entries -1) of root metadata block

一方、データ依存メタデータであるチェックサムについては、階層レベル間で一定の関係が成り立つよう、次のように定義する。   On the other hand, a checksum that is data-dependent metadata is defined as follows so that a certain relationship is established between hierarchical levels.

セグメントメタデータ(j)のチェックサム部
=下位メタデータブロックアドレス(j)が指すメタデータブロックのセグメント/ブロックメタデータ(0)〜(有効エントリ数−1)のチェックサム部に対して求めたチェックサム値
Checksum part of segment metadata (j) = calculated for checksum part of segment / block metadata (0) to (number of valid entries -1) of metadata block indicated by lower metadata block address (j) Checksum value

ファイルメタデータのチェックサム部
=ルートメタデータブロックのセグメント/ブロックメタデータ(0)〜(有効エントリ数−1)のチェックサム部に対して求めたチェックサム値
File metadata checksum part = root metadata block segment / block metadata (0) to (sum of valid entries minus 1) checksum part obtained for the checksum part

これらの定義は、ファイル/セグメントデータに対するチェックサム関数を階層レベル毎に変えることに相当するが、階層レベル間でチェックサム値の比較を行うことはないため、ファイル/セグメントの更新の有無を判定するには十分である。これにより、階層レベルの下位から上位に向かって段階的にチェックサムを計算することが可能になる。ファイル/セグメントデータから直接チェックサムを計算する場合、1つのファイルデータブロックを更新する都度ファイル全体を読み出す必要が生じ、極めて非効率となる。   These definitions are equivalent to changing the checksum function for file / segment data for each hierarchical level, but checksum values are not compared between hierarchical levels, so it is determined whether a file / segment has been updated. It is enough to do. This makes it possible to calculate the checksum step by step from the lower level to the higher level of the hierarchy level. When calculating the checksum directly from the file / segment data, it is necessary to read the entire file every time one file data block is updated, which is extremely inefficient.

次に、ファイルへの書き込みがブロック番号i=18のファイルデータブロックに対して行われるとすると、ファイルサイズは19・Bに増加し、木構造はH(19・B)=3の高さが必要になる。そこで、メタデータブロック管理手段106は、元のルートメタデータブロック(k=0)の上位(階層レベル=2)にセグメントメタデータブロック(k=0)を割り当てて新たなルートメタデータブロックとし、元のルートメタデータブロック(k=0)のアドレスを新たなルートメタデータブロック(k=0)の下位メタデータブロックアドレス(0)に格納する。また、元のルートメタデータブロック(k=0)のセグメントメタデータ(0)〜(1)の最終更新日時と世代番号の最大値を新たなルートメタデータブロック(k=0)のセグメントメタデータ(0)に設定する。 Next, if writing to the file is performed for the file data block with block number i = 18, the file size increases to 19 · B, and the tree structure has a height of H (19 · B) = 3. I need it. Therefore, the metadata block management means 106 assigns the segment metadata block (k 2 = 0) to the upper level (hierarchy level = 2) of the original root metadata block (k 1 = 0), and creates a new root metadata block. And the address of the original root metadata block (k 1 = 0) is stored in the lower metadata block address (0) of the new root metadata block (k 2 = 0). Further, the segment data (0) to (1) of the original root metadata block (k 1 = 0) is updated with the latest update date and time and the maximum value of the generation number in the segment of the new root metadata block (k 1 = 0). Set to metadata (0).

また、ブロック番号i=18に対応するエントリは、ブロックメタデータブロックk(18・B)=4のブロックメタデータ(j(18・B)=2)、セグメントメタデータブロックk(18・B)=1のセグメントメタデータ(j(18・B)=1)、およびセグメントメタデータブロックk(18・B)=1のセグメントメタデータ(j(18・B)=1)であり、存在しないk=4とk=1のメタデータブロックを割り当てると共に、下位メタデータブロックアドレスのエントリを設定して新たな木構造を構成する。 An entry corresponding to block number i = 18 includes block metadata block k 0 (18 · B) = 4 block metadata (j 0 (18 · B) = 2), segment metadata block k 1 (18 B) = 1 segment metadata (j 1 (18 · B) = 1) and segment metadata block k 2 (18 · B) = 1 segment metadata (j 2 (18 · B) = 1) And a non-existent metadata block of k 0 = 4 and k 1 = 1 is assigned, and an entry of a lower metadata block address is set to form a new tree structure.

ここでは、ブロック番号6から17のファイルデータブロックに対する書き込みは行われず、ファイルデータブロックが物理的に割り当てられないホールが生じるものとしている。例えば、ext3など、一般的なファイルシステムはホールの存在を許しており、ホール領域からの読み込みを行った場合は当該領域がバイト値0で埋め尽くされているものとして扱う。メタデータブロック管理手段106も同様に、対応するファイルデータブロックやセグメントがホールのみとなるメタデータブロック(k=2および3)の割り当ては行わない。また、階層レベル上位の対応する下位メタデータブロックアドレス(セグメントメタデータブロックk=0のエントリj=2およびセグメントメタデータブロックk=1のエントリj=0)には無効値(アドレス0)を格納する。これら未割り当てメタデータブロックは、ホールへの書き込みの際にメタデータブロック管理手段106により必要に応じて割り当てられる。 Here, it is assumed that writing to the file data blocks of block numbers 6 to 17 is not performed, and a hole in which the file data block is not physically allocated is generated. For example, a general file system such as ext3 allows the presence of a hole, and when reading from a hole area, the area is treated as being filled with a byte value of 0. Similarly, the metadata block management unit 106 does not perform allocation of metadata blocks (k 0 = 2 and 3) in which the corresponding file data block and segment are only holes. Further, corresponding lower metadata block address (segment metadata block k 1 = 0 entry j 1 = 2 and the segment metadata block k 1 = 1 entry j 1 = 0) invalid value in the hierarchical level higher (Address 0) is stored. These unallocated metadata blocks are allocated as necessary by the metadata block management means 106 when writing to the holes.

一方、一部にホールを含むメタデータブロック(k=1,4およびk=0,1)においてはホールに対応するエントリ(メタデータブロックk=1のエントリ2,3、メタデータブロックk=4のエントリ0,1、メタデータブロックk=0のエントリ2、メタデータブロックk=1のエントリ0)を含むことになる。ホールはそれを生じさせるファイルデータブロック(i=18)への書き込みと同時に、当該領域(i=6〜17)にバイト値0が書き込まれたものとして扱う。従って、これらのエントリに対応するセグメント/ブロックメタデータの内、データ非依存の最終更新日時および世代番号については、書き込みブロック(i=18)に対応するエントリと同様、現在の日時およびファイル世代番号+1をそれぞれ設定する。一方、データ依存メタデータすなわちチェックサムについては、バイト値0で埋められているファイルデータブロックやセグメントと同じ値になるようにする。これらのチェックサム値は予め計算しておくことができる。階層レベル上位へのチェックサム値の伝播は通常の書き込みと同様に行う。ホールに対応するエントリはホールの先頭と末尾の両端に生じる可能性があり、後者は書き込みブロックに対応するメタデータブロック上に生じるが、前者は元のファイルの末尾に生じるため、ホールを生じない書き込みと比較して複雑な処理を要する。 On the other hand, in a metadata block partially including holes (k 0 = 1, 4 and k 1 = 0, 1), entries corresponding to holes (entries 2 and 3 of metadata block k 0 = 1, metadata block) k 0 = 4 entries 0 and 1, metadata block k 1 = 0 entry 2, and metadata block k 1 = 1 entry 0). The hole is treated as if the byte value 0 was written in the area (i = 6 to 17) simultaneously with the writing to the file data block (i = 18) causing the hole. Accordingly, among the segment / block metadata corresponding to these entries, the last update date / time and generation number independent of data are the same as the entry corresponding to the write block (i = 18) and the current date / time and file generation number. Set +1 respectively. On the other hand, the data-dependent metadata, that is, the checksum is set to the same value as the file data block or segment filled with the byte value 0. These checksum values can be calculated in advance. The checksum value is propagated up the hierarchy level in the same manner as normal writing. An entry corresponding to a hole can occur at both the beginning and end of the hole, and the latter occurs on the metadata block corresponding to the writing block, but the former occurs at the end of the original file, so no hole is generated. Complicated processing is required compared with writing.

ファイルサイズの縮小は、ファイルへの書き込みによっては起こらないが、明示的なファイルサイズ切り詰め操作により発生する。この場合の変化は図6の新旧を逆転させることに相当し、ファイルシステム管理手段105が不要なファイルデータブロックを解放すると共に、メタデータブロック管理手段106は不要なメタデータブロックを解放し、ルートメタデータブロックを変更することで木構造の高さを減少させる。   The file size reduction does not occur by writing to the file, but occurs by explicit file size truncation operations. The change in this case corresponds to reversing the old and new in FIG. 6, the file system management means 105 releases unnecessary file data blocks, and the metadata block management means 106 releases unnecessary metadata blocks, and the root Change the metadata block to reduce the height of the tree structure.

次に、メタデータブロック管理手段106の動作を実現するための手段について説明する。図7は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作の概要を示すフローチャートである。ただし、書き込みはファイルデータブロック単位に行い、複数のファイルデータブロックにまたがる書き込みは複数回に分けて処理するものとする。   Next, means for realizing the operation of the metadata block management means 106 will be described. FIG. 7 is a flowchart showing an outline of the file write operation of the metadata block management means of the file replication system according to the first embodiment of the present invention. However, writing is performed in units of file data blocks, and writing across a plurality of file data blocks is processed in multiple steps.

まず、ステップS701において、入力パラメータを元に変数の初期化を行う。入力パラメータは、書き込み開始オフセットs、書き込みサイズgの2つであり、sと式(4)により定まる書き込みファイルデータブロック番号i(s)を変数iにセットする。書き込み領域が単一のファイルデータブロックに収まるためには、s,g,iの間にs+g≦(i+1)・Bの関係が成り立っている必要がある。また、書き込み前におけるファイル管理情報(iノード)101のファイルサイズ1011の値を変数Sに、max(S,s+g)で与えられる書き込み後のファイルサイズを変数S’に、それぞれセットする。   First, in step S701, variables are initialized based on input parameters. There are two input parameters, a write start offset s and a write size g, and a write file data block number i (s) determined by s and Expression (4) is set in a variable i. In order for the write area to fit in a single file data block, the relationship of s + g ≦ (i + 1) · B needs to be established between s, g, and i. Further, the value of the file size 1011 of the file management information (i-node) 101 before writing is set to the variable S, and the file size after writing given by max (S, s + g) is set to the variable S ′.

次に、ステップS702において、ファイル管理情報(iノード)101を更新する。すなわち、ファイルサイズ1011にS’を格納し、ファイルメタデータ1012のデータ非依存部、すなわち最終更新日時に現在の日時を、世代番号に現在の世代番号に1を加えた値を、それぞれ格納する。   In step S702, the file management information (i-node) 101 is updated. That is, S ′ is stored in the file size 1011, and the data-independent portion of the file metadata 1012, that is, the current update date / time at the last update date / time and the value obtained by adding 1 to the current generation number are stored. .

次に、ステップS703において、後述する手順により書き込み後ファイルサイズS’に対して階層レベル数が十分かどうか判定し、不足する場合は階層レベルの追加を行う。   Next, in step S703, it is determined whether the number of hierarchical levels is sufficient with respect to the post-write file size S 'by a procedure described later.

次に、ステップS704において、書き込みファイルデータブロックiに対応するメタデータブロックをルートメタデータブロックから下位階層レベルに向かって辿り、未割り当てメタデータブロックがあれば割り当てを行う。また、セグメント/ブロックメタデータの内、データ非依存部を設定する。ファイルにホールが生じる場合はホール末尾領域に対応するメタデータブロックのセグメント/ブロックメタデータエントリの設定も併せて行う。   Next, in step S704, the metadata block corresponding to the write file data block i is traced from the root metadata block toward the lower hierarchical level, and if there is an unallocated metadata block, allocation is performed. In addition, a data-independent portion is set in the segment / block metadata. When a hole occurs in the file, the setting of the metadata block segment / block metadata entry corresponding to the hole end area is also performed.

続いて、ステップS705において、ファイルにホールが生じる場合、ホール先頭領域に対応するメタデータブロックのセグメント/ブロックメタデータエントリの設定を行う。   Subsequently, in step S705, when a hole is generated in the file, a segment / block metadata entry of the metadata block corresponding to the hole head region is set.

さらに、ステップS706において、書き込みファイルデータブロックiに対応するブロックメタデータブロックのブロックメタデータの内、チェックサムを更新し、上位セグメントメタデータブロックのセグメントメタデータを階層的に更新する。ファイルにホールが生じる場合はホール先頭領域に対応するメタデータブロックのセグメントメタデータも階層的に更新する。   In step S706, the checksum of the block metadata block corresponding to the write file data block i is updated, and the segment metadata of the upper segment metadata block is hierarchically updated. When a hole occurs in the file, the segment metadata of the metadata block corresponding to the hole head region is also updated hierarchically.

最後に、ステップS707において、ルートメタデータブロックのセグメント/ブロックメタデータ(0)〜(有効エントリ数−1)に基づいてファイルメタデータ1012のチェックサムを更新する。   Finally, in step S707, the checksum of the file metadata 1012 is updated based on the segment / block metadata (0) to (number of valid entries-1) of the root metadata block.

次に、ステップS703〜ステップS706のそれぞれの詳細な動作を説明する。図8は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS703の詳細な動作を示すフローチャートである。   Next, detailed operations of steps S703 to S706 will be described. FIG. 8 is a flowchart showing the detailed operation of step S703 of the file write operation of the metadata block management means of the file replication system according to the first embodiment of the present invention.

まず、ステップS801において、変数rをファイル管理情報(iノード)101のルートメタデータブロックアドレス1013の値に初期化し、変数hをrが指すメタデータブロック(104または103)の階層レベル(1041または1031)の値に初期化する。   First, in step S801, the variable r is initialized to the value of the root metadata block address 1013 of the file management information (i-node) 101, and the variable h is set to the hierarchical level (1041 or 103) of the metadata block (104 or 103) pointed to by r. It is initialized to the value of 1031).

続いて、ステップS802において、h+1を式(1)に基づくH(S’)と比較し、h+1の方が小さい場合はステップS803に進み、そうでない場合は処理を終了する。ここで、h+1は書き込み前のメタデータブロック木構造の高さ、H(S’)は書き込み後のメタデータブロック木構造の高さを表しており、ステップS802によりファイルの拡張に対して木構造の高さを増加させる必要があるかどうかの判定が行われる。   Subsequently, in step S802, h + 1 is compared with H (S ′) based on equation (1). If h + 1 is smaller, the process proceeds to step S803, and if not, the process ends. Here, h + 1 represents the height of the metadata block tree structure before writing, and H (S ′) represents the height of the metadata block tree structure after writing. In step S802, the tree structure is expanded with respect to the file extension. A determination is made whether it is necessary to increase the height of.

ステップS803において、新たなセグメントメタデータブロック104を割り当て、次のように初期化する。すなわち、階層レベル1041にh+1を、有効エントリ数1042に1を、下位メタデータブロックアドレス(0)(1044A)にrの値を、セグメントメタデータ(0)にrが指すメタデータブロックのセグメントメタデータ(0)〜(有効エントリ数−1)から求めたメタデータ値を、それぞれ格納する。ただし、メタデータの内最終更新日時および世代番号については、rが指すメタデータブロックのセグメントメタデータ(0)〜(有効エントリ数−1)の最大値を用い、チェックサムについてはrが指すメタデータブロックのセグメントメタデータ(0)〜(有効エントリ数−1)から算出した値を用いる。   In step S803, a new segment metadata block 104 is allocated and initialized as follows. That is, h + 1 is set to the hierarchy level 1041, 1 is set to the number of valid entries 1042, r is set to the lower metadata block address (0) (1044A), and the segment meta data of the metadata block indicated by r is specified to the segment metadata (0). The metadata values obtained from the data (0) to (number of valid entries-1) are stored. However, for the last update date / time and generation number of the metadata, the maximum value of the segment metadata (0) to (number of valid entries-1) of the metadata block pointed to by r is used, and the meta point indicated by r for the checksum. A value calculated from segment metadata (0) to (number of valid entries-1) of the data block is used.

次に、ステップS804において、ファイル管理情報(iノード)101のルートメタデータブロックアドレス1013にステップS803で割り当てたメタデータブロックのアドレスを設定し、ステップS802に戻る。ステップS803とステップS804の動作により、書き込み前のルートメタデータブロックの上位に新たなルートメタデータブロックが挿入される。   In step S804, the address of the metadata block assigned in step S803 is set in the root metadata block address 1013 of the file management information (i-node) 101, and the process returns to step S802. By the operations in steps S803 and S804, a new root metadata block is inserted above the root metadata block before writing.

図9は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS704の詳細な動作を示すフローチャートである。   FIG. 9 is a flowchart showing the detailed operation of step S704 of the file write operation of the metadata block management means of the file replication system according to the first embodiment of the present invention.

まず、ステップS901において、変数hをrが指すルートメタデータブロック(104または103)の階層レベル(1041または1031)の値に初期化し、変数pをrに設定する。 First, at step S901, the initialized to the value of the hierarchical level (1041 or 1031) of the root metadata blocks that points to the variable h r is (104 or 103), it sets the variable p h a r.

ステップS902において、階層レベルhにおいて書き込み開始オフセットsに対応する式(8)のエントリ番号j(s)を変数jに設定する。 In step S902, the entry number j h (s) of Expression (8) corresponding to the write start offset s at the hierarchy level h is set to the variable j h .

次に、ステップS903において、hを0と比較し、hが0より大きければステップS904に進み、そうでなければステップS912に進む。   Next, in step S903, h is compared with 0. If h is greater than 0, the process proceeds to step S904, and if not, the process proceeds to step S912.

ステップS904において、jとpが指すセグメントメタデータブロックの有効エントリ数を比較し、jの方が小さければステップ905に進み、そうでない場合はステップS907に進む。 In step S904, the comparing the number of valid entries in the segment metadata block pointed to j h and p h, the smaller the better for j h proceeds to step 905, otherwise the process proceeds to step S907.

ステップS905において、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)が無効値かどうかを判定し、無効値であればステップS906に進み、そうでない場合はステップS910に進む。 In step S905, the lower the metadata block address of the segment metadata block pointed to p h (j h) it is determined whether or not an invalid value, the process proceeds to step S906 if an invalid value, otherwise proceeds to step S910.

ステップS906において、セグメントメタデータブロック(h>1の時)またはブロックメタデータブロック(h=1の時)を割り当てて初期化する。階層レベルをh−1に、有効エントリ数はh>1であればmに、h=1であればnに設定する。また、セグメント/ブロックメタデータブロックの全エントリについて、データ非依存部(最終更新日時および世代番号)をpが指すセグメントメタデータブロックのセグメントメタデータ(j)の値に設定すると共に、チェックサムをホールに対応する値、すなわちバイト値0で満たされたセグメントに対して階層的に計算した値に設定する。さらに、h>1の時は下位メタデータブロックアドレスの全エントリ(0〜m−1)に無効値を設定する。このステップは既存のホールに書き込みを行う場合に実行され、図6における未割り当てメタデータブロックを割り当て、設定する処理を実現する。 In step S906, a segment metadata block (when h> 1) or a block metadata block (when h = 1) is allocated and initialized. The hierarchical level is set to h-1, and the number of valid entries is set to m if h> 1, and to n if h = 1. Also, for all entries in the segment / block metadata block, and sets the value of the data-independent part (last updated and generation number) segment metadata segment metadata block pointed to p h (j h), check The thumb is set to a value corresponding to the hole, that is, a value calculated hierarchically for a segment filled with a byte value of zero. Further, when h> 1, invalid values are set in all entries (0 to m−1) of the lower metadata block address. This step is executed when writing to an existing hole, and realizes a process of assigning and setting an unallocated metadata block in FIG.

一方、ステップS907において、pが指すセグメントメタデータブロックの更新を行う。エントリ番号が現在の有効エントリ数〜j−1に対応する下位メタデータブロックアドレスに全て無効値を設定し、セグメントメタデータのデータ非依存部にファイルメタデータ1012の値を、チェックサムにホールに対応する値をそれぞれ設定する。その後、有効エントリ数にj+1を設定する。本ステップはファイルサイズの拡張を伴う書き込みにおいて実行される。ホールを生じる際にはホール末尾領域に対応するセグメントメタデータエントリの設定も行う。ホールを生じないファイルサイズ拡張においてはj=有効エントリ数となり、下位メタデータブロックアドレスやセグメントメタデータの設定対象エントリは存在しない。 On the other hand, in step S907, it updates the segment metadata block pointed to p h. All the invalid values are set in the lower metadata block addresses corresponding to the entry number of the current valid entry number to j h −1, the value of the file metadata 1012 is stored in the data independent part of the segment metadata, and the checksum is holed. Set the values corresponding to. Thereafter, j h +1 is set as the number of valid entries. This step is executed in writing with the extension of the file size. When creating a hole, a segment metadata entry corresponding to the hole end area is also set. In the file size expansion that does not cause a hole, j h = the number of valid entries, and there is no entry for setting a lower metadata block address or segment metadata.

続いて、ステップS908において、新たなセグメント/ブロックメタデータブロックを割り当て、階層レベルをh−1に、有効エントリ数を0に初期化する。   Subsequently, in step S908, a new segment / block metadata block is allocated, the hierarchical level is initialized to h-1, and the number of valid entries is initialized to zero.

ステップS909において、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)に、ステップS906またはステップS908において新たに割り当てたセグメント/ブロックメタデータブロックのアドレスを設定する。 In step S909, the lower the metadata block address of the segment metadata block pointed to p h (j h), it sets the address of the newly allocated segment / block metadata block in step S906 or step S908.

続く、ステップS910において、pが指すセグメントメタデータブロックのセグメントメタデータ(j)のデータ非依存部にファイルメタデータ1012の値を設定する。 Subsequent step S910, sets the value of the file metadata 1012 to the data-independent part of the segment metadata segment metadata block pointed to p h (j h).

ステップS911において、変数ph−1にpが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)の値を設定し、変数hを1減じた上で、ステップS902以下の処理を繰り返す。 In step S911, sets the value of the lower metadata block address of the segment metadata block pointed to p h variable p h-1 (j h), the variable h on minus 1, step S902 to repeat the following processes .

ステップS903に続くステップS912では、pが指すブロックメタデータブロックのブロックメタデータ(j)のデータ非依存部にファイルメタデータ1012の値を設定し、処理を終了する。 At step S903 subsequent step S912, sets the value of the file metadata 1012 to the data-independent part of the block metadata block metadata blocks p h points (j h), the process ends.

図10は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS705の詳細な動作を示すフローチャートである。   FIG. 10 is a flowchart showing the detailed operation of step S705 of the file write operation of the metadata block management means of the file replication system according to the first embodiment of the present invention.

まず、ステップS1001において、式(4)に基づき、書き込み前ファイルサイズSに引き続く領域のブロック番号i(S)と書き込みブロック番号i(s)を比較する。前者の方が小さい場合はホールが生じているのでステップS1002に進み、そうでない場合はホールが生じていないので終了する。   First, in step S1001, the block number i (S) of the area following the pre-write file size S is compared with the write block number i (s) based on the equation (4). If the former is smaller, a hole has occurred, so the process proceeds to step S1002, and if not, the process ends because no hole has occurred.

ステップS1002において、変数hをrが指すルートメタデータブロックの階層レベルの値に初期化し、変数p’をrに設定する。 In step S1002, the variable h is initialized to the value of the hierarchy level of the root metadata block pointed to by r, and the variable p h ′ is set to r.

ステップS1003において、式(5)と式(8)に基づき次の値を求める。すなわち、階層レベルhにおいてオフセットSに対応するメタデータブロック番号k’=k(S)およびエントリ番号j’=j(S)と、階層レベルhにおいてオフセットsに対応するメタデータブロック番号k=k(s)およびエントリ番号j=j(s)である。前者はホールの先頭領域に対応し、後者はホールの末尾領域に対応する。 In step S1003, the next value is obtained based on equations (5) and (8). In other words, metadata block number corresponding to the offset S in the hierarchical level h k h '= k h ( S) and the entry number j h' = j h and (S), the metadata block corresponding to the offset s in a hierarchical level h The number k h = k h (s) and the entry number j h = j h (s). The former corresponds to the top area of the hole, and the latter corresponds to the end area of the hole.

続いて、ステップS1004において、k’とkを比較し、k’が小さい場合はステップS1007へ、そうでない場合はステップS1005へ進む。 Subsequently, in step S1004, 'compares the k h, k h' k h If is small to step S1007, otherwise proceeds to step S1005.

ステップS1005において、j’+1とjを比較し、前者が小さければステップS1006へ、そうでなければステップS1008へ進む。 In step S1005, j k '+1 and j k are compared. If the former is small, the process proceeds to step S1006, and if not, the process proceeds to step S1008.

ステップS1006において、p’が指すメタデータブロックのセグメント/ブロックメタデータ(j’+1)〜(j−1)の内、データ非依存部(最終更新日時および世代番号)をファイルメタデータの値に設定し、チェックサムをホールに対応する値に設定する。本ステップは、ホール前後の領域が1つのメタデータブロックに含まれている場合に、ホールに対応するメタデータエントリを設定する処理を行う。 In step S1006, among the 'segment / block metadata of the metadata block pointed to (j h' p h +1) ~ (j h -1), the data-independent part (last updated and generation number) the file metadata Set the checksum to the value corresponding to the hole. This step performs a process of setting a metadata entry corresponding to a hole when an area before and after the hole is included in one metadata block.

また、ステップS1007において、p’が指すメタデータブロックを更新する。h>0の時は有効エントリ数をmに設定し、セグメントメタデータ(j’+1)〜(m−1)の内、データ非依存部(最終更新日時および世代番号)をファイルメタデータの値に、チェックサムをホールに対応する値にそれぞれ設定する。また、h=0の時は有効エントリ数をnに設定し、ブロックメタデータ(j’+1)〜(n−1)の内データ非依存部(最終更新日時および世代番号)をファイルメタデータの値に、チェックサムをホールに対応する値にそれぞれ設定する。本ステップは、ホールが複数メタデータブロックにまたがっている場合に、ホールの先頭領域がかかるメタデータブロックの処理を行う。 Further, in step S1007, it updates the metadata block pointed to by p h '. When h> 0, the number of valid entries is set to m, and among the segment metadata (j h '+1) to (m−1), the data independent part (last update date and generation number) is set in the file metadata. Set the checksum to the value corresponding to the hole. When h = 0, the number of valid entries is set to n, and the data independent part (last update date and generation number) of the block metadata (j h '+1) to (n−1) is set as file metadata. Set the checksum to the value corresponding to the hole. In this step, when a hole extends over a plurality of metadata blocks, the processing of the metadata block in which the head area of the hole is related is performed.

ステップS1006とステップS1007に引き続くステップS1008では、hを0と比較し、h>0ならステップS1009に進み、そうでなければ終了する。   In step S1008 following step S1006 and step S1007, h is compared with 0. If h> 0, the process proceeds to step S1009; otherwise, the process ends.

ステップS1009において、変数ph−1’にp’が指すセグメントメタデータブロックの下位メタデータブロックアドレス(j’)の値を設定し、変数hを1減じた上で、ステップS1003以下の処理を繰り返す。p’は常にホールの先頭領域に対応するメタデータブロックを指す。 In step S1009, it sets the value of the lower metadata block address of the segment metadata block pointed to 'p h a' variable p h-1 (j h ' ), after having subtracted variable h 1, Step S1003 following Repeat the process. p h 'always refers to the metadata block corresponding to the top area of the hole.

図11は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS706の詳細な動作を示すフローチャートである。   FIG. 11 is a flowchart showing detailed operations in step S706 of the file write operation of the metadata block management means of the file replication system according to the first embodiment of the present invention.

まず、ステップS1101において、図9の手順で設定したpが指すブロックメタデータブロックのブロックメタデータ(j)のチェックサムを書き込みファイルデータブロックiの先頭g(s)バイトの内容から計算する。g(s)は当該ファイルデータブロックがファイル末尾の時にBより小さくなることもある(式(7))。 First, in step S1101, the checksum of the block metadata block (j 0 ) of the block metadata block pointed to by p 0 set in the procedure of FIG. 9 is calculated from the contents of the first g 0 (s) bytes of the write file data block i. To do. g 0 (s) may be smaller than B when the file data block is at the end of the file (formula (7)).

次に、ステップS1102において、変数hに0を設定する。   Next, in step S1102, 0 is set to the variable h.

ステップS1103において、pをファイル管理情報(iノード)101のルートメタデータブロックアドレス1013の値と比較し、等しければ終了する。 In step S1103, the p h compared with the values of the file management information (i node) 101 of the root metadata block address 1013, and ends equal.

両者が等しくない場合は、ステップS1104において、hに1を加える。   If they are not equal, 1 is added to h in step S1104.

続く、ステップS1105において、p(図9で設定したもの)が指すセグメントメタデータブロックのセグメントメタデータ(j)に含まれるチェックサムを、ph−1が指す下位のメタデータブロックにおけるセグメント/ブロックメタデータ(0)〜(有効エントリ数−1)の値から計算して設定する。 Subsequent segment in step S1105, the p h a checksum included in the segment metadata segment metadata blocks (those set in FIG. 9) points (j h), lower order of the metadata blocks p h-1 points / Block metadata (0) to (effective entry number-1) are calculated and set.

ステップS1106において、ホールが生じ、かつp’(図10で設定したもの)≠pが成り立つ場合は、p’が指すセグメントメタデータブロックのセグメントメタデータ(j’)に含まれるチェックサムを、p’が指す下位のメタデータブロックにおけるセグメント/ブロックメタデータ(0)〜(有効エントリ数−1)の値から計算して設定する。その後はステップS1103以下を繰り返す。 In step S1106, checks that are contained in the hole occurs, and p h '(as set in FIG. 10) if ≠ p h is satisfied, p h' segment metadata segment metadata block pointed to (j h ') Sam and segment / block metadata (0) in the metadata blocks in the lower pointed to p h 'set by calculation from the value of - (effective number of entries -1). Thereafter, step S1103 and subsequent steps are repeated.

次に、ファイルサイズの切り詰め操作におけるメタデータブロック管理手段106の動作を説明する。図12は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイルサイズの切り詰め動作の概要を示すフローチャートである。   Next, the operation of the metadata block management means 106 in the file size truncation operation will be described. FIG. 12 is a flowchart showing an outline of the file size truncation operation of the metadata block management means of the file replication system according to the first embodiment of the present invention.

まず、ステップS1201において、入力パラメータである切り詰め後のファイルサイズSと式(4)に基づき、切り詰め後の最終ファイルデータブロック番号i(S−1)を変数iに設定する。ただし、Sは元のファイルサイズより小さいものとし、そうでない場合はファイルシステム管理手段105によるメタデータブロック管理手段106の呼び出しは行われないものとする。   First, in step S1201, the final file data block number i (S-1) after truncation is set to the variable i based on the file size S after truncation which is an input parameter and Expression (4). However, it is assumed that S is smaller than the original file size. Otherwise, the file system management unit 105 does not call the metadata block management unit 106.

次に、ステップS1202において、ファイル管理情報(iノード)101を更新する。すなわち、ファイルサイズ1011にSを格納し、ファイルメタデータ1012のデータ非依存部、すなわち最終更新日時に現在の日時を、世代番号に現在の世代番号に1を加えた値を、それぞれ格納する。   In step S1202, the file management information (i-node) 101 is updated. That is, S is stored in the file size 1011, and the data independent part of the file metadata 1012, that is, the current date and time at the last update date and the value obtained by adding 1 to the current generation number are stored.

次に、ステップS1203において、ファイルサイズの縮小により不要となった階層レベルの除去を行う。   In step S1203, layer levels that are no longer needed due to the reduction in file size are removed.

次に、ステップS1204において、最終ファイルデータブロックiに対応するメタデータブロックをルートメタデータブロックから下位階層レベルに向かって辿り、不要となったメタデータブロックは解放し、ホールに対応する未割り当てメタデータブロックがあれば割り当てを行う。また、セグメント/ブロックメタデータの内、データ非依存部を設定する。   Next, in step S1204, the metadata block corresponding to the final file data block i is traced from the root metadata block toward the lower hierarchical level, the unnecessary metadata block is released, and the unallocated metadata corresponding to the hole is released. If there is a data block, it is assigned. In addition, a data-independent portion is set in the segment / block metadata.

ステップS1205において、ファイルデータブロックiへの書き込みと同様にして対応するセグメント/ブロックメタデータ(チェックサム)の更新を行う。   In step S1205, the corresponding segment / block metadata (checksum) is updated in the same manner as the writing to the file data block i.

最後に、ステップS1206において、ルートメタデータブロックのセグメント/ブロックメタデータ(0)〜(有効エントリ数−1)に基づいてファイルメタデータ1012のチェックサムを更新する。   Finally, in step S1206, the checksum of the file metadata 1012 is updated based on the segment / block metadata (0) to (number of valid entries-1) of the root metadata block.

図13は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイルサイズの切り詰め動作のステップS1203の詳細な動作を示すフローチャートである。   FIG. 13 is a flowchart showing the detailed operation of step S1203 of the file size truncation operation of the metadata block management means of the file replication system according to the first embodiment of the present invention.

まず、ステップS1301において、変数rをファイル管理情報(iノード)101のルートメタデータブロックアドレス1013の値に初期化し、変数hをrが指すメタデータブロック(104または103)の階層レベル(1041または1031)の値に初期化する。   First, in step S1301, the variable r is initialized to the value of the root metadata block address 1013 of the file management information (i-node) 101, and the variable h is set to the hierarchical level (1041 or 103) of the metadata block (104 or 103) pointed to by r. It is initialized to the value of 1031).

ステップS1302において、h+1の値を式(1)に基づくH(S)の値と比較し、h+1の方が大きい場合はステップS1303に進み、そうでない場合は終了する。ここで、h+1はファイル切り詰め前のメタデータブロック木構造の高さ、H(S)はファイル切り詰め後のメタデータブロック木構造の高さを表しており、ステップS1302によりファイル切り詰めに対して木構造の高さを減少させる必要があるかどうかの判定が行われる。   In step S1302, the value of h + 1 is compared with the value of H (S) based on equation (1). If h + 1 is larger, the process proceeds to step S1303; otherwise, the process ends. Here, h + 1 represents the height of the metadata block tree structure before file truncation, and H (S) represents the height of the metadata block tree structure after file truncation. A determination is made whether it is necessary to reduce the height of the.

ステップS1303において、ファイル管理情報(iノード)101のルートメタデータブロックアドレスにrが指すセグメントメタデータブロックの下位メタデータブロックアドレス(0)の値を格納する。   In step S1303, the value of the lower metadata block address (0) of the segment metadata block indicated by r is stored in the root metadata block address of the file management information (i-node) 101.

次いで、ステップS1304において、rが指すセグメントメタデータブロックの下位メタデータブロックアドレス(1)〜(有効エントリ数−1)が指すメタデータブロックの階層を下位階層レベルから順に解放し、最後にrが指すセグメントメタデータブロックを解放する。その後、ステップS1301以下の手順を繰り返す。   Next, in step S1304, the hierarchy of the metadata block indicated by the lower metadata block address (1) to (number of valid entries −1) of the segment metadata block indicated by r is released in order from the lower hierarchy level, and finally r is Release the segment metadata block that points to. Then, the procedure after step S1301 is repeated.

図14は、この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイルサイズの切り詰め動作のステップS1204の詳細な動作を示すフローチャートである。   FIG. 14 is a flowchart showing the detailed operation of step S1204 of the file size truncation operation of the metadata block management means of the file replication system according to the first embodiment of the present invention.

まず、ステップS1401において、変数hをrが指すルートメタデータブロックの階層レベルの値に初期化し、変数pをrに設定する。 First, in step S1401, and initializes a variable h to the value of the hierarchical level of the root meta-data block pointed to by r, it sets the variable p h a r.

ステップS1402において、pが指すメタデータブロックのファイル切り詰め後の最終エントリ番号j(S−1)を変数jに設定する。 In step S1402, it sets p h metadata block pointed to by the file truncate after the final entry number j h a (S-1) to the variable j h.

ステップS1403において、hを0と比較し、h>0の場合はステップS1404に進み、そうでない場合はステップS1411に進む。   In step S1403, h is compared with 0. If h> 0, the process proceeds to step S1404, and if not, the process proceeds to step S1411.

ステップS1404において、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j+1)〜(有効エントリ数−1)が指すメタデータブロックの階層を解放する。 In step S1404, releasing the lower metadata block address (j h +1) ~ (effective number of entries -1) refers hierarchical metadata block segment metadata block pointed to p h.

ステップS1405において、pが指すセグメントメタデータブロックの有効エントリ数をj+1に設定する。 In step S1405, sets the number of valid entries in the segment metadata block pointed to p h to j h +1.

ステップS1406において、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)が無効値かどうかを判定し、無効値であればステップS1407に進み、そうでない場合はステップS1409に進む。 In step S1406, the lower the metadata block address of the segment metadata block pointed to p h (j h) it is determined whether or not an invalid value, the process proceeds to step S1407 if it is an invalid value, otherwise proceeds to step S1409.

ステップS1407において、セグメントメタデータブロック(h>1の時)またはブロックメタデータブロック(h=1の時)を割り当てて初期化する。階層レベルをh−1に、有効エントリ数はh>1であればmに、h=1であればnに設定する。また、セグメント/ブロックメタデータブロックの全エントリについて、データ非依存部(最終更新日時および世代番号)をpが指すセグメントメタデータブロックのセグメントメタデータ(j)の値に設定すると共に、チェックサムをホールに対応する値、すなわちバイト値0で満たされたセグメントに対して階層的に計算した値に設定する。さらに、h>1の時は下位メタデータブロックアドレスの全エントリ(0〜m−1)に無効値を設定する。このステップはホール内に新たなファイルサイズを指定した切り詰めを行った場合に必要となる。 In step S1407, a segment metadata block (when h> 1) or a block metadata block (when h = 1) is allocated and initialized. The hierarchical level is set to h-1, and the number of valid entries is set to m if h> 1, and to n if h = 1. Also, for all entries in the segment / block metadata block, and sets the value of the data-independent part (last updated and generation number) segment metadata segment metadata block pointed to p h (j h), check The thumb is set to a value corresponding to the hole, that is, a value calculated hierarchically for a segment filled with a byte value of zero. Further, when h> 1, invalid values are set in all entries (0 to m−1) of the lower metadata block address. This step is necessary when truncation with a new file size specified in the hole.

ステップS1408において、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)に新たに割り当てたセグメント/ブロックメタデータブロックのアドレスを設定する。 In step S1408, it sets the address of the lower metadata block address (j h) to the newly allocated segment / block metadata block segment metadata block pointed to p h.

続く、ステップS1409において、pが指すセグメントメタデータブロックのセグメントメタデータ(j)のデータ非依存部にファイルメタデータ1012の値を設定する。 Subsequent step S1409, sets the value of the file metadata 1012 to the data-independent part of the segment metadata segment metadata block pointed to p h (j h).

ステップS1410において、変数ph−1にpが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)の値を設定し、変数hを1減じた上で、ステップS1402以下の処理を繰り返す。 In step S1410, sets the value of the lower metadata block address of the segment metadata block pointed to p h variable p h-1 (j h), the variable h on minus 1 repeats the steps S1402 following treatment .

ステップS1403に続くステップS1411では、pが指すブロックメタデータブロックの有効エントリ数をj+1に設定し、終了する。 In the subsequent step S1403 Step S1411, the number of valid entries in the block metadata blocks p h points set j h +1, ends.

図12に示すメタデータブロック管理手段106のステップS1205における動作は、図11の手順と同様に実現することができる。   The operation in step S1205 of the metadata block management unit 106 shown in FIG. 12 can be realized in the same manner as the procedure in FIG.

以上説明した書き込み時と切り詰め時のメタデータブロック管理手段106の動作により、ディスク装置108上のファイルに対応するメタデータブロックの木構造を維持することが可能になる。   The operation of the metadata block management means 106 at the time of writing and truncation described above makes it possible to maintain the tree structure of metadata blocks corresponding to files on the disk device 108.

次に、複製元ファイル複製制御手段107および複製先ファイル複製制御手段207の動作について説明する。図15は、この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段及び複製先システムの複製先ファイル複製制御手段の動作を説明するための図である。   Next, operations of the copy source file copy control unit 107 and the copy destination file copy control unit 207 will be described. FIG. 15 is a diagram for explaining the operation of the replication source file replication control means of the replication source system and the replication destination file replication control means of the replication destination system of the file replication system according to Embodiment 1 of the present invention.

この図15は、複製元システム100と複製先システム200の間で行われるファイル複製の手順を概念的に示す。ファイル複製は、図15の右から左に進む形で行われる。太枠で示したものが実際に転送されるデータを現している。初めに、ファイルメタデータが比較され、ファイルが更新されているかどうかを検出する。ファイルメタデータが一致しなかった場合、複数のセグメントメタデータが比較され、どのセグメントが更新されたかを検出する。ここでは、2つのセグメントの内、下側のセグメントにおいてメタデータの不一致があったものとする。次に、不一致セグメントの構成要素間での比較が行われる。ここでは、2つのブロックメタデータが比較され、一番下のブロックで不一致が見付かったものとする。最後に、メタデータ不一致ブロックのデータ本体を複製元から複製先に転送し、複製先のディスク装置208に格納する。   FIG. 15 conceptually shows a file duplication procedure performed between the duplication source system 100 and the duplication destination system 200. File duplication is performed in the form of progressing from right to left in FIG. The data shown in bold lines represent the data that is actually transferred. First, the file metadata is compared to detect whether the file has been updated. If the file metadata does not match, a plurality of segment metadata is compared to detect which segment has been updated. Here, it is assumed that there is a metadata mismatch in the lower segment of the two segments. Next, a comparison is made between the components of the mismatched segment. Here, it is assumed that two block metadata are compared and a mismatch is found in the bottom block. Finally, the data body of the metadata mismatch block is transferred from the copy source to the copy destination and stored in the copy destination disk device 208.

図16は、この発明の実施の形態1に係るファイル複製システムの複製元システム及び複製先システムのメッセージ交換のタイミングを説明するための図である。   FIG. 16 is a diagram for explaining the message exchange timing of the replication source system and the replication destination system of the file replication system according to the first embodiment of the present invention.

この図16は、複製元システム100と複製先システム200の間で行われるメッセージ交換のタイミングを示す。まず、時刻tにおいて、複製先から複製元へファイルメタデータを含むメッセージが送られる。複製元は、これを時刻tに受け取って自身のファイルメタデータと比較しファイルの更新検出を行う。更新が検出された結果、時刻tに複製元から複製先に最上位のセグメントメタデータを含むメッセージが返される。複製先は、時刻tにこれを受け取り、更新セグメントを検出する。時刻tに複製先から複製元へ更新が検出されたセグメントの下位セグメントのメタデータが送信される。複製元は、時刻tにこれを受け取って更新ブロックの検出を行う。時刻tに複製元は更新が検出されたブロックのデータ自体を複製先に向け送信する。複製先は、時刻t以降にブロックデータを受け取ってファイルの複製を更新する。 FIG. 16 shows the timing of message exchange performed between the copy source system 100 and the copy destination system 200. At time t 1, the message is sent that contains the file metadata from the destination to the source. Replication source makes a comparison to update the detection of file received this time t 2 itself with the file metadata. Results update is detected, a message containing the top of the segment metadata to the destination from the copy source at time t 3 is returned. Destination receives this time t 4, detects the update segment. Updated from the destination to copy source at time t 5 the meta data of the lower segment of the segment which is detected is transmitted. Replication source, detects the update blocks received this time t 6. Copy source at time t 7 transmits toward the data itself blocks the update is detected to the destination. The destination is, after time t 8 receives the block data to update a copy of the file.

このように複製元と複製先は、更新の検出結果と下位階層レベルのメタデータ送信を一括して行い、交互に異なる階層レベルを比較することで、更新の検出をどちらか一方で固定的に実施した場合と比べてメッセージ交換の回数を約半分にすることを可能にしている。   In this way, the replication source and replication destination perform update detection results and metadata transmission at lower hierarchical levels in a batch, and alternately detect different hierarchical levels, so that update detection is fixed on either side. Compared to the case where it is implemented, the number of message exchanges can be halved.

図17は、この発明の実施の形態1に係るファイル複製システムの複製先システムの複製先ファイル複製制御手段から複製元システムの複製元ファイル複製制御手段へ送られるファイル複製開始メッセージの構成を示す図である。   FIG. 17 is a diagram showing a configuration of a file replication start message sent from the replication destination file replication control unit of the replication destination system of the file replication system according to Embodiment 1 of the present invention to the replication source file replication control unit of the replication source system. It is.

この図17は、ファイル複製の開始時点で、複製先ファイル複製制御手段207から複製元ファイル複製制御手段107に送付されるファイル複製開始メッセージ17の内容を示す。ファイル複製開始メッセージ17は、メッセージ種別1701、ファイル名文字列長1702、ファイル名文字列1703、ファイル識別子1704、ファイルサイズ1705、およびファイルメタデータ1706からなる。メッセージ種別1701は、受信側に対し、バイト列をどのメッセージとして解釈すべきかを指示する。ファイル名文字列1703は、通常の手段でファイルにアクセスする際に用いる名前であるが、ファイル識別子1704は、整数値など文字列よりも比較が容易な表現を用い、複製先ファイル複製制御手段207と複製元ファイル複製制御手段107の間でファイル複製処理を行っている期間のみ有効な識別子である。ファイル識別子1704は、複数ファイルの複製を並行して行う際に各ファイルを容易に識別するために用いる。ファイル識別子1704としては、ファイル名のハッシュ値、ファイルのiノード番号、などを用いることができる。   FIG. 17 shows the contents of a file replication start message 17 sent from the replication destination file replication control means 207 to the replication source file replication control means 107 at the start of file replication. The file replication start message 17 includes a message type 1701, a file name character string length 1702, a file name character string 1703, a file identifier 1704, a file size 1705, and file metadata 1706. The message type 1701 instructs the receiving side as to which message the byte string should be interpreted. The file name character string 1703 is a name used when accessing the file by a normal means. The file identifier 1704 uses an expression such as an integer value that is easier to compare than the character string. The identifier is valid only during the period when the file duplication process is performed between the duplication source file duplication control means 107. The file identifier 1704 is used to easily identify each file when a plurality of files are duplicated in parallel. As the file identifier 1704, a hash value of a file name, an i-node number of a file, and the like can be used.

図18は、この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段から複製先システムの複製先ファイル複製制御手段へ送られるファイル一致応答メッセージの構成を示す図である。   FIG. 18 is a view showing the structure of a file match response message sent from the replication source file replication control means of the replication source system of the file replication system according to Embodiment 1 of the present invention to the replication destination file replication control means of the replication destination system. It is.

この図18は、ファイル複製開始メッセージに対する応答として複製元ファイル複製制御手段107から複製先ファイル複製制御手段207に送付されるファイル一致応答メッセージ18の内容を示す。ファイル一致応答メッセージ18は、メッセージ種別1801とファイル識別子1802からなる。   FIG. 18 shows the contents of the file match response message 18 sent from the copy source file copy control unit 107 to the copy destination file copy control unit 207 as a response to the file copy start message. The file match response message 18 includes a message type 1801 and a file identifier 1802.

図19は、この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段から複製先システムの複製先ファイル複製制御手段へ送られるファイル削除応答メッセージの構成を示す図である。   FIG. 19 is a diagram showing a structure of a file deletion response message sent from the replication source file replication control unit of the replication source system of the file replication system according to Embodiment 1 of the present invention to the replication destination file replication control unit of the replication destination system. It is.

この図19は、ファイル複製開始メッセージに対する応答として複製元ファイル複製制御手段107から複製先ファイル複製制御手段207に送付されるファイル削除応答メッセージ19の内容を示す。ファイル削除応答メッセージ19は、メッセージ種別1901とファイル識別子1902からなる。   FIG. 19 shows the contents of a file deletion response message 19 sent from the copy source file copy control unit 107 to the copy destination file copy control unit 207 as a response to the file copy start message. The file deletion response message 19 includes a message type 1901 and a file identifier 1902.

図20は、この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段と複製先システムの複製先ファイル複製制御手段の間で相互に送られるセグメントメタデータメッセージの構成を示す図である。   FIG. 20 shows the segment metadata message sent between the replication source file replication control means of the replication source system of the file replication system and the replication destination file replication control means of the replication destination system according to Embodiment 1 of the present invention. It is a figure which shows a structure.

この図20は、複製元ファイル複製制御手段107と複製先ファイル複製制御手段207の間で相互に交わされるセグメントメタデータメッセージ20の内容を示す。セグメントメタデータメッセージ20は、メッセージ種別2001、ファイル識別子2002、ファイルサイズ2003、ファイルサイズ差分2004、階層レベル2005、セグメント数2006と、それに続くセグメント開始オフセット2007、セグメントサイズ2008、セグメントメタデータ2009のセグメント数分の繰り返しからなる。本メッセージの内容は、セグメント/ブロックメタデータブロックに基づいて生成される。   FIG. 20 shows the contents of the segment metadata message 20 exchanged between the copy source file copy control means 107 and the copy destination file copy control means 207. The segment metadata message 20 includes a message type 2001, a file identifier 2002, a file size 2003, a file size difference 2004, a hierarchy level 2005, a number of segments 2006, followed by a segment start offset 2007, a segment size 2008, and a segment metadata 2009 segment. It consists of a few minutes of repetition. The content of this message is generated based on the segment / block metadata block.

図21は、この発明の実施の形態1に係るファイル複製システムの複製先システムの複製先ファイル複製制御手段から複製元システムの複製元ファイル複製制御手段へ送られるブロック転送要求メッセージの構成を示す図である。   FIG. 21 is a diagram showing a configuration of a block transfer request message sent from the copy destination file copy control unit of the copy destination system of the file copy system according to Embodiment 1 of the present invention to the copy source file copy control unit of the copy source system. It is.

この図21は、複製先ファイル複製制御手段207から複製元ファイル複製制御手段107に送付されるブロック転送要求メッセージ21の内容を示す。ブロック転送要求メッセージ21は、メッセージ種別2101、ファイル識別子2102、ファイルサイズ2103、ファイルサイズ差分2104、ブロック数2105と、それに続くブロック開始オフセット2106とブロックサイズ2107のブロック数分の繰り返しからなる。   FIG. 21 shows the contents of the block transfer request message 21 sent from the copy destination file copy control unit 207 to the copy source file copy control unit 107. The block transfer request message 21 includes a message type 2101, a file identifier 2102, a file size 2103, a file size difference 2104, a block number 2105, and subsequent repetitions of the block start offset 2106 and the block size 2107 for the number of blocks.

図22は、この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段から複製先システムの複製先ファイル複製制御手段へ送られるブロック転送メッセージの構成を示す図である。   FIG. 22 is a diagram showing a configuration of a block transfer message sent from the replication source file replication control unit of the replication source system of the file replication system according to Embodiment 1 of the present invention to the replication destination file replication control unit of the replication destination system. is there.

この図22は、複製元ファイル複製制御手段107から複製先ファイル複製制御手段207に送付されるブロック転送メッセージ22の内容を示す。ブロック転送メッセージ22は、メッセージ種別2201、ファイル識別子2202、ファイルサイズ2203、ファイルサイズ差分2204、ブロック数2205と、それに続くブロック開始オフセット2206、ブロックサイズ2207、ブロックデータ2208のブロック数分の繰り返しからなる。   FIG. 22 shows the contents of the block transfer message 22 sent from the copy source file copy control unit 107 to the copy destination file copy control unit 207. The block transfer message 22 includes a message type 2201, a file identifier 2202, a file size 2203, a file size difference 2204, a block number 2205, and a subsequent block start offset 2206, a block size 2207, and block data 2208 corresponding to the number of blocks. .

次に、複製元ファイル複製制御手段107および複製先ファイル複製制御手段207の動作の詳細について説明する。   Next, details of operations of the copy source file copy control unit 107 and the copy destination file copy control unit 207 will be described.

図23は、この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段の動作の概要を示すフローチャートである。   FIG. 23 is a flowchart showing an outline of the operation of the replication source file replication control means of the replication source system of the file replication system according to Embodiment 1 of the present invention.

まず、ステップS2301において、複製先ファイル複製制御手段207からファイル複製開始メッセージ17を受け取るまで待機する。   First, in step S2301, the process waits until the file replication start message 17 is received from the replication destination file replication control means 207.

ステップS2302において、ファイル複製開始メッセージ17を受け取るとファイル名文字列1703に指定されたファイルが複製元システム100に存在するかどうかをチェックする。   In step S2302, when the file duplication start message 17 is received, it is checked whether or not the file specified in the file name character string 1703 exists in the duplication source system 100.

ステップS2303において、ファイルが存在しない場合は、複製先ファイル複製制御手段207にファイル削除応答メッセージ19を送信し、終了する。   If the file does not exist in step S2303, the file deletion response message 19 is transmitted to the copy destination file copy control means 207, and the process ends.

ステップS2304において、ファイルが存在する場合は、ファイル複製開始メッセージ17のファイルサイズ1705とファイル管理情報(iノード)101のファイルサイズ1011、およびファイル複製開始メッセージ17のファイルメタデータ1706とファイル管理情報(iノード)101のファイルメタデータ1012をそれぞれ比較する。   In step S2304, if the file exists, the file size 1705 of the file replication start message 17 and the file size 1011 of the file management information (i-node) 101, and the file metadata 1706 and the file management information ( The file metadata 1012 of the i-node) 101 is compared.

ステップS2305において、ファイルサイズ、ファイルメタデータ共に一致する場合は、複製先ファイル複製制御手段207にファイル一致応答メッセージ18を送信し、終了する。   If both the file size and file metadata match in step S2305, the file match response message 18 is sent to the copy destination file copy control means 207, and the process ends.

ステップS2306において、ファイルサイズまたはファイルメタデータが一致しない場合は、後述する手順により最上位階層レベルのセグメントメタデータメッセージ20を生成し、複製先ファイル複製制御手段207に送信する。   If the file size or file metadata does not match in step S2306, the segment metadata message 20 at the highest hierarchical level is generated according to the procedure described later, and transmitted to the copy destination file copy control means 207.

ステップS2307において、複製先ファイル複製制御手段207からセグメントメタデータメッセージ20またはブロック転送要求メッセージ21を受け取るまで待機する。   In step S2307, the process waits until the segment metadata message 20 or the block transfer request message 21 is received from the copy destination file copy control unit 207.

続いて、ステップS2308において、受信したメッセージのメッセージ種別をチェックし、セグメントメタデータメッセージを表していればステップS2310に進み、ブロック転送要求メッセージを表していればステップS2309に進む。   In step S2308, the message type of the received message is checked. If it represents a segment metadata message, the process proceeds to step S2310. If it represents a block transfer request message, the process proceeds to step S2309.

ステップS2309では、受信したブロック転送要求メッセージ21のブロック開始オフセット2106およびブロックサイズ2107に指定されたブロックのデータ、およびファイルサイズ差分2104が0より大の時はファイル末尾のファイルサイズ差分に相当する領域のデータからなるブロック転送メッセージ22を生成し、複製先ファイル複製制御手段207に送信し、終了する。   In step S2309, the block data specified in the block start offset 2106 and block size 2107 of the received block transfer request message 21 and the area corresponding to the file size difference at the end of the file when the file size difference 2104 is greater than zero. The block transfer message 22 consisting of the above data is generated, transmitted to the copy destination file copy control means 207, and the process ends.

ステップS2308に続くステップS2310では、受信したセグメントメタデータメッセージ20の階層レベル2005をチェックし、0でなければステップS2311に進み、0に等しければステップS2312に進む。   In step S2310 following step S2308, the hierarchical level 2005 of the received segment metadata message 20 is checked. If it is not 0, the process proceeds to step S2311. If it is equal to 0, the process proceeds to step S2312.

ステップS2312においては、受信したセグメントメタデータメッセージ20のセグメント開始オフセット2007、セグメントサイズ2008、セグメントメタデータ2009をディスク装置上のブロックメタデータブロック103と比較し、メタデータが一致しないブロックのデータと、ファイルサイズ差分2104が0より大の時はファイル末尾のファイルサイズ差分に相当する領域のデータからなるブロック転送メッセージ22を生成し、複製先ファイル複製制御手段207に送信し、終了する。   In step S2312, the segment start offset 2007, the segment size 2008, and the segment metadata 2009 of the received segment metadata message 20 are compared with the block metadata block 103 on the disk device. When the file size difference 2104 is greater than 0, the block transfer message 22 composed of the data in the area corresponding to the file size difference at the end of the file is generated, transmitted to the copy destination file copy control unit 207, and the process ends.

ステップS2310に続くステップS2311では、受信したセグメントメタデータメッセージ20のセグメント開始オフセット2007、セグメントサイズ2008、セグメントメタデータ2009をディスク装置上のセグメントメタデータブロック104と比較し、メタデータが一致しないセグメントの下位階層レベルのメタデータブロックのセグメント/ブロックメタデータからなるセグメントメタデータメッセージ20を生成し、複製先ファイル複製制御手段207に送信し、ステップS2307以下の処理を繰り返す。   In step S2311 following step S2310, the segment start offset 2007, the segment size 2008, and the segment metadata 2009 of the received segment metadata message 20 are compared with the segment metadata block 104 on the disk device, and the segment that does not match the metadata is detected. A segment metadata message 20 composed of the segment / block metadata of the metadata block of the lower hierarchy level is generated and transmitted to the duplication destination file duplication control means 207, and the processing of step S2307 and subsequent steps is repeated.

図24は、この発明の実施の形態1に係るファイル複製システムの複製先システムの複製先ファイル複製制御手段の動作の概要を示すフローチャートである。   FIG. 24 is a flowchart showing an outline of the operation of the replication destination file replication control means of the replication destination system of the file replication system according to the first embodiment of the present invention.

まず、ステップS2401において、複製対象のファイルに対してファイル複製開始メッセージ17を生成し、複製元ファイル複製制御手段107に送信する。   First, in step S2401, a file replication start message 17 is generated for the file to be replicated and transmitted to the replication source file replication control means 107.

次に、ステップS2402において、複製元ファイル複製制御手段107からいずれかのメッセージを受信するまで待機する。   In step S2402, the process waits until any message is received from the copy source file copy control unit 107.

ステップS2403において、受信したメッセージのメッセージ種別をチェックし、ファイル一致応答メッセージを表していれば終了し、ファイル削除応答メッセージを表していればステップS2404に進む。   In step S2403, the message type of the received message is checked. If it represents a file match response message, the process ends. If it represents a file deletion response message, the process proceeds to step S2404.

ステップS2404において、当該ファイルを削除した後に終了する。   In step S2404, the process ends after deleting the file.

ステップS2405において、受信したメッセージがセグメントメタデータメッセージ20であれば階層レベル2005を0と比較する。受信したセグメントメタデータメッセージ20の階層レベル2005が0でない場合はステップS2406に進み、0に等しい場合はステップS2407に進む。   In step S2405, if the received message is the segment metadata message 20, the hierarchy level 2005 is compared with 0. If the hierarchical level 2005 of the received segment metadata message 20 is not 0, the process proceeds to step S2406, and if it is equal to 0, the process proceeds to step S2407.

ステップS2406において、受信したセグメントメタデータメッセージ20のセグメント開始オフセット2007、セグメントサイズ2008、セグメントメタデータ2009をディスク装置上のセグメントメタデータブロック204と比較し、メタデータが一致しないセグメントの下位階層レベルのメタデータブロックのセグメント/ブロックメタデータからなるセグメントメタデータメッセージ20を生成し、複製元ファイル複製制御手段107に送信する。   In step S2406, the segment start offset 2007, segment size 2008, and segment metadata 2009 of the received segment metadata message 20 are compared with the segment metadata block 204 on the disk device, and the lower hierarchical level of the segment whose metadata does not match is compared. A segment metadata message 20 composed of the metadata block segment / block metadata is generated and transmitted to the duplication source file duplication control means 107.

一方、ステップS2407では、受信したセグメントメタデータメッセージ20のセグメント開始オフセット2007、セグメントサイズ2008、セグメントメタデータ2009をディスク装置上のブロックメタデータブロック204と比較し、メタデータが一致しないブロックに対するブロック転送要求メッセージ21を生成し、複製元ファイル複製制御手段107に送信する。   On the other hand, in step S2407, the segment start offset 2007, the segment size 2008, and the segment metadata 2009 of the received segment metadata message 20 are compared with the block metadata block 204 on the disk device, and block transfer is performed for a block whose metadata does not match. A request message 21 is generated and transmitted to the copy source file copy control means 107.

ステップS2406およびステップS2407に続くステップS2408では、複製元ファイル複製制御手段107からいずれかのメッセージを受信するまで待機する。   In step S2408 following step S2406 and step S2407, the process waits until any message is received from the copy source file copy control means 107.

ステップS2409において、受信したメッセージのメッセージ種別をチェックし、セグメントメタデータメッセージを表していればステップS2405以下の処理を繰り返す。メッセージ種別がブロック転送メッセージを表していればステップS2410に進む。   In step S2409, the message type of the received message is checked, and if it represents a segment metadata message, the processing from step S2405 is repeated. If the message type represents a block transfer message, the process proceeds to step S2410.

ステップS2410において、受信したブロック転送メッセージ22のファイルサイズ差分2204を0と比較する。ファイルサイズ差分2204が0より小さければステップS2411に進み、そうでなければステップS2412に進む。   In step S2410, the file size difference 2204 of the received block transfer message 22 is compared with zero. If the file size difference 2204 is smaller than 0, the process proceeds to step S2411. Otherwise, the process proceeds to step S2412.

ステップS2411において、受信したブロック転送メッセージ22のファイルサイズ2203に当該ファイルのサイズを切り詰める。   In step S2411, the file size is reduced to the file size 2203 of the received block transfer message 22.

ステップS2412では、受信したブロック転送メッセージ22のブロック開始オフセット2206、ブロックサイズ2207、ブロックデータ2208を用いて、当該ファイルの対応するブロックを更新し、終了する。   In step S2412, the block corresponding to the file is updated using the block start offset 2206, block size 2207, and block data 2208 of the received block transfer message 22, and the process ends.

図25は、この発明の実施の形態1に係るファイル複製システムの複製元ファイル複製制御手段のステップS2306の詳細な動作を示すフローチャートである。   FIG. 25 is a flowchart showing the detailed operation of step S2306 of the copy source file copy control unit of the file copy system according to the first embodiment of the present invention.

まず、ステップS2501において、変数eに複製元のファイル管理情報(iノード)101のファイルサイズ1011と受信したファイル複製開始メッセージ17のファイルサイズ1705の最小値を設定する。変数eは複製元ファイルと複製先ファイルに共通する領域のサイズを表す。   First, in step S2501, the minimum value of the file size 1011 of the file management information (i-node) 101 of the copy source and the file size 1705 of the received file copy start message 17 is set in the variable e. The variable e represents the size of the area common to the replication source file and the replication destination file.

続いて、ステップS2502で、変数pをファイル管理情報(iノード)101のルートメタデータブロックアドレス1013の値に初期化し、変数hをpが指すメタデータブロック(104または103)の階層レベル(1041または1031)の値に初期化する。   In step S2502, the variable p is initialized to the value of the root metadata block address 1013 of the file management information (i-node) 101, and the variable h is set to the hierarchical level (1041) of the metadata block (104 or 103) pointed to by p. Or it is initialized to the value of 1031).

次に、ステップS2503において、変数hを式(1)に基づくH(e)−1と比較し、hの方が大きい場合はステップS2504に進み、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(0)の値をpに設定すると共に、hを新たなpが指すメタデータブロックの階層レベルの値に設定し、ステップS2503に戻る。hがH(e)−1に等しい場合はステップS2505に進む。この時、変数pは複製元ファイルと複製先ファイルの共通領域に対するメタデータブロック木構造の最上位階層レベルのメタデータブロックを指している。   Next, in step S2503, the variable h is compared with H (e) -1 based on the formula (1). If h is larger, the process proceeds to step S2504, and the lower metadata block of the segment metadata block pointed to by p The value of the address (0) is set to p, and h is set to the value of the hierarchical level of the metadata block pointed to by the new p, and the process returns to step S2503. If h is equal to H (e) -1, the process proceeds to step S2505. At this time, the variable p indicates the metadata block at the highest hierarchical level of the metadata block tree structure for the common area of the replication source file and the replication destination file.

次に、ステップS2505において、セグメントメタデータメッセージ20を初期化する。メッセージ種別2001には当該メッセージが「セグメントメタデータメッセージ」であることを表す識別情報を、ファイル識別子2002に受信したファイル複製開始メッセージ17のファイル識別子1704を、ファイルサイズ2003に複製元ファイル管理情報(iノード)101のファイルサイズ1011を、ファイルサイズ差分2004に複製元ファイル管理情報(iノード)101のファイルサイズ1011から受信したファイル複製開始メッセージ17のファイルサイズ1705を引いた値を、階層レベル2005にhを、さらにセグメント数2006に0を、それぞれ設定する。   Next, in step S2505, the segment metadata message 20 is initialized. In the message type 2001, the identification information indicating that the message is a “segment metadata message”, the file identifier 1704 of the received file replication start message 17 in the file identifier 2002, and the source file management information ( A level obtained by subtracting the file size 1011 of the file replication start message 17 received from the file size 1011 of the replication source file management information (i-node) 101 from the file size 1011 of the file size difference 2004 of the file size 1011 of the i-node) 101 Is set to h, and the number of segments 2006 is set to 0.

続く、ステップS2506では、後述する手順により、pが指すメタデータブロックに基づいて開始オフセットを0、サイズをeとするファイルの領域に対するセグメントメタデータのエントリをセグメントメタデータメッセージの末尾に追加する。   In step S2506, an entry of segment metadata for a file area having a start offset of 0 and a size of e based on the metadata block indicated by p is added to the end of the segment metadata message according to a procedure described later.

最後に、ステップS2507において、セグメントメタデータメッセージ20を複製先ファイル複製制御手段207に送信する。   Finally, in step S2507, the segment metadata message 20 is transmitted to the copy destination file copy control unit 207.

図26は、図25のステップS2506及び図28のステップS2809の詳細な動作を示すフローチャートである。   FIG. 26 is a flowchart showing detailed operations in step S2506 in FIG. 25 and step S2809 in FIG.

まず、ステップS2601において、入力パラメータs(ファイル領域の開始オフセット)、g(ファイル領域のサイズ)、p(ファイル領域に対応するメタデータブロックのアドレス)に基づき、変数eをs+g(ファイル領域の直後のオフセット)に、変数hをpが指すメタデータブロックの階層レベルに、変数jを0に、それぞれ設定する。   First, in step S2601, the variable e is set to s + g (immediately after the file area) based on the input parameters s (start offset of the file area), g (size of the file area), p (address of the metadata block corresponding to the file area). Is set to the hierarchical level of the metadata block pointed to by p, and variable j is set to 0.

ステップS2602において、sとeを比較し、sがeより小さければステップS2603に進み、そうでなければ終了する。   In step S2602, s is compared with e. If s is smaller than e, the process proceeds to step S2603, and if not, the process ends.

ステップS2603では、セグメントメタデータメッセージ20にセグメントのエントリを追加する。すなわち、新たなセグメント数Tをセグメント数2006に1を加えた値とし、セグメント数2006にTを、セグメント開始オフセット2007のエントリT−1にsを、セグメントサイズ2008のエントリT−1に式(7)に基づくg(s)を、セグメントメタデータ2009のエントリT−1にpが指すメタデータブロックのセグメント/ブロックメタデータ(j)の値を、それぞれ設定する。 In step S2603, a segment entry is added to the segment metadata message 20. That is, the new segment number T is set to a value obtained by adding 1 to the segment number 2006, T is set to the segment number 2006, s is set to the entry T-1 of the segment start offset 2007, and the expression ( The value of the segment / block metadata (j) of the metadata block pointed to by p is set in the entry T-1 of the segment metadata 2009 for g h (s) based on 7).

続いて、ステップS2604において、sにs+g(s)を設定し、jに1を加えた後に、ステップS2602以下の処理を繰り返す。 Subsequently, in step S2604, s + g h (s) is set in s, 1 is added to j, and the processing in step S2602 and subsequent steps is repeated.

図27は、この発明の実施の形態1に係るファイル複製システムの複製元ファイル複製制御手段のステップS2311及び複製先ファイル複製制御手段のステップS2406の詳細な動作を示すフローチャートである。   FIG. 27 is a flowchart showing detailed operations of step S2311 of the replication source file replication control unit and step S2406 of the replication destination file replication control unit of the file replication system according to Embodiment 1 of the present invention.

まず、ステップS2701において、送信用のセグメントメタデータメッセージ20の初期化を行う。すなわち、メッセージ種別2001には当該メッセージが「セグメントメタデータメッセージ」であることを表す識別情報を、ファイル識別子2002、ファイルサイズ2003、およびファイルサイズ差分2004には受信したセグメントメタデータメッセージの対応する項目を、階層レベル2005に受信したセグメントメタデータメッセージの階層レベルから1を引いた値を、さらにセグメント数2006に0を、それぞれ設定する。   First, in step S2701, the segment metadata message 20 for transmission is initialized. That is, the message type 2001 includes identification information indicating that the message is a “segment metadata message”, and the file identifier 2002, the file size 2003, and the file size difference 2004 correspond to items of the received segment metadata message. Is set to a value obtained by subtracting 1 from the hierarchical level of the segment metadata message received at the hierarchical level 2005, and 0 is further set to the segment number 2006.

ステップS2702では、変数tを0に初期化する。   In step S2702, the variable t is initialized to 0.

続いて、ステップS2703で、tと受信したセグメントメタデータメッセージのセグメント数を比較し、tが小さければステップS2704に進み、そうでなければステップS2706に進んで送信用のセグメントメタデータメッセージ20を相手に送信し、終了する。   Subsequently, in step S2703, t is compared with the number of segments of the received segment metadata message. If t is small, the process proceeds to step S2704. Otherwise, the process proceeds to step S2706, and the segment metadata message 20 for transmission is sent to the other party. Send to and exit.

ステップS2704では、後述する手順により、受信したセグメントメタデータメッセージのセグメント開始オフセット(t)、セグメントサイズ(t)、セグメントメタデータ(t)に基づくメタデータ比較を行い、不一致が検出された場合は下位階層レベルのセグメントメタデータのエントリを送信用のセグメントメタデータメッセージ20に追加する。   In step S2704, a metadata comparison based on the segment start offset (t), the segment size (t), and the segment metadata (t) of the received segment metadata message is performed according to the procedure described later, and a mismatch is detected. The segment metadata entry at the lower hierarchy level is added to the segment metadata message 20 for transmission.

ステップS2705では、tに1を加え、ステップS2703以下の処理を繰り返す。   In step S2705, 1 is added to t, and the processes in and after step S2703 are repeated.

図28は、図27のステップS2704の詳細な動作を示すフローチャートである。   FIG. 28 is a flowchart showing the detailed operation of step S2704 in FIG.

まず、ステップS2801において、入力パラメータs(受信セグメントメタデータメッセージのセグメント開始オフセット(t))、g(受信セグメントメタデータメッセージのセグメントサイズ(t))、M(受信セグメントメタデータメッセージのセグメントメタデータ(t))を受け取る。   First, in step S2801, input parameters s (segment start offset (t) of received segment metadata message), g (segment size (t) of received segment metadata message), M (segment metadata of received segment metadata message). (T)) is received.

ステップS2802において、変数pをファイル管理情報(iノード)のルートメタデータブロックアドレスの値に初期化し、変数hをpが指すメタデータブロックの階層レベルの値に初期化する。   In step S2802, the variable p is initialized to the value of the root metadata block address of the file management information (i-node), and the variable h is initialized to the value of the hierarchical level of the metadata block pointed to by p.

続いて、ステップS2803において、pが指すメタデータブロックにおけるオフセットsに対応するエントリ番号j(s)を変数jに設定する。 Subsequently, in step S2803, the entry number j h (s) corresponding to the offset s in the metadata block pointed to by p is set to the variable j.

ステップS2804では、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)をチェックし、無効値であればステップS2810に進み、そうでない場合はステップS2805に進む。   In step S2804, the lower metadata block address (j) of the segment metadata block pointed to by p is checked. If it is an invalid value, the process proceeds to step S2810, and if not, the process proceeds to step S2805.

ステップS2805では、hを受信セグメントメタデータメッセージの階層レベルと比較し、両者が等しければステップS2807に進み、そうでなければステップS2806に進んで、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)の値をpに、新たなpが指すメタデータブロックの階層レベルをhに、それぞれ設定してステップS2803に戻る。   In step S2805, h is compared with the hierarchical level of the received segment metadata message. If they are equal, the process proceeds to step S2807, otherwise the process proceeds to step S2806, and the lower metadata block address of the segment metadata block pointed to by p is determined. The value of (j) is set to p, the hierarchical level of the metadata block pointed to by the new p is set to h, and the process returns to step S2803.

ステップS2807において、gとg(s)の値、Mとpが指すセグメントメタデータブロックのセグメントメタデータ(j)の値をそれぞれ比較し、全て一致する場合は処理を終了する。少なくとも一方が一致しない場合はステップS2808に進み、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)の値をpに設定する。 In step S2807, the values of g and g h (s) and the segment metadata (j) of the segment metadata block pointed to by M and p are respectively compared, and if all match, the process ends. If at least one does not match, the process advances to step S2808 to set the value of the lower metadata block address (j) of the segment metadata block pointed to by p to p.

続く、ステップS2809では、図27に示した手順により、pが指すメタデータブロックに基づいて開始オフセットをs、サイズをgとするファイル領域に対するセグメントメタデータのエントリを送信用のセグメントメタデータメッセージの末尾に追加し、終了する。   In the next step S2809, according to the procedure shown in FIG. 27, based on the metadata block pointed to by p, the entry of the segment metadata for the file area having the start offset s and the size g is sent to the segment metadata message for transmission. Add to the end and exit.

ステップS2804に続くステップS2810は、ホールに対してセグメントメタデータを比較しようとした場合に実行される。そのため、本ステップにおいてホールに対するメタデータを動的に生成する。すなわち、hの値は受信したセグメントメタデータメッセージの階層レベルに設定し、ホールメタデータのデータ非依存部分をpが指すセグメントメタデータブロックのセグメントメタデータ(j)の値に、チェックサムをサイズg(s)のホール(バイト値0で埋められた領域)に対する値にそれぞれ設定する。 Step S2810 subsequent to step S2804 is executed when segment metadata is to be compared with a hole. Therefore, in this step, metadata for holes is dynamically generated. In other words, the value of h is set to the hierarchical level of the received segment metadata message, the data-independent portion of the hole metadata is set to the value of the segment metadata (j) of the segment metadata block pointed to by p, and the checksum is sized. Set to values for holes of h (s) (area filled with byte value 0).

次に、ステップS2811において、gとg(s)の値、Mとホールメタデータの値をそれぞれ比較し、全て一致する場合は処理を終了する。少なくとも一方が一致しない場合はステップS2812に進み、hを1減じた上で対応するチェックサムの値を再計算する。 Next, in step S2811, the values of g and g h (s) and the values of M and hole metadata are compared, and if all match, the process ends. If at least one does not match, the process proceeds to step S2812, where h is decremented by 1 and the corresponding checksum value is recalculated.

続く、ステップS2813において、後述する手順により階層レベルhとホールメタデータに基づいて開始オフセットをs、サイズをgとするファイル領域に対するセグメントメタデータのエントリを送信用のセグメントメタデータメッセージの末尾に追加し、終了する。   Subsequently, in step S2813, a segment metadata entry for a file area having a start offset s and a size g is added to the end of the segment metadata message for transmission based on the hierarchy level h and hole metadata according to the procedure described later. And exit.

図29は、図28のステップS2813の詳細な動作を示すフローチャートである。   FIG. 29 is a flowchart showing the detailed operation of step S2813 of FIG.

まず、ステップS2901において、入力パラメータs(ファイル領域の開始オフセット)、g(ファイル領域のサイズ)、h(階層レベル)、L(ホールメタデータ)を受け取り、変数eをs+g(ファイル領域の直後のオフセット)に設定する。   First, in step S2901, input parameters s (file area start offset), g (file area size), h (hierarchy level), L (hole metadata) are received, and variable e is set to s + g (immediately after the file area). Set to (Offset).

ステップS2902において、sとeを比較し、sがeより小さければステップS2903に進み、そうでなければ終了する。   In step S2902, s is compared with e. If s is smaller than e, the process proceeds to step S2903, and if not, the process ends.

ステップS2903では、セグメントメタデータメッセージ20にセグメントのエントリを追加する。すなわち、新たなセグメント数Tをセグメント数2006に1を加えた値とし、セグメント数2006にTを、セグメント開始オフセット2007のエントリT−1にsを、セグメントサイズ2008のエントリT−1に式(7)に基づくg(s)を、セグメントメタデータ2009のエントリT−1にホールメタデータLを、それぞれ設定する。 In step S 2903, a segment entry is added to the segment metadata message 20. That is, the new segment number T is set to a value obtained by adding 1 to the segment number 2006, T is set to the segment number 2006, s is set to the entry T-1 of the segment start offset 2007, and the expression ( 7), g h (s) based on 7) is set in the entry metadata T-1 of the segment metadata 2009, respectively.

続いて、ステップS2904において、sにs+g(s)を設定した後に、ステップS2902以下の処理を繰り返す。 Subsequently, in step S2904, after s + g h (s) is set in s, the processes in and after step S2902 are repeated.

図30は、この発明の実施の形態1に係るファイル複製システムの複製先ファイル複製制御手段のステップS2407の詳細な動作を示すフローチャートである。   FIG. 30 is a flowchart showing detailed operations in step S2407 of the copy destination file copy control unit of the file copy system according to the first embodiment of the present invention.

ステップS3001において、ブロック転送要求メッセージ21を初期化する。すなわち、メッセージ種別2101には当該メッセージが「ブロック転送要求メッセージ」であることを表す識別情報を、ファイル識別子2102、ファイルサイズ2103、およびファイルサイズ差分2104には受信したセグメントメタデータメッセージの対応する項目を、ブロック数2105に0を、それぞれ設定する。   In step S3001, the block transfer request message 21 is initialized. That is, the message type 2101 includes identification information indicating that the message is a “block transfer request message”, and the file identifier 2102, the file size 2103, and the file size difference 2104 correspond to items of the received segment metadata message. And 0 is set to the number of blocks 2105, respectively.

ステップS3002では、変数tを0に初期化する。   In step S3002, the variable t is initialized to 0.

続いて、ステップS3003では、tと受信したセグメントメタデータメッセージのセグメント数を比較し、tが小さければステップS3004に進み、そうでなければステップS3006に進んで、ブロック転送要求メッセージ21を複製元ファイル複製制御手段107に送信し、終了する。   In step S3003, t is compared with the number of segments in the received segment metadata message. If t is small, the process proceeds to step S3004. Otherwise, the process proceeds to step S3006, and the block transfer request message 21 is copied to the copy source file. It transmits to the duplication control means 107 and ends.

ステップS3004では、後述する手順により、受信したセグメントメタデータメッセージのセグメント開始オフセット(t)、セグメントサイズ(t)、セグメントメタデータ(t)に基づくメタデータ比較を行い、不一致が検出された場合はブロックのエントリをブロック転送要求メッセージ21に追加する。   In step S3004, a metadata comparison based on the segment start offset (t), segment size (t), and segment metadata (t) of the received segment metadata message is performed according to the procedure described later. The block entry is added to the block transfer request message 21.

ステップS3005では、tに1を加え、ステップS3003以下の処理を繰り返す。   In step S3005, 1 is added to t, and the processing from step S3003 is repeated.

図31は、図30のステップS3004の詳細な動作を示すフローチャートである。   FIG. 31 is a flowchart showing a detailed operation of step S3004 of FIG.

まず、ステップS3101において、入力パラメータs(受信セグメントメタデータメッセージのセグメント開始オフセット(t))、g(受信セグメントメタデータメッセージのセグメントサイズ(t))、M(受信セグメントメタデータメッセージのセグメントメタデータ(t))を受け取る。   First, in step S3101, input parameters s (segment start offset (t) of received segment metadata message), g (segment size (t) of received segment metadata message), M (segment metadata of received segment metadata message). (T)) is received.

ステップS3102において、変数pをファイル管理情報(iノード)のルートメタデータブロックアドレスの値に初期化し、変数hをpが指すメタデータブロックの階層レベルの値に初期化する。   In step S3102, the variable p is initialized to the value of the root metadata block address of the file management information (i-node), and the variable h is initialized to the value of the hierarchical level of the metadata block pointed to by p.

続いて、ステップS3103において、pが指すメタデータブロックにおけるオフセットsに対応するエントリ番号j(s)を変数jに設定する。 Subsequently, in step S3103, the entry number j h (s) corresponding to the offset s in the metadata block pointed to by p is set to the variable j.

ステップS3104では、hを0と比較し、両者が等しければステップS3107に進み、そうでなければステップS3105に進む。   In step S3104, h is compared with 0. If both are equal, the process proceeds to step S3107, and if not, the process proceeds to step S3105.

ステップS3105では、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)をチェックし、無効値であればステップS3108に進み、そうでない場合はステップS3106において、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)の値をpに、新たなpが指すメタデータブロックの階層レベルをhに、それぞれ設定してステップS3103に戻る。   In step S3105, the lower metadata block address (j) of the segment metadata block pointed to by p is checked. If it is an invalid value, the process proceeds to step S3108; otherwise, in step S3106, the segment metadata block pointed to by p The value of the lower metadata block address (j) is set to p, the hierarchical level of the metadata block pointed to by the new p is set to h, and the process returns to step S3103.

ステップS3104に続くステップS3107では、gとg(s)の値、Mとpが指すブロックメタデータブロックのブロックメタデータ(j)の値をそれぞれ比較し、全て一致する場合は処理を終了し、少なくとも一方が一致しない場合はステップS3110に進む。 In step S3107 following step S3104, the values of g and g 0 (s) and the value of block metadata (j) of the block metadata block indicated by M and p are respectively compared, and if all match, the process ends. If at least one does not match, the process proceeds to step S3110.

また、ステップS3105に続くステップS3108は、ホールに対してブロックメタデータを比較しようとした場合に実行される。そのため、本ステップにおいてホールに対するメタデータを動的に生成する。すなわち、ホールメタデータのデータ非依存部分をpが指すセグメントメタデータブロックのセグメントメタデータ(j)の値に、チェックサムをサイズg(s)のホール(バイト値0で埋められた領域)に対する値にそれぞれ設定する。 Step S3108 subsequent to step S3105 is executed when block metadata is to be compared with holes. Therefore, in this step, metadata for holes is dynamically generated. That is, the data metadata-independent portion of hole metadata is the value of segment metadata (j) of the segment metadata block pointed to by p, and the checksum is a hole of size g 0 (s) (an area filled with byte value 0) Set the values for.

次に、ステップS3109において、gとg(s)の値、Mとホールメタデータの値をそれぞれ比較し、全て一致する場合は処理を終了する。少なくとも一方が一致しない場合はステップS3110に進む。 Next, in step S3109, the values of g and g 0 (s) and the values of M and hole metadata are compared, and if all match, the process ends. If at least one does not match, the process proceeds to step S3110.

ステップS3110では、ブロック転送要求メッセージ21にブロックのエントリを追加する。すなわち、新たなブロック数Tをブロック数2105に1を加えた値とし、ブロック数2105にTを、ブロック開始オフセット2106のエントリT−1にsを、ブロックサイズ2107のエントリT−1にg(s)を、それぞれ設定し、終了する。 In step S 3110, a block entry is added to the block transfer request message 21. That is, the new block number T is a value obtained by adding 1 to the block number 2105, T is set to the block number 2105, s is set to the entry T-1 of the block start offset 2106, and g 0 is set to the entry T-1 of the block size 2107. (S) is set, and the process ends.

図32は、この発明の実施の形態1に係るファイル複製システムの複製元ファイル複製制御手段のステップS2312の詳細な動作を示すフローチャートである。   FIG. 32 is a flowchart showing the detailed operation of step S2312 of the replication source file replication control unit of the file replication system according to the first embodiment of the present invention.

ステップS3201において、ブロック転送メッセージ22を初期化する。すなわち、メッセージ種別2201には当該メッセージが「ブロック転送メッセージ」であることを表す識別情報を、ファイル識別子2202、ファイルサイズ2203、およびファイルサイズ差分2204には受信したセグメントメタデータメッセージの対応する項目を、ブロック数2205に0を、それぞれ設定する。   In step S3201, the block transfer message 22 is initialized. That is, the message type 2201 includes identification information indicating that the message is a “block transfer message”, and the file identifier 2202, the file size 2203, and the file size difference 2204 include items corresponding to the received segment metadata message. , 0 is set to the number of blocks 2205, respectively.

ステップS3202では、変数tを0に初期化する。   In step S3202, the variable t is initialized to 0.

続いて、ステップS3203では、tと受信したセグメントメタデータメッセージのセグメント数を比較し、tが小さければステップS3204に進み、そうでなければステップS3206に進む。   In step S3203, t is compared with the number of segments in the received segment metadata message. If t is small, the process proceeds to step S3204. Otherwise, the process proceeds to step S3206.

ステップS3204では、後述する手順により、受信したセグメントメタデータメッセージのセグメント開始オフセット(t)、セグメントサイズ(t)、セグメントメタデータ(t)に基づくメタデータ比較を行い、不一致が検出された場合はブロックデータのエントリをブロック転送メッセージ22に追加する。   In step S3204, metadata comparison based on the segment start offset (t), segment size (t), and segment metadata (t) of the received segment metadata message is performed according to the procedure described later, and if a mismatch is detected. An entry of block data is added to the block transfer message 22.

ステップS3205では、tに1を加え、ステップS3203以下の処理を繰り返す。   In step S3205, 1 is added to t, and the processing from step S3203 is repeated.

ステップS3203に続くステップS3206では、ファイルサイズ差分2204を0と比較し、ファイルサイズ差分が0より大ならばステップS3207に進み、そうでないならばステップS3208に進む。   In step S3206 following step S3203, the file size difference 2204 is compared with 0. If the file size difference is greater than 0, the process proceeds to step S3207; otherwise, the process proceeds to step S3208.

ステップS3207において、ブロック転送メッセージ22にブロックデータのエントリを追加する。すなわち、新たなブロック数Tをブロック数2205に1を加えた値とし、ブロック数2205にTを、ブロック開始オフセット2206のエントリT−1にファイルサイズ2203からファイルサイズ差分2204を引いた値を、ブロックサイズ2207のエントリT−1にファイルサイズ差分2204の値を、ブロックデータ2208のエントリT−1に当該ファイル領域の内容をそれぞれ設定する。   In step S3207, an entry of block data is added to the block transfer message 22. That is, the new block number T is a value obtained by adding 1 to the block number 2205, T is the block number 2205, and the value obtained by subtracting the file size difference 2204 from the file size 2203 to the entry T-1 of the block start offset 2206 is The value of the file size difference 2204 is set in the entry T-1 of the block size 2207, and the contents of the file area are set in the entry T-1 of the block data 2208.

最後に、ステップS3208においてブロック転送メッセージ22を複製先ファイル複製制御手段207に送信する。   Finally, in step S3208, the block transfer message 22 is transmitted to the copy destination file copy control means 207.

図33は、図32のステップS3204の詳細な動作を示すフローチャートである。   FIG. 33 is a flowchart showing detailed operations of step S3204 of FIG.

まず、ステップS3301において、入力パラメータs(受信セグメントメタデータメッセージのセグメント開始オフセット(t))、g(受信セグメントメタデータメッセージのセグメントサイズ(t))、M(受信セグメントメタデータメッセージのセグメントメタデータ(t))を受け取る。   First, in step S3301, input parameters s (segment start offset (t) of received segment metadata message), g (segment size (t) of received segment metadata message), M (segment metadata of received segment metadata message). (T)) is received.

ステップS3302において、変数pをファイル管理情報(iノード)のルートメタデータブロックアドレスの値に初期化し、変数hをpが指すメタデータブロックの階層レベルの値に初期化する。   In step S3302, the variable p is initialized to the value of the root metadata block address of the file management information (i-node), and the variable h is initialized to the value of the hierarchical level of the metadata block pointed to by p.

続いて、ステップS3303において、pが指すメタデータブロックにおけるオフセットsに対応するエントリ番号j(s)を変数jに設定する。 Subsequently, in step S3303, the entry number j h (s) corresponding to the offset s in the metadata block pointed to by p is set to the variable j.

ステップS3304では、hを0と比較し、両者が等しければステップS3307に進み、そうでなければステップS3305に進む。   In step S3304, h is compared with 0. If they are equal, the process proceeds to step S3307, and if not, the process proceeds to step S3305.

ステップS3305では、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)をチェックし、無効値であればステップS3308に進み、そうでない場合はステップS3306において、pが指すセグメントメタデータブロックの下位メタデータブロックアドレス(j)の値をpに、新たなpが指すメタデータブロックの階層レベルをhに、それぞれ設定してステップS3303に戻る。 In step S3305, the lower metadata block address (j h ) of the segment metadata block pointed to by p is checked, and if it is an invalid value, the process proceeds to step S3308. Otherwise, the segment metadata block pointed to by p in step S3306 The value of the lower metadata block address (j) is set to p, the hierarchical level of the metadata block pointed to by the new p is set to h, and the process returns to step S3303.

ステップS3304に続くステップS3307では、gとg(s)の値、Mとpが指すブロックメタデータブロックのブロックメタデータ(j)の値をそれぞれ比較し、全て一致する場合は処理を終了し、少なくとも一方が一致しない場合はステップS3310に進む。 In step S3307 following step S3304, the values of g and g 0 (s) and the value of block metadata (j) of the block metadata block indicated by M and p are respectively compared, and if all match, the process ends. If at least one does not match, the process proceeds to step S3310.

また、ステップS3305に続くステップS3308では、ホールに対するメタデータを動的に生成する。すなわち、ホールメタデータのデータ非依存部分をpが指すセグメントメタデータブロックのセグメントメタデータ(j)の値に、チェックサムをサイズg(s)のホール(バイト値0で埋められた領域)に対する値にそれぞれ設定する。 In step S3308 following step S3305, metadata for the hole is dynamically generated. That is, the data metadata-independent portion of hole metadata is the value of segment metadata (j) of the segment metadata block pointed to by p, and the checksum is a hole of size g 0 (s) (an area filled with byte value 0) Set the values for.

続いて、ステップS3309において、gとg(s)の値、Mとホールメタデータの値をそれぞれ比較し、全て一致する場合は処理を終了する。少なくとも一方が一致しない場合はステップS3310に進む。 Subsequently, in step S3309, the values of g and g 0 (s) and the values of M and hole metadata are compared, and if all match, the process ends. If at least one does not match, the process proceeds to step S3310.

ステップS3310では、ブロック転送メッセージ22にブロックデータのエントリを追加する。すなわち、新たなブロック数Tをブロック数2205に1を加えた値とし、ブロック数2205にTを、ブロック開始オフセット2206のエントリT−1にsを、ブロックサイズ2207のエントリT−1にg(s)を、ブロックデータ2208のエントリT−1に当該ファイルデータブロックの内容をそれぞれ設定し、終了する。 In step S3310, an entry of block data is added to the block transfer message 22. That is, the new block number T is set to a value obtained by adding 1 to the block number 2205, T is set to the block number 2205, s is set to the entry T-1 of the block start offset 2206, and g 0 is set to the entry T-1 of the block size 2207. In step (s), the contents of the file data block are set in the entry T-1 of the block data 2208, and the process ends.

以上のように、ファイル更新に伴ってファイルシステム管理手段105、205から呼び出され、ブロック毎の更新の有無を判定するためのメタデータを格納するブロックを木構造状に維持するメタデータブロック管理手段106、206を備えるので、ファイル複製の際に更新されていないブロックを読み出すことなく更新ブロックを検出することができ、高速なファイル複製を実現することができる。   As described above, the metadata block management unit that is called from the file system management unit 105 or 205 along with the file update and maintains the block for storing the metadata for determining whether or not there is an update for each block in a tree structure. 106 and 206, it is possible to detect an updated block without reading a block that has not been updated at the time of file duplication, and to realize high-speed file duplication.

また、メタデータブロックの格納先としてデータと同じ領域を用いるので追加の記憶領域を必要としない。また、メタデータの木構造を互いに比較する複製元ファイル複製制御手段107および複製先ファイル複製制御手段207を備えるので、更新されていないブロックに関する比較を避けることができる。また、複製元と複製先でメタデータ木構造の異なる階層を交互に比較するので、一方でのみ比較を行う場合に比べてメッセージ交換の回数を半数にすることができる。また、メタデータブロック管理手段106、206は、ファイルにホールが存在することを許すので、消費するメタデータブロック領域やメタデータブロックの更新に要する時間を最小限に止めることができる。また、チェックサム木の下位階層レベルから上位階層レベルのチェックサムを計算するので、ファイルへの書き込みの際にファイルデータブロックを読み出すことなく上位のチェックサムを更新することができる。   Further, since the same area as the data is used as the storage location of the metadata block, no additional storage area is required. In addition, since the copy source file copy control unit 107 and the copy destination file copy control unit 207 that compare the tree structures of the metadata with each other are provided, it is possible to avoid comparison regarding blocks that have not been updated. In addition, since the layers having different metadata tree structures are alternately compared between the copy source and the copy destination, the number of message exchanges can be halved compared to the case where only one is compared. Further, since the metadata block management means 106 and 206 allow a hole to exist in the file, the time required for updating the consumed metadata block area and metadata block can be minimized. In addition, since the checksum of the upper hierarchy level is calculated from the lower hierarchy level of the checksum tree, the upper checksum can be updated without reading the file data block when writing to the file.

実施の形態2.
この発明の実施の形態2に係るファイル複製システムについて図34及び図35を参照しながら説明する。図34は、この発明の実施の形態2に係るファイル複製システムの構成を示す図である。
Embodiment 2. FIG.
A file replication system according to Embodiment 2 of the present invention will be described with reference to FIGS. FIG. 34 is a diagram showing a configuration of a file replication system according to Embodiment 2 of the present invention.

図34において、この実施の形態2に係るファイル複製システムは、複製元システムまたは複製先システム100Aを設け、複製元として動作する際は複製元ファイル複製制御手段107Aが、複製先として動作する時は複製先ファイル複製制御手段207Aが動作する。   In FIG. 34, the file replication system according to the second embodiment is provided with a replication source system or replication destination system 100A, and when operating as a replication source, the replication source file replication control means 107A operates as a replication destination. The copy destination file copy control unit 207A operates.

ディスク装置108Aおよびディスク装置108Bは、独立なディスク装置であり、ディスク装置108Aには、ファイル毎にファイル管理情報(iノード)101Aが格納され、ファイルの内容は複数のファイルデータブロック102A〜Dに格納される。ディスク装置108Bには、ファイル毎にファイルメタデータ管理情報101Bが格納され、ファイルのブロック毎のメタデータを階層的に構成するブロックメタデータブロック103A〜Bとセグメントメタデータブロック104Aが格納される。ファイルデータブロック102A〜D、ブロックメタデータブロック103A〜B、セグメントメタデータブロック104Aは、上記の実施の形態1で図1に示したものと同一である。なお、ディスク装置108Aおよびディスク装置108Bは、論理的に独立であれば良く、物理的に同一のディスク装置を分割した別パーティションに対応していても良い。   The disk device 108A and the disk device 108B are independent disk devices, and file management information (i-node) 101A is stored for each file in the disk device 108A, and the contents of the file are stored in a plurality of file data blocks 102A to 102D. Stored. The disk device 108B stores file metadata management information 101B for each file, and stores block metadata blocks 103A to 103B and a segment metadata block 104A that hierarchically configure metadata for each block of the file. The file data blocks 102A to 102D, block metadata blocks 103A to 103B, and segment metadata block 104A are the same as those shown in FIG. 1 in the first embodiment. The disk device 108A and the disk device 108B may be logically independent, and may correspond to different partitions obtained by dividing the physically same disk device.

ディスク装置108Aのファイル管理情報(iノード)101Aとファイルデータブロック102A〜Dは、ファイルシステム管理手段105Aにより格納・割当・解放される。ファイル管理情報(iノード)101Aおよびファイルシステム管理手段105Aは、公知のファイルシステムにおけるデータ構造および制御ソフトウェアに対応し、メタデータブロックについては関知しない点が上記の実施の形態1と異なる。   The file management information (i-node) 101A and the file data blocks 102A to 102D of the disk device 108A are stored / allocated / released by the file system management means 105A. The file management information (i-node) 101A and the file system management means 105A correspond to the data structure and control software in a known file system, and differ from the first embodiment in that they do not know about metadata blocks.

ディスク装置108Bのファイルメタデータ管理情報101B、ブロックメタデータブロック103A〜B、およびセグメントメタデータブロック104Aは、メタデータブロック管理手段106Aにより格納・割当・解放される。また、メタデータブロック管理手段106Aは、ディスクI/O要求を受け取り、当該要求をファイルシステム管理手段105Aに受け渡すと共に、ファイルへの書き込みや切り詰めが要求された場合には上記の実施の形態1におけるメタデータブロック管理手段106と同様にメタデータブロック木構造の更新を行う。   The file metadata management information 101B, the block metadata blocks 103A to 103B, and the segment metadata block 104A of the disk device 108B are stored / allocated / released by the metadata block management means 106A. Further, the metadata block management unit 106A receives the disk I / O request, transfers the request to the file system management unit 105A, and when writing to a file or truncation is requested, the first embodiment described above. The metadata block tree structure is updated in the same manner as the metadata block management means 106 in FIG.

複製元ファイル複製制御手段107Aおよび複製先ファイル複製制御手段207Aは、それぞれ上記の実施の形態1の複製元ファイル複製制御手段107および複製先ファイル複製制御手段207に対応するが、メタデータブロック木構造とファイルデータブロックが異なるディスク装置上に存在することを前提として動作する点が異なる。   The replication source file replication control unit 107A and the replication destination file replication control unit 207A correspond to the replication source file replication control unit 107 and the replication destination file replication control unit 207 of the first embodiment, respectively, but have a metadata block tree structure. And the file data block operate on the premise that they exist on different disk devices.

図35は、この発明の実施の形態2に係るファイル複製システムのディスク装置内のファイルメタデータ管理情報の構成を示す図である。   FIG. 35 is a diagram showing a structure of file metadata management information in the disk device of the file replication system according to the second embodiment of the present invention.

ファイルメタデータ管理情報101Bは、メタデータブロック管理手段106Aによりディスク装置108Bに格納される。ファイルメタデータ管理情報101Bは、ファイルサイズ1011、ファイルメタデータ(ファイルに対する更新を検出可能な、最終更新日時、世代番号、チェックサムなどの情報)1012、およびメタデータブロック木構造の根を指すルートメタデータブロックアドレス1013からなる。上記実施の形態1でファイル管理情報(iノード)101に含まれていた情報を取り出した形になっている。   The file metadata management information 101B is stored in the disk device 108B by the metadata block management means 106A. The file metadata management information 101B includes a file size 1011, file metadata (information such as last update date / time, generation number, checksum, etc. that can detect an update to the file) 1012 and a root indicating the root of the metadata block tree structure. It consists of a metadata block address 1013. In the first embodiment, the information included in the file management information (i-node) 101 is extracted.

メタデータブロック管理手段106Aは、上記の実施の形態1におけるメタデータブロック管理手段106と異なり、ファイル管理情報(iノード)101Aではなくファイルメタデータ管理情報101Bを参照して動作する。また、ディスク装置108Bの記憶領域の割当・解放を行うと共に、I/O要求をファイルシステム管理手段105Aに受け渡す点が上記の実施の形態1と異なる。   Unlike the metadata block management unit 106 in the first embodiment, the metadata block management unit 106A operates by referring to the file metadata management information 101B instead of the file management information (i-node) 101A. Further, the storage area of the disk device 108B is allocated / released and the I / O request is transferred to the file system management means 105A, which is different from the first embodiment.

以上のように、ファイルのブロック毎の更新検出を行うためのメタデータブロック木構造の情報をファイル本体とは異なるディスク装置108Bに格納すると共に、公知のファイルシステムの上位にメタデータブロック管理手段106Aを設けたので、公知のファイルシステムに影響を及ぼすことなくファイル複製の高速化を実現することが可能になる。   As described above, the metadata block tree structure information for performing update detection for each block of the file is stored in the disk device 108B different from the file body, and the metadata block management means 106A is placed above the known file system. Therefore, it is possible to realize high-speed file duplication without affecting a known file system.

実施の形態3.
この発明の実施の形態3に係るファイル複製システムについて図36を参照しながら説明する。図36は、この発明の実施の形態3に係るファイル複製システムのディスク装置に格納されるファイルデータおよびメタデータの構成を示す図である。その他の構成は、上記の実施の形態2と同様とする。
Embodiment 3 FIG.
A file replication system according to Embodiment 3 of the present invention will be described with reference to FIG. FIG. 36 shows the structure of file data and metadata stored in the disk device of the file replication system according to Embodiment 3 of the present invention. Other configurations are the same as those in the second embodiment.

図36において、ファイル本体1020は、上記の実施の形態2と同様である。階層レベル0のブロックメタデータファイル1030は、上記の実施の形態2におけるブロックメタデータブロックのブロックメタデータ1033を、対応するブロックのオフセット順に全て格納したファイルである。階層レベル1のセグメントメタデータファイル1040および階層レベル2のセグメントメタデータファイル1050は、同様にそれぞれ階層レベル1のセグメントメタデータブロック(図2の104B〜Cなど)のメタデータおよび階層レベル2のセグメントメタデータブロック(図2の104Aなど)のメタデータをオフセット順に全て格納したファイルである。また、ファイルメタデータファイル1060は、ファイルメタデータを格納し、上記の実施の形態2のファイルメタデータ管理情報101Bに対応する。   In FIG. 36, a file body 1020 is the same as that in the second embodiment. The block metadata file 1030 at the hierarchical level 0 is a file that stores all the block metadata 1033 of the block metadata block in the second embodiment in the order of the offset of the corresponding block. Similarly, the hierarchy level 1 segment metadata file 1040 and the hierarchy level 2 segment metadata file 1050 are respectively the metadata of the hierarchy level 1 segment metadata block (104B to 104C in FIG. 2) and the hierarchy level 2 segment. This is a file that stores all metadata of a metadata block (104A in FIG. 2, etc.) in the order of offset. The file metadata file 1060 stores file metadata and corresponds to the file metadata management information 101B of the second embodiment.

メタデータファイル(1030、1040、1050)のメタデータエントリには論理オフセットによりランダムアクセス可能なので、階層レベル間をつなぐブロックアドレス(図5の1044)は不要である。また、メタデータファイルのサイズからメタデータエントリの数も判明するため有効エントリ数(図4の1032や図5の1042)も含まない。   Since the metadata entry of the metadata file (1030, 1040, 1050) can be randomly accessed by the logical offset, the block address (1044 in FIG. 5) that connects the hierarchical levels is not necessary. Further, since the number of metadata entries is also known from the size of the metadata file, the number of valid entries (1032 in FIG. 4 and 1042 in FIG. 5) is not included.

ファイル本体1020とメタデータファイル(1030、1040、1050、1060)は、上記の実施の形態2のように異なるディスク装置に格納するか、上記の実施の形態1のように同じディスク装置に格納する。同じディスク装置に格納する場合は両者の識別や対応付けが容易なように、メタデータファイルに特殊なファイル名を用いる。例えばファイル本体の名前が/foo/barの時、各メタデータファイルを/.meta/level0/foo/bar、/.meta/level1/foo/bar、/.meta/level2/foo/barなどとする。あるいは、ファイルを識別する番号、例えばext3などのファイルシステムにおけるiノード番号を用いて、/.meta/level0/‘iノード番号’としても良い。   The file main body 1020 and the metadata file (1030, 1040, 1050, 1060) are stored in different disk devices as in the second embodiment or stored in the same disk device as in the first embodiment. . When storing in the same disk device, a special file name is used for the metadata file so that both can be easily identified and associated. For example, when the name of the file body is / foo / bar, each metadata file is changed to /. meta / level0 / foo / bar, /. meta / level1 / foo / bar, /. meta / level2 / foo / bar. Alternatively, by using a number for identifying a file, for example, an i-node number in a file system such as ext3,. meta / level 0 / 'inode number' may be used.

以上のように、ファイルのブロック毎の更新検出を行うためのメタデータブロック木構造の情報をファイルとしてディスク装置に格納するので、ディスク装置の記憶領域管理に公知のファイルシステムを利用することが可能になり、容易に高速なファイル複製システムを実現することができる。   As described above, the metadata block tree structure information for performing update detection for each block of the file is stored in the disk device as a file, so that a known file system can be used for storage area management of the disk device. Thus, a high-speed file replication system can be easily realized.

実施の形態4.
この発明の実施の形態4に係るファイル複製システムについて図37を参照しながら説明する。図37は、この発明の実施の形態4に係るファイル複製システムの構成を示す図である。
Embodiment 4 FIG.
A file replication system according to Embodiment 4 of the present invention will be described with reference to FIG. FIG. 37 is a diagram showing a configuration of a file replication system according to Embodiment 4 of the present invention.

図37において、この実施の形態4に係るファイル複製システムは、複製元システム(コンピュータ)または複製先システム(コンピュータ)100Bと、ディスク装置108Aと、ファイル複製補助装置100Cとが設けられている。   In FIG. 37, the file replication system according to the fourth embodiment includes a replication source system (computer) or a replication destination system (computer) 100B, a disk device 108A, and a file replication auxiliary device 100C.

複製元として動作する際は複製元ファイル複製制御手段107Bが、複製先として動作する時は複製先ファイル複製制御手段207Bが動作する。   When operating as a replication source, the replication source file replication control means 107B operates, and when operating as a replication destination, the replication destination file replication control means 207B operates.

ディスク装置108Aは、複製元コンピュータまたは複製先コンピュータ100BとディスクI/Fバス1080を介して接続されており、上記の実施の形態2におけるファイル管理情報(iノード)101Aやファイルデータブロック102が格納される。ディスクI/Fバス1080は、例えばSCSIなど複数の装置を接続可能なものとする。ディスクI/Fバス1080には、さらにファイル複製補助装置100Cが接続される。   The disk device 108A is connected to the copy source computer or the copy destination computer 100B via the disk I / F bus 1080, and stores the file management information (i-node) 101A and the file data block 102 in the second embodiment. Is done. The disk I / F bus 1080 can be connected to a plurality of devices such as SCSI. A file duplication auxiliary device 100C is further connected to the disk I / F bus 1080.

ファイル複製補助装置100Cは、ディスク装置108Bと、メタデータブロック管理手段106B、ディスクI/Fバス監視手段106C、及びメタデータブロック読出手段106Dからなる。ディスク装置108Bには、上記の実施の形態2と同様、ファイルメタデータ管理情報101B、セグメントメタデータブロック104A、およびブロックメタデータブロック103A〜Bが格納される。   The file duplication auxiliary device 100C includes a disk device 108B, metadata block management means 106B, disk I / F bus monitoring means 106C, and metadata block reading means 106D. The disk device 108B stores file metadata management information 101B, segment metadata block 104A, and block metadata blocks 103A-B as in the second embodiment.

ディスクI/Fバス監視手段106Cは、ディスクI/Fバス上を複製元コンピュータまたは複製先コンピュータ100Bからディスク装置108Aに対して送付されるコマンドを監視し、書き込みコマンドを検出するとそのブロックアドレスや内容をメタデータブロック管理手段106Bに通知する。メタデータブロック管理手段106Bは、ディスク装置108A全体を1つのファイルとみなし、ブロックアドレスをファイルオフセットとみなして単一のメタデータブロック木構造を維持する。ディスクI/Fバス1080上にさらに別のディスク装置が接続されている場合は、ディスク装置毎にメタデータブロック木構造を作成する。   The disk I / F bus monitoring means 106C monitors the command sent from the copy source computer or the copy destination computer 100B to the disk device 108A on the disk I / F bus, and when a write command is detected, its block address and contents Is sent to the metadata block management means 106B. The metadata block management means 106B regards the entire disk device 108A as one file, regards the block address as a file offset, and maintains a single metadata block tree structure. When another disk device is connected on the disk I / F bus 1080, a metadata block tree structure is created for each disk device.

ディスク装置108B上のメタデータブロックは、メタデータブロック読出手段106Dを介して複製元コンピュータまたは複製先コンピュータ100Bから読み出すことができ、複製元ファイル複製制御手段107Bや複製先ファイル複製制御手段207Bはメタデータをファイル複製補助装置100Cのメタデータブロック読出手段106Dから、ファイルデータブロックをディスク装置108Aから読み出して更新検出・データ転送を行う。   The metadata block on the disk device 108B can be read from the copy source computer or the copy destination computer 100B via the metadata block reading means 106D. The copy source file copy control means 107B and the copy destination file copy control means 207B Data is read from the metadata block reading means 106D of the file duplication assisting device 100C and the file data block is read from the disk device 108A to perform update detection and data transfer.

以上のように、ディスクI/Fバス1080を監視し、書き込みを自動的に検出してディスク装置毎のメタデータブロック木構造を更新するファイル複製補助装置100Cを用いるので、従来のファイルシステムやディスクI/Oに変更を加えることなく高速なファイル複製を実現することができる。   As described above, since the file duplication auxiliary device 100C that monitors the disk I / F bus 1080 and automatically detects writing and updates the metadata block tree structure for each disk device is used, a conventional file system or disk is used. High-speed file replication can be realized without changing the I / O.

実施の形態5.
この発明の実施の形態5に係るファイル複製システムについて図38及び図39を参照しながら説明する。図38は、この発明の実施の形態5に係るファイル複製システムのメタデータブロック管理手段の構成を示す図である。その他の構成は、上記の実施の形態2と同様とする。
Embodiment 5 FIG.
A file replication system according to Embodiment 5 of the present invention will be described with reference to FIGS. 38 and 39. FIG. FIG. 38 is a diagram showing the configuration of the metadata block management means of the file replication system according to Embodiment 5 of the present invention. Other configurations are the same as those in the second embodiment.

図38において、I/O要求受付手段1060は、受け付けたディスクI/O要求をファイルシステム管理手段105Aに渡すと共に、当該要求がファイルへの書きこみまたはファイルの切り詰めを指示している場合はファイル更新ログ追加手段1061を起動する。ファイル更新ログ追加手段1061は、ディスク装置上のファイル更新ログ情報に当該I/O要求に基づく情報を追加する。ファイル更新ログマージ手段1063は、ディスクI/Oとは独立に動作し、ファイル更新ログ情報1062中の同一ファイル・同一ブロックに対する更新情報をまとめ、最終的に効果を持つエントリのみを残す。ファイル更新ログ反映手段1064は、ファイル更新ログマージ手段1063の出力に従い、メタデータブロック木構造の更新を行う。   In FIG. 38, the I / O request accepting means 1060 passes the accepted disk I / O request to the file system management means 105A, and if the request indicates writing to the file or truncating the file, The update log adding means 1061 is activated. The file update log adding means 1061 adds information based on the I / O request to the file update log information on the disk device. The file update log merging unit 1063 operates independently of the disk I / O, collects update information for the same file and the same block in the file update log information 1062, and leaves only entries that have an effect finally. The file update log reflection unit 1064 updates the metadata block tree structure according to the output of the file update log merge unit 1063.

図39は、この発明の実施の形態5に係るファイル複製システムのメタデータブロック管理手段のファイル更新ログ情報の構成を示す図である。   FIG. 39 is a diagram showing a structure of file update log information of the metadata block management means of the file replication system according to Embodiment 5 of the present invention.

図39において、ファイル更新ログ情報1062は、タイムスタンプ10621、操作種別10622、ファイル識別子10623、開始オフセット10624、サイズ10625、及び世代番号10626からなる。タイムスタンプ10621は、ファイル識別子10623、開始オフセット10624で指定されるブロックに対する複数回の操作を順序付け、最終的に効果を持つものを残すためにファイル更新ログマージ手段1063により使用されると共に、当該ブロックに対する最終更新日時として直接メタデータに反映される。ブロックのチェックサムは、開始オフセット10624で指定されるファイルデータブロックを読み込むことで算出される。また、操作種別10622は、書き込みと切り詰めを識別するための情報を含む。   39, the file update log information 1062 includes a time stamp 10621, an operation type 10622, a file identifier 10623, a start offset 10624, a size 10625, and a generation number 10626. The time stamp 10621 is used by the file update log merging unit 1063 to order a plurality of operations on the block specified by the file identifier 10623 and the start offset 10624 and leave the final effect. It is directly reflected in the metadata as the last update date. The checksum of the block is calculated by reading the file data block specified by the start offset 10624. The operation type 10622 includes information for identifying writing and truncation.

ファイル更新ログマージ手段1063を実行するタイミングとしては、一定時間毎、一定数のファイル更新ログ情報1062を書き込んだ時、または、複製元ファイル複製制御手段107Aや複製先ファイル複製制御手段207Aが動作する前、などを用いることができる。   The timing of executing the file update log merging unit 1063 is when a certain number of file update log information 1062 is written at regular time intervals, or before the replication source file replication control unit 107A and the replication destination file replication control unit 207A operate. , Etc. can be used.

以上のようにファイル更新やファイル切り詰めの際に操作の概要のみを記録するファイル更新ログ追加手段1061と、同一ファイル・同一ブロックに対する複数の操作を1つにまとめるファイル更新ログマージ手段1063を備えるので、通常のI/O操作に対するオーバヘッドを軽減し、頻繁にアクセスされるファイルに対するスループットを向上することができる。   As described above, since the file update log adding means 1061 for recording only the outline of the operation at the time of file update or file truncation and the file update log merging means 1063 for integrating a plurality of operations for the same file and the same block are provided. The overhead for normal I / O operations can be reduced and the throughput for frequently accessed files can be improved.

なお、更新検出のためのメタデータとしてチェックサムのみを用いる場合は、ファイルのブロック毎に設けた更新フラグをファイル書き込みの際にセットし、一定時間毎あるいは複製元ファイル複製制御手段107Aや複製先ファイル複製制御手段207Aが動作する前にファイルの更新フラグを走査し、更新フラグがセットされているブロックについてチェックサムを更新するという実現方式を取っても良い。   When only the checksum is used as the metadata for detecting the update, an update flag provided for each block of the file is set at the time of writing the file, and the copy source file copy control unit 107A or the copy destination is set at regular intervals. An implementation method may be adopted in which the file update flag is scanned before the file copy control unit 207A operates, and the checksum is updated for the block for which the update flag is set.

実施の形態6.
この発明の実施の形態6に係るファイル複製システムについて図40を参照しながら説明する。図40は、この発明の実施の形態6に係るファイル複製システムのセグメント/ブロックメタデータブロックの構成を示す図である。その他の構成は、上記の実施の形態1や実施の形態2と同様とする。
Embodiment 6 FIG.
A file replication system according to Embodiment 6 of the present invention will be described with reference to FIG. FIG. 40 is a diagram showing the structure of the segment / block metadata block of the file replication system according to Embodiment 6 of the present invention. Other configurations are the same as those in the first and second embodiments.

図40において、階層レベル2のセグメントメタデータブロック104Aや階層レベル1のセグメントメタデータブロック104Cは、最終エントリを除いて下位メタデータブロックアドレスが有効になっておらず、各エントリに対応するセグメントに関するメタデータのみを保持する。   In FIG. 40, the segment metadata block 104A at the hierarchy level 2 and the segment metadata block 104C at the hierarchy level 1 are not valid for the lower metadata block address except for the last entry, and are related to the segment corresponding to each entry. Keep only metadata.

メタデータブロック管理手段106や106Aは、セグメントメタデータブロック104に新たなエントリを追加する際に、最終エントリ以外の下位メタデータブロックを再帰的に解放し、下位メタデータブロックアドレスの当該エントリに無効値を設定する。複製元ファイル複製制御手段107(または107A)や複製先ファイル複製制御手段207(または207A)は、下位メタデータブロックアドレスが無効なセグメントの更新を検出した際は、セグメント全体をデータ転送の対象とする。   When adding a new entry to the segment metadata block 104, the metadata block management means 106 or 106A recursively releases lower metadata blocks other than the last entry, and invalidates the entry at the lower metadata block address. Set the value. When the duplication source file duplication control unit 107 (or 107A) or the duplication destination file duplication control unit 207 (or 207A) detects an update of a segment with an invalid lower-level metadata block address, the entire segment is subject to data transfer. To do.

以上のように、ファイルの末尾に近いセグメントメタデータブロックのみを割り当てることで、追加書き込みが主体の大規模なファイルが作成される状況において、ほとんど更新されないメタデータブロックの割り当てを避けることができ、メタデータブロックが消費するディスク装置の記憶領域を削減することができる。   As described above, by assigning only segment metadata blocks close to the end of the file, it is possible to avoid assigning metadata blocks that are rarely updated in a situation where a large file mainly created by additional writing is created. The storage area of the disk device consumed by the metadata block can be reduced.

実施の形態7.
この発明の実施の形態7に係るファイル複製システムについて図41を参照しながら説明する。図41は、この発明の実施の形態7に係るファイル複製システムのディスク装置に格納される情報を示す図である。
Embodiment 7 FIG.
A file replication system according to Embodiment 7 of the present invention will be described with reference to FIG. FIG. 41 is a diagram showing information stored in the disk device of the file replication system according to Embodiment 7 of the present invention.

この図41は、上記の実施の形態1に追加して、ディスク装置108に格納される情報を示す。図41において、ファイルシステムスーパーブロック901は、ディスク装置108上に作成されたファイルシステムに関する管理情報を保持しており、ファイルシステム管理手段105により管理される。   FIG. 41 shows information stored in the disk device 108 in addition to the first embodiment. In FIG. 41, a file system super block 901 holds management information related to the file system created on the disk device 108 and is managed by the file system management means 105.

各ファイルに対応するiノード(ファイル管理情報)902A〜Gは、それぞれ固有のiノード番号を付与され、ファイルシステムスーパーブロック901から全てのiノード902にアクセス可能となっている。ファイルメタデータブロック903A〜Dは、ブロックメタデータブロック103と同様に、複数のファイルに関するファイルメタデータ1013を格納する固定長ブロックであり、ファイル群メタデータブロック904A〜Cは、iノード番号に基づいて複数ファイルにまたがるメタデータを階層的に格納する固定長ブロックである。ファイルメタデータブロック903とファイル群メタデータブロック904は木構造を構成し、ルートとなる単一のファイル群メタデータブロック904Aのブロックアドレスはファイルシステムスーパーブロック901に格納される。   Each i-node (file management information) 902A to 902G corresponding to each file is assigned a unique i-node number, and all i-nodes 902 can be accessed from the file system super block 901. Similarly to the block metadata block 103, the file metadata blocks 903A to 903D are fixed-length blocks that store file metadata 1013 regarding a plurality of files, and the file group metadata blocks 904A to 904C are based on the i-node number. This is a fixed-length block that hierarchically stores metadata that spans multiple files. The file metadata block 903 and the file group metadata block 904 form a tree structure, and the block address of a single file group metadata block 904A serving as a root is stored in the file system super block 901.

メタデータブロック管理手段106は、ファイルを更新し、ブロック毎のメタデータブロック木構造の更新を行った後で、当該ファイルのiノード番号に基づいてファイル群メタデータブロック904の木構造をルートメタデータブロック904Aから辿り、ファイル群メタデータブロック904およびファイルメタデータブロック903のメタデータエントリの更新を行う。複製元ファイル複製制御手段107や複製先ファイル複製制御手段207は、ファイルシステム全体の複製を指示するファイル複製開始メッセージによりファイル群メタデータブロックの階層的な比較を行い、更新のあった全てのファイルに関する更新ブロックの転送を実行する。   The metadata block management means 106 updates the file, updates the metadata block tree structure for each block, and then converts the tree structure of the file group metadata block 904 to the root meta data based on the i-node number of the file. Following from the data block 904A, the metadata entry of the file group metadata block 904 and the file metadata block 903 is updated. The replication source file replication control unit 107 and the replication destination file replication control unit 207 perform a hierarchical comparison of the file group metadata blocks by a file replication start message instructing replication of the entire file system, and all files that have been updated Update block transfer for

以上のように複数ファイルに関して更新の有無を判定する情報を階層的に保持するので、ファイルシステム全体を対象とするファイル複製を高速に実現することができる。   As described above, since the information for determining the presence / absence of update for a plurality of files is hierarchically stored, file replication for the entire file system can be realized at high speed.

この発明の実施の形態1に係るファイル複製システムの構成を示す図である。It is a figure which shows the structure of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのディスク装置の別の構成を示す図である。It is a figure which shows another structure of the disk apparatus of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのディスク装置内のファイル管理情報の構成を示す図である。It is a figure which shows the structure of the file management information in the disk apparatus of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのディスク装置内のブロックメタデータブロックの構成を示す図である。It is a figure which shows the structure of the block metadata block in the disk apparatus of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのディスク装置内のセグメントメタデータブロックの構成を示す図である。It is a figure which shows the structure of the segment metadata block in the disk apparatus of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段の動作を説明するための図である。It is a figure for demonstrating operation | movement of the metadata block management means of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the file write-in operation | movement of the metadata block management means of the file replication system concerning Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS703の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S703 of the file write-in operation | movement of the metadata block management means of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS704の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S704 of the file write-in operation | movement of the metadata block management means of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS705の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S705 of the file write-in operation | movement of the metadata block management means of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイル書き込み動作のステップS706の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S706 of the file write-in operation | movement of the metadata block management means of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイルサイズの切り詰め動作の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the truncation operation | movement of the file size of the metadata block management means of the file replication system concerning Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイルサイズの切り詰め動作のステップS1203の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S1203 of the file size truncation operation | movement of the metadata block management means of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムのメタデータブロック管理手段のファイルサイズの切り詰め動作のステップS1204の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S1204 of the file size truncation operation | movement of the metadata block management means of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段及び複製先システムの複製先ファイル複製制御手段の動作を説明するための図である。It is a figure for demonstrating operation | movement of the replication source file replication control means of the replication source system of the file replication system which concerns on Embodiment 1 of this invention, and the replication destination file replication control means of a replication destination system. この発明の実施の形態1に係るファイル複製システムの複製元システム及び複製先システムのメッセージ交換のタイミングを説明するための図である。It is a figure for demonstrating the timing of the message exchange of the replication origin system and replication destination system of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムの複製先システムの複製先ファイル複製制御手段から複製元システムの複製元ファイル複製制御手段へ送られるファイル複製開始メッセージの構成を示す図である。It is a figure which shows the structure of the file replication start message sent to the replication source file replication control means of a replication source system from the replication destination file replication control means of the replication destination system of the file replication system according to Embodiment 1 of the present invention. この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段から複製先システムの複製先ファイル複製制御手段へ送られるファイル一致応答メッセージの構成を示す図である。It is a figure which shows the structure of the file matching response message sent from the replication source file replication control means of the replication source system of the file replication system according to Embodiment 1 of the present invention to the replication destination file replication control means of the replication destination system. この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段から複製先システムの複製先ファイル複製制御手段へ送られるファイル削除応答メッセージの構成を示す図である。It is a figure which shows the structure of the file deletion response message sent to the replication destination file replication control means of a replication destination system from the replication source file replication control means of the replication source system of the file replication system concerning Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段と複製先システムの複製先ファイル複製制御手段の間で相互に送られるセグメントメタデータメッセージの構成を示す図である。The figure which shows the structure of the segment metadata message sent mutually between the replication source file replication control means of the replication source system of the file replication system which concerns on Embodiment 1 of this invention, and the replication destination file replication control means of a replication destination system It is. この発明の実施の形態1に係るファイル複製システムの複製先システムの複製先ファイル複製制御手段から複製元システムの複製元ファイル複製制御手段へ送られるブロック転送要求メッセージの構成を示す図である。It is a figure which shows the structure of the block transfer request message sent to the replication source file replication control means of a replication source system from the replication destination file replication control means of the replication destination system of the file replication system according to Embodiment 1 of the present invention. この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段から複製先システムの複製先ファイル複製制御手段へ送られるブロック転送メッセージの構成を示す図である。It is a figure which shows the structure of the block transfer message sent to the replication destination file replication control means of a replication destination system from the replication source file replication control means of the replication source system of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段の動作の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of operation | movement of the replication source file replication control means of the replication source system of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムの複製先システムの複製先ファイル複製制御手段の動作の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of operation | movement of the replication destination file replication control means of the replication destination system of the file replication system which concerns on Embodiment 1 of this invention. この発明の実施の形態1に係るファイル複製システムの複製元ファイル複製制御手段のステップS2306の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S2306 of the duplication source file duplication control means of the file duplication system concerning Embodiment 1 of this invention. 図25のステップS2506及び図28のステップS2809の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S2506 of FIG. 25 and step S2809 of FIG. この発明の実施の形態1に係るファイル複製システムの複製元ファイル複製制御手段のステップS2311及び複製先ファイル複製制御手段のステップS2406の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S2311 of the replication source file replication control means of the file replication system which concerns on Embodiment 1 of this invention, and step S2406 of a replication destination file replication control means. 図27のステップS2704の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S2704 of FIG. 図28のステップS2813の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S2813 of FIG. この発明の実施の形態1に係るファイル複製システムの複製先ファイル複製制御手段のステップS2407の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S2407 of the replication destination file replication control means of the file replication system which concerns on Embodiment 1 of this invention. 図30のステップS3004の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S3004 of FIG. この発明の実施の形態1に係るファイル複製システムの複製元ファイル複製制御手段のステップS2312の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S2312 of the duplication source file duplication control means of the file duplication system concerning Embodiment 1 of this invention. 図32のステップS3204の詳細な動作を示すフローチャートである。It is a flowchart which shows the detailed operation | movement of step S3204 of FIG. この発明の実施の形態2に係るファイル複製システムの構成を示す図である。It is a figure which shows the structure of the file replication system which concerns on Embodiment 2 of this invention. この発明の実施の形態2に係るファイル複製システムのディスク装置内のファイルメタデータ管理情報の構成を示す図である。It is a figure which shows the structure of the file metadata management information in the disk apparatus of the file duplication system concerning Embodiment 2 of this invention. この発明の実施の形態3に係るファイル複製システムのディスク装置に格納されるファイルデータおよびメタデータの構成を示す図である。It is a figure which shows the structure of the file data and metadata stored in the disk apparatus of the file replication system which concerns on Embodiment 3 of this invention. この発明の実施の形態4に係るファイル複製システムの構成を示す図である。It is a figure which shows the structure of the file replication system which concerns on Embodiment 4 of this invention. この発明の実施の形態5に係るファイル複製システムのメタデータブロック管理手段の構成を示す図である。It is a figure which shows the structure of the metadata block management means of the file replication system which concerns on Embodiment 5 of this invention. この発明の実施の形態5に係るファイル複製システムのメタデータブロック管理手段のファイル更新ログ情報の構成を示す図である。It is a figure which shows the structure of the file update log information of the metadata block management means of the file replication system which concerns on Embodiment 5 of this invention. この発明の実施の形態6に係るファイル複製システムのセグメント/ブロックメタデータブロックの構成を示す図である。It is a figure which shows the structure of the segment / block metadata block of the file replication system which concerns on Embodiment 6 of this invention. この発明の実施の形態7に係るファイル複製システムのディスク装置に格納される情報を示す図である。It is a figure which shows the information stored in the disk apparatus of the file replication system which concerns on Embodiment 7 of this invention.

符号の説明Explanation of symbols

100 複製元システム、100C ファイル複製補助装置、105、105A ファイルシステム管理手段、106、106A、106B メタデータブロック管理手段、106C ディスクI/Fバス監視手段、106D メタデータブロック読出手段、107、107A、107B 複製元ファイル複製制御手段、108、108A、108B ディスク装置、200 複製先システム、205 ファイルシステム管理手段、206 メタデータブロック管理手段、207、207A、207B 複製先ファイル複製制御手段、208 ディスク装置、300 ネットワーク、1060 I/O要求受付手段、1061 ファイル更新ログ追加手段、1062 ファイル更新ログ情報、1063 ファイル更新ログマージ手段、1064 ファイル更新ログ反映手段、1080 ディスクI/Fバス。   100 replication source system, 100C file replication auxiliary device, 105, 105A file system management means, 106, 106A, 106B metadata block management means, 106C disk I / F bus monitoring means, 106D metadata block reading means, 107, 107A, 107B replication source file replication control means, 108, 108A, 108B disk device, 200 replication destination system, 205 file system management means, 206 metadata block management means, 207, 207A, 207B replication destination file replication control means, 208 disk device, 300 network, 1060 I / O request accepting means, 1061 file update log adding means, 1062 file update log information, 1063 file update log merging means, 1064 file New log reflection means, 1080 disk I / F bus.

Claims (19)

第1のディスク装置に格納されるファイルを、データブロック及び連続する複数のデータブロックから構成されるセグメントである領域に分割し、分割した領域毎の更新有無が判定可能な更新判定情報を含む情報ブロックを階層的に配置し、階層的に配置された情報ブロックを前記ファイルの大きさに応じて木構造で第2のディスク装置に格納するメタデータブロック管理手段と、
複数のコンピュータ間で前記木構造の情報ブロックに含まれる更新判定情報の比較を行って更新されたデータブロックを検出し、更新されたデータブロックのみを複製元から複製先へ転送するファイル複製制御手段と
を備えたことを特徴とするファイル複製システム。
Information including update determination information that can divide a file stored in the first disk device into areas that are segments composed of data blocks and a plurality of continuous data blocks, and determine whether or not each divided area is updated Metadata block management means for hierarchically arranging blocks, and storing hierarchically arranged information blocks in a second disk device in a tree structure according to the size of the file;
File replication control means for detecting updated data blocks by comparing update determination information included in the tree-structured information blocks between a plurality of computers and transferring only the updated data blocks from the replication source to the replication destination A file replication system comprising: and.
前記メタデータブロック管理手段は、前記更新判定情報として、領域に対する最終更新日時を用い、単一のデータブロック又は連続する第1の所定数のデータブロックから構成されるセグメントである小領域を包含する、連続する前記第1の所定数より大きい第2の所定数のデータブロックから構成されるセグメントである大領域の最終更新日時を前記小領域の最終更新日時の最大値として設定し、
前記ファイル複製制御手段は、最終更新日時が増加した際に更新があったと判定する
ことを特徴とする請求項1記載のファイル複製システム。
The metadata block management means includes a small area that is a segment composed of a single data block or a continuous first predetermined number of data blocks, using the last update date and time for the area as the update determination information. Setting the last update date and time of the large area, which is a segment composed of a second predetermined number of data blocks larger than the first predetermined number of consecutive, as the maximum value of the last update date and time of the small area,
The file replication system according to claim 1, wherein the file replication control unit determines that there is an update when the last update date is increased.
前記メタデータブロック管理手段は、前記更新判定情報として、ファイル更新の都度増加する世代番号を用い、単一のデータブロック又は連続する第1の所定数のデータブロックから構成されるセグメントである小領域を包含する、連続する前記第1の所定数より大きい第2の所定数のデータブロックから構成されるセグメントである大領域の世代番号を前記小領域の世代番号の最大値として設定し、
前記ファイル複製制御手段は、世代番号が増加した際に更新があったと判定する
ことを特徴とする請求項1記載のファイル複製システム。
The metadata block management means uses a generation number that increases each time a file is updated as the update determination information, and is a small area that is a segment composed of a single data block or a continuous first predetermined number of data blocks Including, as a maximum value of the generation number of the small area, a generation number of the large area that is a segment composed of a second predetermined number of data blocks that are larger than the first predetermined number of consecutive blocks,
The file replication system according to claim 1, wherein the file replication control unit determines that there is an update when the generation number increases.
前記メタデータブロック管理手段は、前記更新判定情報として、領域内のデータに対するチェックサムを用い、
前記ファイル複製制御手段は、チェックサムが一致しない場合に更新があったと判定する
ことを特徴とする請求項1記載のファイル複製システム。
The metadata block management means uses a checksum for data in the area as the update determination information,
The file replication system according to claim 1, wherein the file replication control unit determines that there is an update when the checksums do not match.
前記ファイル複製制御手段は、第1のコンピュータにおいて、第2のコンピュータから送付された更新判定情報に基づいてファイルを構成する領域の更新有無を判定し、更新が検出された場合に前記領域を構成する小領域の更新判定情報を前記第2のコンピュータに送付する
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The file copy control means determines whether or not an area constituting the file is updated based on the update determination information sent from the second computer in the first computer, and configures the area when an update is detected. The file replication system according to any one of claims 1 to 4, wherein update determination information of a small area to be sent is sent to the second computer.
前記メタデータブロック管理手段は、ファイルの一部に未書き込み領域が含まれる場合に、前記未書き込み領域に対応する更新判定情報の一部を格納しない
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The metadata block management unit does not store a part of the update determination information corresponding to the unwritten area when an unwritten area is included in a part of the file. The file replication system described in any of the above.
前記第1及び第2のディスク装置は、同じディスク装置である
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The file replication system according to any one of claims 1 to 4, wherein the first and second disk devices are the same disk device.
前記第1及び第2のディスク装置は、異なるディスク装置である
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The file replication system according to any one of claims 1 to 4, wherein the first and second disk devices are different disk devices.
前記メタデータブロック管理手段は、更新判定情報であることを示す文字列、ファイルを識別する名称、および階層レベルを含んだ名前によりアクセスされるファイルとして各階層レベルの更新判定情報を格納する
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The metadata block management means stores update determination information at each hierarchical level as a file accessed by a character string indicating update determination information, a name for identifying the file, and a name including the hierarchical level. The file replication system according to any one of claims 1 to 4, wherein the file replication system is characterized.
前記メタデータブロック管理手段は、ファイルの先頭に近い部分をより大きな領域に分割し、ファイルの末尾に近い部分をより小さな領域に分割して更新判定情報を格納する
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The metadata block management means divides a portion close to the beginning of the file into larger regions and divides a portion close to the end of the file into smaller regions to store the update determination information. The file replication system according to claim 4.
前記メタデータブロック管理手段は、
ファイル書き込みの結果を直ちに更新判定情報の木構造に反映せず、更新判定情報の木構造への反映に必要な情報を第3のディスク装置に書き込むファイル更新ログ追加手段と、
ファイル書き込みと独立して実行され、同一領域への複数回の更新ログ情報をまとめるファイル更新ログマージ手段と、
ファイル更新ログ情報を更新判定情報の木構造に反映するファイル更新ログ反映手段とを含む
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The metadata block management means includes:
A file update log adding means for writing the information necessary for reflecting the update determination information in the tree structure to the third disk device without immediately reflecting the result of the file writing in the tree structure of the update determination information;
A file update log merging means that is executed independently of file writing and collects update log information of a plurality of times in the same area;
The file replication system according to any one of claims 1 to 4, further comprising: a file update log reflection unit that reflects the file update log information in the tree structure of the update determination information.
メタデータブロック管理手段は、
ファイル書き込みの結果を直ちにチェックサムの木構造に反映せず、ファイルのデータブロック毎の更新フラグを設定する手段と、
ファイル書き込みと独立して実行され、更新フラグが設定されているデータブロックに対してチェックサムの木構造の更新を行う手段とを含む
ことを特徴とする請求項4記載のファイル複製システム。
Metadata block management means
Means for setting an update flag for each data block of the file without immediately reflecting the result of the file writing in the checksum tree structure;
5. The file replication system according to claim 4, further comprising means for executing a checksum tree structure update for a data block that is executed independently of file writing and for which an update flag is set.
単一のデータブロック又は連続する第1の所定数のデータブロックから構成されるセグメントである小領域を包含する、連続する前記第1の所定数より大きい第2の所定数のデータブロックから構成されるセグメントである大領域のチェックサムを、前記小領域毎のチェックサムをオフセット順に連結したバイト列に対するチェックサムとする
ことを特徴とする請求項4記載のファイル複製システム。
Consists of a second predetermined number of data blocks that are larger than the first predetermined number of consecutive blocks, including a small area that is a single data block or a segment composed of a first predetermined number of consecutive data blocks. 5. The file duplication system according to claim 4, wherein a checksum of a large area that is a segment to be used is a checksum for a byte string obtained by concatenating the checksums of each small area in an offset order.
更新される、単一のデータブロック又は連続する第1の所定数のデータブロックから構成されるセグメントである小領域を包含する、連続する前記第1の所定数より大きい第2の所定数のデータブロックから構成されるセグメントである大領域の更新後のチェックサムが、前記小領域および前記大領域の更新前のチェックサムと前記小領域の更新後のチェックサムから導出可能な線形関数を用いる
ことを特徴とする請求項4記載のファイル複製システム。
A second predetermined number of data greater than the first predetermined number of consecutive data including a small area that is a segment composed of a single data block or a first predetermined number of consecutive data blocks to be updated. The checksum after the update of the large area, which is a segment composed of blocks, uses a linear function that can be derived from the checksum before the update of the small area and the large area and the checksum after the update of the small area. The file replication system according to claim 4.
既存のファイルデータからチェックサム木構造を生成する手段を備える
ことを特徴とする請求項4記載のファイル複製システム。
The file replication system according to claim 4, further comprising means for generating a checksum tree structure from existing file data.
前記ファイル複製制御手段は、複製元に複製先の全てのブロックより古いブロックが存在しない場合にデータ転送を実行し、それ以外の場合にデータ転送を行わない
ことを特徴とする請求項2又は3記載のファイル複製システム。
The file copy control means executes data transfer when there is no block older than all blocks at the copy destination in the copy source, and does not transfer data in other cases. The file replication system described.
前記メタデータブロック管理手段は、ファイルに付与された番号に基づいてファイルシステム内の全ファイルを階層的に群に分け、ファイル群に関する更新判定情報を木構造で格納し、
前記ファイル複製制御手段は、指定したファイルまたはファイルシステム全体の複製を行う
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The metadata block management means hierarchically divides all files in the file system based on the number assigned to the file, stores update determination information regarding the file group in a tree structure,
The file replication system according to any one of claims 1 to 4, wherein the file replication control unit replicates the specified file or the entire file system.
前記メタデータブロック管理手段は、ファイルのディレクトリ名に基づいてファイルシステム内の全ファイルを階層的に群に分け、ファイル群に関する更新判定情報を木構造で格納し、
前記ファイル複製制御手段は、指定したファイルまたは指定したディレクトリ以下の全ファイルの複製を行う
ことを特徴とする請求項1から請求項4までのいずれかに記載のファイル複製システム。
The metadata block management means hierarchically divides all the files in the file system based on the directory name of the file, stores update determination information regarding the file group in a tree structure,
The file replication control unit according to any one of claims 1 to 4, wherein the file replication control unit replicates all files under a specified file or a specified directory.
コンピュータと第1のディスク装置を接続するバスに接続されたファイル複製補助装置を備えるファイル複製システムであって、
前記ファイル複製補助装置は、
前記バス上を送付される前記第1のディスク装置への書き込みコマンドを監視するバス監視手段と、
前記書き込みコマンドに基づいて前記第1のディスク装置全体を階層的に分割した領域毎の更新判定情報を第2のディスク装置に木構造で格納するメタデータブロック管理手段と、
格納したメタデータブロックを読み出すメタデータブロック読出手段とを含む
ことを特徴とするファイル複製システム。
A file replication system comprising a file replication auxiliary device connected to a bus connecting a computer and a first disk device,
The file duplication assisting device is:
Bus monitoring means for monitoring a write command to the first disk device sent over the bus;
Metadata block management means for storing update determination information for each area obtained by hierarchically dividing the entire first disk device based on the write command in a second disk device in a tree structure;
A file replication system comprising: metadata block reading means for reading stored metadata blocks.
JP2006017964A 2006-01-26 2006-01-26 File copying system Pending JP2007200029A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006017964A JP2007200029A (en) 2006-01-26 2006-01-26 File copying system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006017964A JP2007200029A (en) 2006-01-26 2006-01-26 File copying system

Publications (1)

Publication Number Publication Date
JP2007200029A true JP2007200029A (en) 2007-08-09

Family

ID=38454584

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006017964A Pending JP2007200029A (en) 2006-01-26 2006-01-26 File copying system

Country Status (1)

Country Link
JP (1) JP2007200029A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011513853A (en) * 2008-03-05 2011-04-28 エヌイーシー ラボラトリーズ アメリカ インク Associative storage system and method
EP2339445A2 (en) 2009-12-22 2011-06-29 Fujitsu Limited File management information storage apparatus and method and program for controlling the same
JP2012208964A (en) * 2012-08-03 2012-10-25 Hitachi Ltd Computer system, data-matching method and data-matching processing program
JP2013178685A (en) * 2012-02-29 2013-09-09 Nec Corp Data processing system with asynchronous backup function, front system, backup method and program therefor
JP2018511861A (en) * 2015-02-27 2018-04-26 アリババ・グループ・ホールディング・リミテッドAlibaba Group Holding Limited Method and device for processing data blocks in a distributed database
JP2021033853A (en) * 2019-08-28 2021-03-01 富士ゼロックス株式会社 Information processing device, information processing system and information processing program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06332769A (en) * 1993-05-21 1994-12-02 Mitsubishi Electric Corp File control system
JP2001202283A (en) * 1999-11-09 2001-07-27 Fujitsu Ltd System for monitoring contents updating situation
JP2006018594A (en) * 2004-07-01 2006-01-19 Mitsubishi Electric Corp Information processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06332769A (en) * 1993-05-21 1994-12-02 Mitsubishi Electric Corp File control system
JP2001202283A (en) * 1999-11-09 2001-07-27 Fujitsu Ltd System for monitoring contents updating situation
JP2006018594A (en) * 2004-07-01 2006-01-19 Mitsubishi Electric Corp Information processor

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011513853A (en) * 2008-03-05 2011-04-28 エヌイーシー ラボラトリーズ アメリカ インク Associative storage system and method
EP2339445A2 (en) 2009-12-22 2011-06-29 Fujitsu Limited File management information storage apparatus and method and program for controlling the same
US8375071B2 (en) 2009-12-22 2013-02-12 Fujitsu Limited File management information storage apparatus and method and program for controlling the same
JP2013178685A (en) * 2012-02-29 2013-09-09 Nec Corp Data processing system with asynchronous backup function, front system, backup method and program therefor
JP2012208964A (en) * 2012-08-03 2012-10-25 Hitachi Ltd Computer system, data-matching method and data-matching processing program
JP2018511861A (en) * 2015-02-27 2018-04-26 アリババ・グループ・ホールディング・リミテッドAlibaba Group Holding Limited Method and device for processing data blocks in a distributed database
JP2021033853A (en) * 2019-08-28 2021-03-01 富士ゼロックス株式会社 Information processing device, information processing system and information processing program
JP7363198B2 (en) 2019-08-28 2023-10-18 富士フイルムビジネスイノベーション株式会社 Information processing device, information processing system, and information processing program

Similar Documents

Publication Publication Date Title
CN106407040B (en) A kind of duplicating remote data method and system
US7831639B1 (en) System and method for providing data protection by using sparse files to represent images of data stored in block devices
CN105190573B (en) The reduction redundancy of storing data
US20170103086A1 (en) Deduplicated file system
US6792518B2 (en) Data storage system having mata bit maps for indicating whether data blocks are invalid in snapshot copies
JP2007200029A (en) File copying system
US20090006792A1 (en) System and Method to Identify Changed Data Blocks
US20050240725A1 (en) Sparse multi-component files
EP0397404A2 (en) A system and method for reading and writing disks formatted for an operating system foreign to the host computer
US20030225972A1 (en) Storage system
US6463573B1 (en) Data processor storage systems with dynamic resynchronization of mirrored logical data volumes subsequent to a storage system failure
CN101743546A (en) Hierarchical storage management for a file system providing snapshots
CN103547992B (en) System and method for maintaining consistent points in file systems using a prime dependency list
JP2006505069A (en) Apparatus and method for hardware-based file system
KR20060045789A (en) Document processing apparatus, control method therefor, and computer-readable storage medium
US20070033370A1 (en) Continuous data protection
US5781915A (en) Document processing apparatus that determines whether a document has been confirmed by another user
EP2452275A1 (en) Method and device for a memory system
WO2015007155A1 (en) Data storage method and apparatus
CN107679182B (en) Directory configuration method and device
CN113377579B (en) Solid state disk data recovery method and system based on mapping table
US10146466B1 (en) Merging mapping metadata to promote reference counting efficiency
KR100907477B1 (en) Apparatus and method for managing index of data stored in flash memory
JP2024525170A (en) Data compression method and device
AU2021248108A1 (en) Data migration

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080612

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110207

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110222

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110408

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110719

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110901

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120321