JP2007200029A - File copying system - Google Patents
File copying system Download PDFInfo
- 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
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
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).
上述したような従来のファイル複製方式では、ファイル複製の実行時に検算値を計算するためファイル全体を更新のないブロックも含めて読み出さなければならず、それに伴うディスク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に係るファイル複製システムの構成を示す図である。なお、以降では、各図中、同一符号は同一又は相当部分を示す。
A file replication system according to
図1において、この実施の形態1に係るファイル複製システムは、ネットワーク300を介して、複製元システム100と、複製先システム200とが設けられている。
1, the file replication system according to the first embodiment is provided with a
複製元システム100と複製先システム200は、それぞれコンピュータシステムであり、例えばIntel社Xeonプロセッサ、DRAM、SCSIインタフェースを備える固定ディスク装置、ギガビットイーサネット(登録商標)インタフェース、およびそれらを接続するPCI−Xバスなどのハードウェアと、GNU/Linuxオペレーティングシステムソフトウェアにより実現することができる。
Each of the
複製元システム100には、ファイルシステム管理手段105と、メタデータブロック管理手段106と、複製元ファイル複製制御手段107と、ディスク装置108とが設けられている。同様に、複製先システム200には、ファイルシステム管理手段205と、メタデータブロック管理手段206と、複製元ファイル複製制御手段207と、ディスク装置208とが設けられている。
The
複製元システム100は、ファイルをディスク装置108に格納する際、ファイルデータブロック(データブロック)102A〜Dと共に、ファイル管理情報101、ブロックメタデータブロック(情報ブロック)103A〜B、およびセグメントメタデータブロック104(情報ブロック)Aを併せて格納する。ファイルデータブロック102は、ファイルの内容を固定長に分割して格納するためのディスク装置108上の領域であり、ファイルのサイズに応じて必要な数を割り当てて使用する。
When the
ファイル管理情報101は、複数のファイルデータブロック102のディスク装置108上のアドレスを管理し、ファイルの任意の部分へのランダムアクセスを可能にする。また、ファイル管理情報101は、ファイルの更新日時や所有ユーザなど、メタデータと呼ばれる属性情報も格納する。ディスク装置108上の記憶領域の管理や、ファイル管理情報101を介したファイルアクセスの機能は、一般にオペレーティングシステムの一部であるファイルシステム管理手段105により提供される。
The
ファイルシステム管理手段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
ブロックメタデータブロック103A〜Bおよびセグメントメタデータブロック104Aは、公知のファイルシステムには存在しないものであり、メタデータブロック管理手段106によりディスク装置108上に格納される。メタデータブロック管理手段106は、ファイルシステム管理手段105によりファイル更新の都度呼び出される。
The
また、メタデータブロック管理手段106は、ファイルシステム管理手段105の機能の一部を利用してディスク装置108上の記憶領域の確保や解放を行う。ファイル管理情報101は、ファイルデータブロック102A〜Dのディスク装置108上のアドレスと共に、セグメントメタデータブロック104Aのアドレスも格納しており、さらにセグメントメタデータブロック104Aには、ブロックメタデータブロック103A〜Bのアドレスが格納されている。
Further, the metadata
複製先システム200においても、複製元システム100と同様にしてファイルをディスク装置208に格納する。ファイル管理情報201、ファイルデータブロック202A〜D、ブロックメタデータブロック203A〜B、およびセグメントメタデータブロック204Aは、複製元システム100のファイル管理情報101、ファイルデータブロック102A〜D、ブロックメタデータブロック103A〜B、およびセグメントメタデータブロック104Aにそれぞれ対応しており、ある時点で複製元システム100から複製した際の内容を持っている。
Also in the
ファイルシステム管理手段205は、ファイルシステム管理手段105と同一もしくは同等の動作を行う。メタデータブロック管理手段206は、メタデータブロック管理手段106と同一である。
The file
複製元ファイル複製制御手段107と複製先ファイル複製制御手段207は、複製元システム100から複製先システム200へのファイル複製において、ネットワーク300を介して互いに通信しながら、それぞれ複製元システム100と複製先システム200の制御を行う。
The replication source file
図2は、この発明の実施の形態1に係るファイル複製システムのディスク装置の別の構成を示す図である。
FIG. 2 is a diagram showing another configuration of the disk device of the file replication system according to
図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,
さらに、レベル1の一定数(図2では2個)のセグメントメタデータブロック(104B〜C)毎に階層レベル2となるセグメントメタデータブロック104Aを配置する。レベル2において必要なセグメントメタデータブロックの数が1となるため、このファイルに対するブロックメタデータブロックおよびセグメントメタデータブロックの木構造に必要な高さは3となる。
Furthermore, a
ファイル管理情報(iノード)101には、木構造の最も高いレベルにある単一のセグメントメタデータブロック、すなわちセグメントメタデータブロック104Aのディスク装置108上のアドレスを格納する。このセグメントメタデータブロック104Aを『ルートメタデータブロック』と呼ぶ。高さ1の木構造、すなわち単一のブロックメタデータブロックで十分なサイズのファイルに対しては、ルートメタデータブロックは当該ブロックメタデータブロックとなる。
The file management information (i-node) 101 stores the address on the
各レベル間のセグメント/ブロックメタデータブロック(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
図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
図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
ルートメタデータブロックアドレス1013は、ルートメタデータブロックとなるセグメントメタデータブロックまたはブロックメタデータブロックのディスク装置108上のアドレスを格納する。ルートメタデータブロックは、図1や図2においてはセグメントメタデータブロック104Aである。
The root
また、データブロックアドレスリスト1014には、複数のファイルデータブロックのアドレスを格納するが、例えば上記のext3ファイルシステムのようにファイルデータブロックアドレスの配列、間接ブロック(ファイルデータブロックアドレスの配列を格納したブロック)のアドレス、二重間接ブロック(ファイルデータブロックアドレスの配列を格納した複数ブロックのアドレス配列を格納したブロック)のアドレス、および三重間接ブロックのアドレスなどにより実現することができる。
ファイルメタデータ1012には、ファイルに対する更新の有無を判定できる任意の情報を格納することができるが、ここではファイルの最終更新日時、ファイルを更新する都度増加する世代番号、およびファイルデータのチェックサム(例えば、公知のMD5やSHA−1など)を用いるものとする。
The data block
The
図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
図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
ブロックメタデータの各エントリ(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
図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
図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
階層レベル1041には、当該セグメントメタデータブロックが配置される木構造中の階層レベルの値(≧1)が格納される。有効エントリ数1042には、有効な値が設定されたセグメントメタデータおよび下位メタデータブロックアドレスのエントリ数が格納され、セグメントメタデータ(0)〜セグメントメタデータ(有効エントリ数−1)および下位メタデータブロックアドレス(0)〜下位メタデータブロックアドレス(有効エントリ数−1)が有効であることを表す。有効エントリ数=0のセグメントメタデータブロックは作成されず、有効エントリ数は1〜mまでの値を取る。mはセグメントメタデータブロック104の領域サイズが許す範囲内で最大の値を用いる。
The
セグメントメタデータの各エントリ(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
セグメントメタデータの各エントリ(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
下位メタデータブロックアドレスの各エントリ(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
次に、セグメント/ブロックメタデータブロックにより構成される木構造を特徴付けるパラメータについて一般的に成り立つ関係を説明する。ファイルデータブロックのサイズを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).
ただし、
階層レベルhに位置するメタデータブロック数Khは、式(3)で表される。 The number of metadata blocks K h located at the hierarchy level h is expressed by Expression (3).
各ファイルデータブロックにファイル中のオフセット順にブロック番号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). .
ただし、
また、階層レベルhのメタデータブロックにおいて、セグメント/ブロックメタデータの各エントリに対応する最大セグメントサイズGhは、式(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).
ただし、ブロックメタデータブロックのブロックメタデータエントリに対応するファイルデータブロックを単一ファイルデータブロックからなるセグメントとみなしている。ファイルの末尾ではセグメントの一部しか使用されないため、実際のセグメントサイズghは、最大セグメントサイズGhより小さくなることもある。階層レベルhのメタデータブロックにおいて、オフセットsバイトの位置のセグメント/ブロックメタデータエントリに対応するセグメントサイズghは、式(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).
さらに、階層レベルhのメタデータブロックkhにおいて、オフセットsバイトの位置に対応するセグメント/ブロックメタデータおよび下位メタデータブロックアドレスのエントリ番号jhは、式(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).
ただし、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
この図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つ(K0(6・B)=2)のブロックメタデータブロックが存在し、レベル1の位置にはルートメタデータブロックとなるセグメントメタデータブロックが1つ(K1(6・B)=1)存在する。k0=0のブロックメタデータブロックのエントリは全て使用され、エントリ番号j0=0,1,2,3にはファイルデータブロックi=0,1,2,3のメタデータがそれぞれ格納される。また、k0=1のブロックメタデータブロックのエントリは先頭の2つのみ使用され、エントリ番号j0=0,1にファイルデータブロックi=4,5のメタデータがそれぞれ格納される。k1=0のセグメントメタデータブロックのエントリは先頭の2つのみ使用され、エントリ番号j1=0,1の下位メタデータブロックアドレスにブロックメタデータブロックk0=0,1のアドレスがそれぞれ格納される。また、エントリ番号j1=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
ファイルへの書き込みによりファイルサイズが変化しない場合、すなわちファイルデータブロックi=0〜5のいずれかに対する書き込みの際は、メタデータブロックの木構造は変化せず、ファイル/セグメント/ブロックメタデータのみが更新される。例えば、ブロック番号i=4のファイルデータブロックへの書き込みに対しては、ブロックメタデータブロックk0(4・B)=1のブロックメタデータ(j0(4・B)=0)、セグメントメタデータブロックk1(4・B)=0のセグメントメタデータ(j1(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は、元のルートメタデータブロック(k1=0)の上位(階層レベル=2)にセグメントメタデータブロック(k2=0)を割り当てて新たなルートメタデータブロックとし、元のルートメタデータブロック(k1=0)のアドレスを新たなルートメタデータブロック(k2=0)の下位メタデータブロックアドレス(0)に格納する。また、元のルートメタデータブロック(k1=0)のセグメントメタデータ(0)〜(1)の最終更新日時と世代番号の最大値を新たなルートメタデータブロック(k1=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に対応するエントリは、ブロックメタデータブロックk0(18・B)=4のブロックメタデータ(j0(18・B)=2)、セグメントメタデータブロックk1(18・B)=1のセグメントメタデータ(j1(18・B)=1)、およびセグメントメタデータブロックk2(18・B)=1のセグメントメタデータ(j2(18・B)=1)であり、存在しないk0=4とk1=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も同様に、対応するファイルデータブロックやセグメントがホールのみとなるメタデータブロック(k0=2および3)の割り当ては行わない。また、階層レベル上位の対応する下位メタデータブロックアドレス(セグメントメタデータブロックk1=0のエントリj1=2およびセグメントメタデータブロックk1=1のエントリj1=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
一方、一部にホールを含むメタデータブロック(k0=1,4およびk1=0,1)においてはホールに対応するエントリ(メタデータブロックk0=1のエントリ2,3、メタデータブロックk0=4のエントリ0,1、メタデータブロックk1=0のエントリ2、メタデータブロックk1=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 (
ファイルサイズの縮小は、ファイルへの書き込みによっては起こらないが、明示的なファイルサイズ切り詰め操作により発生する。この場合の変化は図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
次に、ステップ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
次に、ステップ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
次に、ステップ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
続いて、ステップ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
次に、ステップ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
図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)の値に初期化し、変数phを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)のエントリ番号jh(s)を変数jhに設定する。 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において、jhとphが指すセグメントメタデータブロックの有効エントリ数を比較し、jhの方が小さければステップ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において、phが指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh)が無効値かどうかを判定し、無効値であればステップ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に設定する。また、セグメント/ブロックメタデータブロックの全エントリについて、データ非依存部(最終更新日時および世代番号)をphが指すセグメントメタデータブロックのセグメントメタデータ(jh)の値に設定すると共に、チェックサムをホールに対応する値、すなわちバイト値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において、phが指すセグメントメタデータブロックの更新を行う。エントリ番号が現在の有効エントリ数〜jh−1に対応する下位メタデータブロックアドレスに全て無効値を設定し、セグメントメタデータのデータ非依存部にファイルメタデータ1012の値を、チェックサムにホールに対応する値をそれぞれ設定する。その後、有効エントリ数にjh+1を設定する。本ステップはファイルサイズの拡張を伴う書き込みにおいて実行される。ホールを生じる際にはホール末尾領域に対応するセグメントメタデータエントリの設定も行う。ホールを生じないファイルサイズ拡張においてはjh=有効エントリ数となり、下位メタデータブロックアドレスやセグメントメタデータの設定対象エントリは存在しない。
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
続いて、ステップ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において、phが指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh)に、ステップ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において、phが指すセグメントメタデータブロックのセグメントメタデータ(jh)のデータ非依存部にファイルメタデータ1012の値を設定する。
Subsequent step S910, sets the value of the
ステップS911において、変数ph−1にphが指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh)の値を設定し、変数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
ステップS903に続くステップS912では、phが指すブロックメタデータブロックのブロックメタデータ(jh)のデータ非依存部にファイルメタデータ1012の値を設定し、処理を終了する。
At step S903 subsequent step S912, sets the value of the
図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が指すルートメタデータブロックの階層レベルの値に初期化し、変数ph’を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に対応するメタデータブロック番号kh’=kh(S)およびエントリ番号jh’=jh(S)と、階層レベルhにおいてオフセットsに対応するメタデータブロック番号kh=kh(s)およびエントリ番号jh=jh(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において、kh’とkhを比較し、kh’が小さい場合はステップ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において、jk’+1とjkを比較し、前者が小さければステップ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において、ph’が指すメタデータブロックのセグメント/ブロックメタデータ(jh’+1)〜(jh−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において、ph’が指すメタデータブロックを更新する。h>0の時は有効エントリ数をmに設定し、セグメントメタデータ(jh’+1)〜(m−1)の内、データ非依存部(最終更新日時および世代番号)をファイルメタデータの値に、チェックサムをホールに対応する値にそれぞれ設定する。また、h=0の時は有効エントリ数をnに設定し、ブロックメタデータ(jh’+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’にph’が指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh’)の値を設定し、変数hを1減じた上で、ステップS1003以下の処理を繰り返す。ph’は常にホールの先頭領域に対応するメタデータブロックを指す。
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
図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の手順で設定したp0が指すブロックメタデータブロックのブロックメタデータ(j0)のチェックサムを書き込みファイルデータブロックiの先頭g0(s)バイトの内容から計算する。g0(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において、phをファイル管理情報(iノード)101のルートメタデータブロックアドレス1013の値と比較し、等しければ終了する。
In step S1103, the p h compared with the values of the file management information (i node) 101 of the root
両者が等しくない場合は、ステップS1104において、hに1を加える。 If they are not equal, 1 is added to h in step S1104.
続く、ステップS1105において、ph(図9で設定したもの)が指すセグメントメタデータブロックのセグメントメタデータ(jh)に含まれるチェックサムを、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において、ホールが生じ、かつph’(図10で設定したもの)≠phが成り立つ場合は、ph’が指すセグメントメタデータブロックのセグメントメタデータ(jh’)に含まれるチェックサムを、ph’が指す下位のメタデータブロックにおけるセグメント/ブロックメタデータ(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
次に、ステップ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
次に、ステップ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
図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
ステップ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が指すルートメタデータブロックの階層レベルの値に初期化し、変数phを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において、phが指すメタデータブロックのファイル切り詰め後の最終エントリ番号jh(S−1)を変数jhに設定する。 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において、phが指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh+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において、phが指すセグメントメタデータブロックの有効エントリ数をjh+1に設定する。 In step S1405, sets the number of valid entries in the segment metadata block pointed to p h to j h +1.
ステップS1406において、phが指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh)が無効値かどうかを判定し、無効値であればステップ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に設定する。また、セグメント/ブロックメタデータブロックの全エントリについて、データ非依存部(最終更新日時および世代番号)をphが指すセグメントメタデータブロックのセグメントメタデータ(jh)の値に設定すると共に、チェックサムをホールに対応する値、すなわちバイト値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において、phが指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh)に新たに割り当てたセグメント/ブロックメタデータブロックのアドレスを設定する。 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において、phが指すセグメントメタデータブロックのセグメントメタデータ(jh)のデータ非依存部にファイルメタデータ1012の値を設定する。
Subsequent step S1409, sets the value of the
ステップS1410において、変数ph−1にphが指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh)の値を設定し、変数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
ステップS1403に続くステップS1411では、phが指すブロックメタデータブロックの有効エントリ数をjh+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
以上説明した書き込み時と切り詰め時のメタデータブロック管理手段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
次に、複製元ファイル複製制御手段107および複製先ファイル複製制御手段207の動作について説明する。図15は、この発明の実施の形態1に係るファイル複製システムの複製元システムの複製元ファイル複製制御手段及び複製先システムの複製先ファイル複製制御手段の動作を説明するための図である。
Next, operations of the copy source file
この図15は、複製元システム100と複製先システム200の間で行われるファイル複製の手順を概念的に示す。ファイル複製は、図15の右から左に進む形で行われる。太枠で示したものが実際に転送されるデータを現している。初めに、ファイルメタデータが比較され、ファイルが更新されているかどうかを検出する。ファイルメタデータが一致しなかった場合、複数のセグメントメタデータが比較され、どのセグメントが更新されたかを検出する。ここでは、2つのセグメントの内、下側のセグメントにおいてメタデータの不一致があったものとする。次に、不一致セグメントの構成要素間での比較が行われる。ここでは、2つのブロックメタデータが比較され、一番下のブロックで不一致が見付かったものとする。最後に、メタデータ不一致ブロックのデータ本体を複製元から複製先に転送し、複製先のディスク装置208に格納する。
FIG. 15 conceptually shows a file duplication procedure performed between the
図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の間で行われるメッセージ交換のタイミングを示す。まず、時刻t1において、複製先から複製元へファイルメタデータを含むメッセージが送られる。複製元は、これを時刻t2に受け取って自身のファイルメタデータと比較しファイルの更新検出を行う。更新が検出された結果、時刻t3に複製元から複製先に最上位のセグメントメタデータを含むメッセージが返される。複製先は、時刻t4にこれを受け取り、更新セグメントを検出する。時刻t5に複製先から複製元へ更新が検出されたセグメントの下位セグメントのメタデータが送信される。複製元は、時刻t6にこれを受け取って更新ブロックの検出を行う。時刻t7に複製元は更新が検出されたブロックのデータ自体を複製先に向け送信する。複製先は、時刻t8以降にブロックデータを受け取ってファイルの複製を更新する。
FIG. 16 shows the timing of message exchange performed between the
このように複製元と複製先は、更新の検出結果と下位階層レベルのメタデータ送信を一括して行い、交互に異なる階層レベルを比較することで、更新の検出をどちらか一方で固定的に実施した場合と比べてメッセージ交換の回数を約半分にすることを可能にしている。 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
この図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
図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
この図18は、ファイル複製開始メッセージに対する応答として複製元ファイル複製制御手段107から複製先ファイル複製制御手段207に送付されるファイル一致応答メッセージ18の内容を示す。ファイル一致応答メッセージ18は、メッセージ種別1801とファイル識別子1802からなる。
FIG. 18 shows the contents of the file
図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
この図19は、ファイル複製開始メッセージに対する応答として複製元ファイル複製制御手段107から複製先ファイル複製制御手段207に送付されるファイル削除応答メッセージ19の内容を示す。ファイル削除応答メッセージ19は、メッセージ種別1901とファイル識別子1902からなる。
FIG. 19 shows the contents of a file
図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
この図20は、複製元ファイル複製制御手段107と複製先ファイル複製制御手段207の間で相互に交わされるセグメントメタデータメッセージ20の内容を示す。セグメントメタデータメッセージ20は、メッセージ種別2001、ファイル識別子2002、ファイルサイズ2003、ファイルサイズ差分2004、階層レベル2005、セグメント数2006と、それに続くセグメント開始オフセット2007、セグメントサイズ2008、セグメントメタデータ2009のセグメント数分の繰り返しからなる。本メッセージの内容は、セグメント/ブロックメタデータブロックに基づいて生成される。
FIG. 20 shows the contents of the
図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
この図21は、複製先ファイル複製制御手段207から複製元ファイル複製制御手段107に送付されるブロック転送要求メッセージ21の内容を示す。ブロック転送要求メッセージ21は、メッセージ種別2101、ファイル識別子2102、ファイルサイズ2103、ファイルサイズ差分2104、ブロック数2105と、それに続くブロック開始オフセット2106とブロックサイズ2107のブロック数分の繰り返しからなる。
FIG. 21 shows the contents of the block
図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
この図22は、複製元ファイル複製制御手段107から複製先ファイル複製制御手段207に送付されるブロック転送メッセージ22の内容を示す。ブロック転送メッセージ22は、メッセージ種別2201、ファイル識別子2202、ファイルサイズ2203、ファイルサイズ差分2204、ブロック数2205と、それに続くブロック開始オフセット2206、ブロックサイズ2207、ブロックデータ2208のブロック数分の繰り返しからなる。
FIG. 22 shows the contents of the
次に、複製元ファイル複製制御手段107および複製先ファイル複製制御手段207の動作の詳細について説明する。
Next, details of operations of the copy source file
図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
まず、ステップS2301において、複製先ファイル複製制御手段207からファイル複製開始メッセージ17を受け取るまで待機する。
First, in step S2301, the process waits until the file
ステップS2302において、ファイル複製開始メッセージ17を受け取るとファイル名文字列1703に指定されたファイルが複製元システム100に存在するかどうかをチェックする。
In step S2302, when the file
ステップS2303において、ファイルが存在しない場合は、複製先ファイル複製制御手段207にファイル削除応答メッセージ19を送信し、終了する。
If the file does not exist in step S2303, the file
ステップS2304において、ファイルが存在する場合は、ファイル複製開始メッセージ17のファイルサイズ1705とファイル管理情報(iノード)101のファイルサイズ1011、およびファイル複製開始メッセージ17のファイルメタデータ1706とファイル管理情報(iノード)101のファイルメタデータ1012をそれぞれ比較する。
In step S2304, if the file exists, the
ステップS2305において、ファイルサイズ、ファイルメタデータ共に一致する場合は、複製先ファイル複製制御手段207にファイル一致応答メッセージ18を送信し、終了する。
If both the file size and file metadata match in step S2305, the file
ステップS2306において、ファイルサイズまたはファイルメタデータが一致しない場合は、後述する手順により最上位階層レベルのセグメントメタデータメッセージ20を生成し、複製先ファイル複製制御手段207に送信する。
If the file size or file metadata does not match in step S2306, the
ステップS2307において、複製先ファイル複製制御手段207からセグメントメタデータメッセージ20またはブロック転送要求メッセージ21を受け取るまで待機する。
In step S2307, the process waits until the
続いて、ステップ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
ステップS2308に続くステップS2310では、受信したセグメントメタデータメッセージ20の階層レベル2005をチェックし、0でなければステップS2311に進み、0に等しければステップS2312に進む。
In step S2310 following step S2308, the
ステップ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
ステップ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
図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
次に、ステップS2402において、複製元ファイル複製制御手段107からいずれかのメッセージを受信するまで待機する。
In step S2402, the process waits until any message is received from the copy source file
ステップ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
ステップ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
一方、ステップ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
ステップ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
ステップS2411において、受信したブロック転送メッセージ22のファイルサイズ2203に当該ファイルのサイズを切り詰める。
In step S2411, the file size is reduced to the
ステップ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
図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
続いて、ステップ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
次に、ステップ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
続く、ステップ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
図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)に基づくgh(s)を、セグメントメタデータ2009のエントリT−1にpが指すメタデータブロックのセグメント/ブロックメタデータ(j)の値を、それぞれ設定する。
In step S2603, a segment entry is added to the
続いて、ステップS2604において、sにs+gh(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
まず、ステップS2701において、送信用のセグメントメタデータメッセージ20の初期化を行う。すなわち、メッセージ種別2001には当該メッセージが「セグメントメタデータメッセージ」であることを表す識別情報を、ファイル識別子2002、ファイルサイズ2003、およびファイルサイズ差分2004には受信したセグメントメタデータメッセージの対応する項目を、階層レベル2005に受信したセグメントメタデータメッセージの階層レベルから1を引いた値を、さらにセグメント数2006に0を、それぞれ設定する。
First, in step S2701, the
ステップ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
ステップ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
ステップ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に対応するエントリ番号jh(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とgh(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)の値に、チェックサムをサイズgh(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とgh(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)に基づくgh(s)を、セグメントメタデータ2009のエントリT−1にホールメタデータLを、それぞれ設定する。
In step S 2903, a segment entry is added to the
続いて、ステップS2904において、sにs+gh(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
ステップ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
ステップ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
ステップ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に対応するエントリ番号jh(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とg0(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)の値に、チェックサムをサイズg0(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とg0(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にg0(s)を、それぞれ設定し、終了する。
In step S 3110, a block entry is added to the block
図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
ステップ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
ステップ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
ステップ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
最後に、ステップS3208においてブロック転送メッセージ22を複製先ファイル複製制御手段207に送信する。
Finally, in step S3208, the
図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に対応するエントリ番号jh(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が指すセグメントメタデータブロックの下位メタデータブロックアドレス(jh)をチェックし、無効値であればステップ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とg0(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)の値に、チェックサムをサイズg0(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とg0(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にg0(s)を、ブロックデータ2208のエントリT−1に当該ファイルデータブロックの内容をそれぞれ設定し、終了する。
In step S3310, an entry of block data is added to the
以上のように、ファイル更新に伴ってファイルシステム管理手段105、205から呼び出され、ブロック毎の更新の有無を判定するためのメタデータを格納するブロックを木構造状に維持するメタデータブロック管理手段106、206を備えるので、ファイル複製の際に更新されていないブロックを読み出すことなく更新ブロックを検出することができ、高速なファイル複製を実現することができる。
As described above, the metadata block management unit that is called from the file
また、メタデータブロックの格納先としてデータと同じ領域を用いるので追加の記憶領域を必要としない。また、メタデータの木構造を互いに比較する複製元ファイル複製制御手段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
実施の形態2.
この発明の実施の形態2に係るファイル複製システムについて図34及び図35を参照しながら説明する。図34は、この発明の実施の形態2に係るファイル複製システムの構成を示す図である。
A file replication system according to
図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
ディスク装置108Aおよびディスク装置108Bは、独立なディスク装置であり、ディスク装置108Aには、ファイル毎にファイル管理情報(iノード)101Aが格納され、ファイルの内容は複数のファイルデータブロック102A〜Dに格納される。ディスク装置108Bには、ファイル毎にファイルメタデータ管理情報101Bが格納され、ファイルのブロック毎のメタデータを階層的に構成するブロックメタデータブロック103A〜Bとセグメントメタデータブロック104Aが格納される。ファイルデータブロック102A〜D、ブロックメタデータブロック103A〜B、セグメントメタデータブロック104Aは、上記の実施の形態1で図1に示したものと同一である。なお、ディスク装置108Aおよびディスク装置108Bは、論理的に独立であれば良く、物理的に同一のディスク装置を分割した別パーティションに対応していても良い。
The
ディスク装置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
ディスク装置108Bのファイルメタデータ管理情報101B、ブロックメタデータブロック103A〜B、およびセグメントメタデータブロック104Aは、メタデータブロック管理手段106Aにより格納・割当・解放される。また、メタデータブロック管理手段106Aは、ディスクI/O要求を受け取り、当該要求をファイルシステム管理手段105Aに受け渡すと共に、ファイルへの書き込みや切り詰めが要求された場合には上記の実施の形態1におけるメタデータブロック管理手段106と同様にメタデータブロック木構造の更新を行う。
The file
複製元ファイル複製制御手段107Aおよび複製先ファイル複製制御手段207Aは、それぞれ上記の実施の形態1の複製元ファイル複製制御手段107および複製先ファイル複製制御手段207に対応するが、メタデータブロック木構造とファイルデータブロックが異なるディスク装置上に存在することを前提として動作する点が異なる。
The replication source file
図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
メタデータブロック管理手段106Aは、上記の実施の形態1におけるメタデータブロック管理手段106と異なり、ファイル管理情報(iノード)101Aではなくファイルメタデータ管理情報101Bを参照して動作する。また、ディスク装置108Bの記憶領域の割当・解放を行うと共に、I/O要求をファイルシステム管理手段105Aに受け渡す点が上記の実施の形態1と異なる。
Unlike the metadata
以上のように、ファイルのブロック毎の更新検出を行うためのメタデータブロック木構造の情報をファイル本体とは異なるディスク装置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
実施の形態3.
この発明の実施の形態3に係るファイル複製システムについて図36を参照しながら説明する。図36は、この発明の実施の形態3に係るファイル複製システムのディスク装置に格納されるファイルデータおよびメタデータの構成を示す図である。その他の構成は、上記の実施の形態2と同様とする。
A file replication system according to
図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
メタデータファイル(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
以上のように、ファイルのブロック毎の更新検出を行うためのメタデータブロック木構造の情報をファイルとしてディスク装置に格納するので、ディスク装置の記憶領域管理に公知のファイルシステムを利用することが可能になり、容易に高速なファイル複製システムを実現することができる。 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に係るファイル複製システムの構成を示す図である。
A file replication system according to
図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
複製元として動作する際は複製元ファイル複製制御手段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
ファイル複製補助装置100Cは、ディスク装置108Bと、メタデータブロック管理手段106B、ディスクI/Fバス監視手段106C、及びメタデータブロック読出手段106Dからなる。ディスク装置108Bには、上記の実施の形態2と同様、ファイルメタデータ管理情報101B、セグメントメタデータブロック104A、およびブロックメタデータブロック103A〜Bが格納される。
The file duplication
ディスク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
ディスク装置108B上のメタデータブロックは、メタデータブロック読出手段106Dを介して複製元コンピュータまたは複製先コンピュータ100Bから読み出すことができ、複製元ファイル複製制御手段107Bや複製先ファイル複製制御手段207Bはメタデータをファイル複製補助装置100Cのメタデータブロック読出手段106Dから、ファイルデータブロックをディスク装置108Aから読み出して更新検出・データ転送を行う。
The metadata block on the
以上のように、ディスクI/Fバス1080を監視し、書き込みを自動的に検出してディスク装置毎のメタデータブロック木構造を更新するファイル複製補助装置100Cを用いるので、従来のファイルシステムやディスクI/Oに変更を加えることなく高速なファイル複製を実現することができる。
As described above, since the file duplication
実施の形態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
図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
ファイル更新ログマージ手段1063を実行するタイミングとしては、一定時間毎、一定数のファイル更新ログ情報1062を書き込んだ時、または、複製元ファイル複製制御手段107Aや複製先ファイル複製制御手段207Aが動作する前、などを用いることができる。
The timing of executing the file update log merging unit 1063 is when a certain number of file
以上のようにファイル更新やファイル切り詰めの際に操作の概要のみを記録するファイル更新ログ追加手段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
実施の形態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
メタデータブロック管理手段106や106Aは、セグメントメタデータブロック104に新たなエントリを追加する際に、最終エントリ以外の下位メタデータブロックを再帰的に解放し、下位メタデータブロックアドレスの当該エントリに無効値を設定する。複製元ファイル複製制御手段107(または107A)や複製先ファイル複製制御手段207(または207A)は、下位メタデータブロックアドレスが無効なセグメントの更新を検出した際は、セグメント全体をデータ転送の対象とする。
When adding a new entry to the
以上のように、ファイルの末尾に近いセグメントメタデータブロックのみを割り当てることで、追加書き込みが主体の大規模なファイルが作成される状況において、ほとんど更新されないメタデータブロックの割り当てを避けることができ、メタデータブロックが消費するディスク装置の記憶領域を削減することができる。 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
各ファイルに対応する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
メタデータブロック管理手段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
以上のように複数ファイルに関して更新の有無を判定する情報を階層的に保持するので、ファイルシステム全体を対象とするファイル複製を高速に実現することができる。 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.
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)
複数のコンピュータ間で前記木構造の情報ブロックに含まれる更新判定情報の比較を行って更新されたデータブロックを検出し、更新されたデータブロックのみを複製元から複製先へ転送するファイル複製制御手段と
を備えたことを特徴とするファイル複製システム。 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記載のファイル複製システム。 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記載のファイル複製システム。 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から請求項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から請求項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から請求項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.
ことを特徴とする請求項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.
ことを特徴とする請求項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のディスク装置全体を階層的に分割した領域毎の更新判定情報を第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.
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)
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)
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 |
-
2006
- 2006-01-26 JP JP2006017964A patent/JP2007200029A/en active Pending
Patent Citations (3)
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)
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 |