JP5497861B2 - Server, file management system, file management method, and file management program - Google Patents

Server, file management system, file management method, and file management program Download PDF

Info

Publication number
JP5497861B2
JP5497861B2 JP2012192477A JP2012192477A JP5497861B2 JP 5497861 B2 JP5497861 B2 JP 5497861B2 JP 2012192477 A JP2012192477 A JP 2012192477A JP 2012192477 A JP2012192477 A JP 2012192477A JP 5497861 B2 JP5497861 B2 JP 5497861B2
Authority
JP
Japan
Prior art keywords
session
file
server
master
lock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2012192477A
Other languages
Japanese (ja)
Other versions
JP2014048969A (en
Inventor
康太 上西
光一 鷲坂
公洋 山本
佑二 山田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2012192477A priority Critical patent/JP5497861B2/en
Publication of JP2014048969A publication Critical patent/JP2014048969A/en
Application granted granted Critical
Publication of JP5497861B2 publication Critical patent/JP5497861B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、ファイル管理システム等に関する。   The present invention relates to a file management system and the like.

システムの資源の共有や排他的なアクセス制御を行うこと、障害が発生した場合のシステムの可用性、一貫性を確保することは、重要な課題である。この課題を解消するための各種の従来技術が存在する。   It is important to share system resources and perform exclusive access control, and to ensure system availability and consistency in the event of a failure. There are various conventional techniques for solving this problem.

例えば、安価なハードウェアを用いた信頼性の低いネットワーク・コンピュータ・クラスタ環境において、長時間トランザクションをサポートする従来技術がある(特許文献2等)。この従来技術は、マスタの交代に備えてデータを複製(レプリケーション)することによりサーバ障害への耐障害性、トランザクションによるクライアント端末の故障に対する耐障害性を実現する。   For example, there is a conventional technology that supports long-time transactions in a low-reliability network computer cluster environment using inexpensive hardware (Patent Document 2, etc.). This prior art realizes fault tolerance against a server failure and fault tolerance against a client terminal failure due to a transaction by replicating data in preparation for a master change.

ネットワーク故障およびサーバ故障に対応した従来技術がある(非特許文献1、2等)。この従来技術は、ファイルにロックをかけるオペレーションを行うことで、ネットワーク故障、サーバ故障、クライアント故障の何れに対しても対応可能である。   There are conventional technologies that deal with network failures and server failures (Non-Patent Documents 1 and 2, etc.). This prior art can cope with any of a network failure, a server failure, and a client failure by performing an operation to lock a file.

一台のコンピュータ内で複数のプロセッサ要素が処理を並列に実行する際に、安全なカウンタを用意し、複数のプロセッサ要素が同時に取得可能な資源の数を一定数以下に制限する技術がある(非特許文献3等)。   When a plurality of processor elements execute processing in parallel in one computer, there is a technique for preparing a safe counter and limiting the number of resources that the plurality of processor elements can acquire simultaneously to a certain number or less ( Non-patent document 3).

また、従来のクライアントサーバシステム等では、クライアントがマスタの資源にアクセスする場合に、資源に対して共有ロックや排他ロックなどを行う場合があり、クライアントと各種ロックとの関係はロック情報として、サーバに管理される。   In addition, in a conventional client server system or the like, when a client accesses a master resource, a shared lock or an exclusive lock may be performed on the resource. Managed.

特開2011−210106号公報JP 2011-210106 A 特開2011−210107号公報JP2011-210107A

Mike Burrows, "The Chubby lock service for loosely-coupled distributed systems", 7th USENIX Symposium on Operating Systems Design and Implementation (OSDI), 2006. November 8Mike Burrows, "The Chubby lock service for loosely-coupled distributed systems", 7th USENIX Symposium on Operating Systems Design and Implementation (OSDI), 2006. November 8 Tushar Chandra et al., "Paxos Made Live - An Engineering Perspective," PODC'07, 2007.Tushar Chandra et al., "Paxos Made Live-An Engineering Perspective," PODC'07, 2007. Dijkstra, Edsger W. Cooperating sequential processes (EWD-123). E.W. Dijkstra Archive. Center for American History, University of Texas at Austin. (original; transcription) (September 1965)Dijkstra, Edsger W. Cooperating sequential processes (EWD-123). E.W.Dijkstra Archive. Center for American History, University of Texas at Austin. (Original; transcription) (September 1965)

しかしながら、同期する複数のサーバ間でネットワークが分散した場合に、同一のネットワーク内に含まれる複数のサーバから単一のマスタを選出するようなシステムでは、マスタの故障により資源に対するクライアントのロック情報を他のサーバが引き継ぐことが行われるが、係るロック情報に矛盾が発生するという問題があった。上述した従来技術では、係る問題点を解消することが出来ない。   However, in a system in which a single master is selected from a plurality of servers included in the same network when the network is distributed among a plurality of servers to be synchronized, the lock information of the client with respect to resources due to the failure of the master is displayed. Although another server takes over, there is a problem that inconsistency occurs in the lock information. In the above-described conventional technology, such a problem cannot be solved.

開示の実施形態は、上記に鑑みてなされたものであって、同期する複数のサーバ間でネットワークが分散した場合に、同一のネットワーク内に含まれる複数のサーバから単一のマスタを選出するようなシステムにおいて、マスタの故障により資源に対するクライアントのロック情報を他のサーバが引き継ぐ際に、係るロック情報に矛盾発生することを防止することができるサーバ、ファイル管理システム、ファイル管理方法およびファイル管理プログラムを提供することを目的とする。   The embodiment of the disclosure is made in view of the above, and when a network is distributed among a plurality of servers to be synchronized, a single master is selected from a plurality of servers included in the same network. Server, file management system, file management method, and file management program capable of preventing inconsistency in lock information when another server takes over the lock information of a client for a resource due to a master failure The purpose is to provide.

本発明に係るサーバは、マスタ調整部と、要求処理部と、レプリケーション部と、復元処理部を有する。マスタ調整部は、同一のネットワークに含まれる複数の他のサーバおよび自サーバから、マスタの役割を有する単一のサーバを選出する。要求処理部は、自サーバがマスタの役割を有するサーバである場合に、クライアントからの接続要求に応答して、クライアントにセッションIDを発行し、該セッションIDをセッションテーブルに登録すると共に、クライアントからのファイル処理要求に応じて、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録する際に、ファイルに対するロックの数が閾値未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録し、ファイルに対するロックの数が閾値に達している場合には、ファイルに対するロック情報とセッションIDとを対応付けてロック待ちセッションに登録し、ファイルに対するロックの数が閾値未満となった時点で、ロック待ちセッションに登録されたファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録する。また、要求処理部は、セッションIDを発行して接続したクライアントに情報を送信して監視し、該クライアントからの応答が届かない場合には、クライアントに発行したセッションIDに対応するロック情報を、ファイル管理テーブルから削除する。レプリケーション部は、自サーバがレプリカの役割を有するサーバである場合に、マスタの役割を有するサーバのセッションテーブルとファイル管理テーブルとを複製する。復元処理部は、自サーバがレプリカの役割を有するサーバから、マスタの役割を有するサーバに切り替わった場合には、セッションテーブルの情報を削除待ちセッションテーブルに登録し、クライアントからの再接続要求に応答して、該再接続要求に含まれるセッションIDと同一のセッションIDを削除待ちセッションテーブルから削除し、該削除待ちセッションテーブルに残されたセッションIDに対応するロック情報を、ファイル管理テーブルから削除する。   The server according to the present invention includes a master adjustment unit, a request processing unit, a replication unit, and a restoration processing unit. The master adjustment unit selects a single server having a master role from a plurality of other servers and its own server included in the same network. The request processing unit issues a session ID to the client in response to a connection request from the client, and registers the session ID in the session table in response to a connection request from the client when the server is a server having a master role. When the lock information for the file and the session ID are registered in the file management table in association with the file processing request, if the number of locks for the file is less than the threshold, the lock information for the file and the session ID are If the number of locks on the file has reached the threshold, the lock information for the file and the session ID are registered in association with the lock waiting session, and the number of locks on the file is When it becomes less than the threshold, In association with the lock information and the session ID for the registered file in Deployment is registered in the file management table. Further, the request processing unit issues a session ID to send information to the connected client for monitoring, and when a response from the client does not arrive, lock information corresponding to the session ID issued to the client, Delete from the file management table. The replication unit replicates the session table and file management table of the server having the master role when the local server is a server having the role of replica. When the local server switches from the server having the role of replica to the server having the role of master, the restoration processing unit registers the information of the session table in the session table waiting for deletion and responds to the reconnection request from the client. Then, the same session ID as the session ID included in the reconnection request is deleted from the deletion waiting session table, and the lock information corresponding to the session ID remaining in the deletion waiting session table is deleted from the file management table. .

本発明に係るサーバによれば、同期する複数のサーバ間でネットワークが分散した場合に、同一のネットワーク内に含まれる複数のサーバから単一のマスタを選出するようなシステムにおいて、マスタの故障により資源に対するクライアントのロック情報を他のサーバが引き継ぐ際に、係るロック情報に矛盾発生することを防止することができるという効果を奏する。   According to the server according to the present invention, in a system in which a single master is selected from a plurality of servers included in the same network when a network is distributed among a plurality of servers to be synchronized, When another server takes over the lock information of the client for the resource, it is possible to prevent the occurrence of contradiction in the lock information.

図1は、本実施形態に係るファイル管理システムの構成を示す図である。FIG. 1 is a diagram showing a configuration of a file management system according to the present embodiment. 図2は、本実施形態に係るサーバの構成を示す機能ブロック図である。FIG. 2 is a functional block diagram showing the configuration of the server according to the present embodiment. 図3は、本実施形態に係るセッションテーブルのデータ構造の一例を示す図である。FIG. 3 is a diagram illustrating an example of the data structure of the session table according to the present embodiment. 図4は、本実施形態に係る削除待ちセッションテーブルのデータ構造の一例を示す図である。FIG. 4 is a diagram showing an example of the data structure of the deletion waiting session table according to the present embodiment. 図5は、本実施形態に係るファイル管理テーブルのデータ構造の一例を示す図である。FIG. 5 is a diagram showing an example of the data structure of the file management table according to the present embodiment. 図6は、本実施形態に係るクライアントの構成を示す機能ブロック図である。FIG. 6 is a functional block diagram showing the configuration of the client according to the present embodiment. 図7は、本実施形態に係るサーバの処理手順を示すフローチャートである。FIG. 7 is a flowchart showing a processing procedure of the server according to the present embodiment. 図8は、セッションを復元する処理の処理手順を示すフローチャートである。FIG. 8 is a flowchart illustrating a processing procedure of processing for restoring a session. 図9は、セッション削除処理の処理手順を示すフローチャートである。FIG. 9 is a flowchart showing a processing procedure of session deletion processing. 図10は、要求受け付け処理の処理手順を示すフローチャートである。FIG. 10 is a flowchart showing a processing procedure of request acceptance processing. 図11は、クライアント監視処理の処理手順を示すフローチャートである。FIG. 11 is a flowchart illustrating a processing procedure of client monitoring processing. 図12は、閉塞処理の処理手順を示すフローチャートである。FIG. 12 is a flowchart showing the procedure of the blocking process. 図13は、排他ロック取得要求を受け付けた場合の処理手順を示すフローチャートである。FIG. 13 is a flowchart showing a processing procedure when an exclusive lock acquisition request is received. 図14は、排他ロック解放要求を受け付けた場合の処理手順を示すフローチャートである。FIG. 14 is a flowchart illustrating a processing procedure when an exclusive lock release request is received. 図15は、共有ロック取得要求を受け付けた場合の処理手順を示すフローチャートである。FIG. 15 is a flowchart illustrating a processing procedure when a shared lock acquisition request is received. 図16は、共有ロック解放要求を受け付けた場合の処理手順を示すフローチャートである。FIG. 16 is a flowchart illustrating a processing procedure when a shared lock release request is received. 図17は、本実施形態に係るクライアントの処理手順を示すフローチャートである。FIG. 17 is a flowchart showing the processing procedure of the client according to the present embodiment. 図18は、サーバと同様の機能を実現する制御プログラムを実行するコンピュータの一例を示す図である。FIG. 18 is a diagram illustrating an example of a computer that executes a control program that implements the same function as the server.

以下に、本願の開示するサーバ、ファイル管理システム、ファイル管理方法およびファイル管理プログラムの実施形態を図面に基づいて詳細に説明する。なお、この実施形態によりこの発明が限定されるものではない。   Hereinafter, embodiments of a server, a file management system, a file management method, and a file management program disclosed in the present application will be described in detail with reference to the drawings. In addition, this invention is not limited by this embodiment.

(実施形態)
本実施形態に係るファイル管理システムの構成について説明する。図1は、本実施形態に係るファイル管理システムの構成を示す図である。図1に示すように、このファイル管理システムは、サーバ100a,100b,100c,100d,100eと、クライアント200a,200bと、アプリケーション60を有する。サーバ100a〜100e、クライアント200a,200bは、ネットワーク50に接続される。
(Embodiment)
A configuration of the file management system according to the present embodiment will be described. FIG. 1 is a diagram showing a configuration of a file management system according to the present embodiment. As shown in FIG. 1, the file management system includes servers 100a, 100b, 100c, 100d, and 100e, clients 200a and 200b, and an application 60. The servers 100a to 100e and the clients 200a and 200b are connected to the network 50.

図1では一例として、サーバ100a〜100e、クライアント200a,200bを示すが、このシステムは、その他のサーバ、クライアントを有していても良い。以下の説明では、サーバ100a〜100eをまとめて適宜サーバ100と表記する。クライアント200a,200bをまとめて適宜クライアント200と表記する。   In FIG. 1, the servers 100a to 100e and the clients 200a and 200b are shown as an example, but this system may include other servers and clients. In the following description, the servers 100a to 100e are collectively referred to as the server 100 as appropriate. The clients 200a and 200b are collectively referred to as the client 200 as appropriate.

各サーバ100は、Paxos等の多数決プロトコルを用いて、同一のネットワークに含まれるサーバ100から、単一のマスタを選出する。多数決プロトコルを用いて、単一のマスタを選出する技術は、例えば、特許文献1、2の技術を用いれば良い。マスタに選出されたサーバは、マスタの機能を有するサーバとして機能する。一方、マスタに選出されなかったサーバは、レプリカの役割を有するサーバとして機能する。以下の説明において、適宜、マスタの役割を有するサーバをマスタ、レプリカの役割を有するサーバをレプリカと表記する。   Each server 100 selects a single master from the servers 100 included in the same network using a majority protocol such as Paxos. As a technique for selecting a single master using the majority protocol, for example, the techniques of Patent Documents 1 and 2 may be used. The server elected as the master functions as a server having the master function. On the other hand, a server that is not elected as a master functions as a server having a role of a replica. In the following description, a server having a master role is referred to as a master, and a server having a replica role is appropriately referred to as a replica.

例えば、図1において、サーバ100a〜100eが同一のネットワークに含まれ、サーバ100aがマスタとして選出されたとする。この場合には、サーバ100aは、マスタの役割を有するサーバとして機能し、サーバ100b〜100eは、レプリカの役割を有するサーバとして機能する。   For example, in FIG. 1, it is assumed that the servers 100a to 100e are included in the same network and the server 100a is selected as a master. In this case, the server 100a functions as a server having a master role, and the servers 100b to 100e function as servers having a replica role.

マスタの役割を有するサーバ100は、クライアント200からの接続要求に応答して、接続を確立する。マスタの役割を有するサーバ100は、クライアント200からのファイル処理要求に応じて、ファイルにロックをかける。ファイルにかけるロックは、共有ロックまたは排他ロックである。マスタの役割を有するサーバ100は、ファイルに対するロック情報を記憶すると共に、このロック情報を、レプリカの役割を有するサーバ100に通知し、複製(レプリケーション)させる。   The server 100 having the master role establishes a connection in response to a connection request from the client 200. The server 100 having the master role locks the file in response to the file processing request from the client 200. The lock applied to the file is a shared lock or an exclusive lock. The server 100 having the master role stores the lock information for the file, and notifies the server 100 having the replica role of the lock information for replication.

また、レプリカの役割を有するサーバ100が、マスタの役割を有するサーバ100に切り替わった場合には、クライアント200から再接続要求を受け付ける。マスタの役割を有するサーバ100は、複製しておいたロック情報について、再接続要求を受け付けクライアントに対応するロック情報を残し、その他のロック情報を削除する。このような処理を実行することで、ロック情報に矛盾が発生することを防止する。   When the server 100 having the role of replica switches to the server 100 having the role of master, a reconnection request is accepted from the client 200. The server 100 having the master role accepts a reconnection request for the copied lock information, leaves the lock information corresponding to the client, and deletes other lock information. By executing such processing, it is possible to prevent inconsistencies in the lock information.

クライアント200は、マスタの役割を有するサーバ100と接続を確立した後に、アプリケーション60からの指示に応じて、ファイルに対する処理を実行する。例えば、クライアント200は、ファイルに共有ロックまたは排他ロックをかけ、ファイルに対する処理を実行する。   After establishing a connection with the server 100 having the master role, the client 200 executes processing on the file in accordance with an instruction from the application 60. For example, the client 200 applies a shared lock or an exclusive lock to the file, and executes processing on the file.

また、クライアント200は、マスタの役割を有するサーバ100が切り替わった場合には、マスタの役割を有するサーバ100に再接続要求を行い、ファイルに対する処理を継続する。なお、クライアント200は、再接続に失敗した場合には、アプリケーション60に対して、再接続に失敗した旨を通知し、ファイルに対する処理を中止する。   In addition, when the server 100 having the master role is switched, the client 200 makes a reconnection request to the server 100 having the master role, and continues the processing on the file. Note that if the reconnection fails, the client 200 notifies the application 60 that the reconnection has failed and stops processing the file.

次に、図1に示したサーバ100の構成の一例について説明する。図2は、本実施形態に係るサーバの構成を示す機能ブロック図である。図2に示すように、このサーバ100は、通信部110、記憶部140、制御部150を有する。   Next, an example of the configuration of the server 100 illustrated in FIG. 1 will be described. FIG. 2 is a functional block diagram showing the configuration of the server according to the present embodiment. As illustrated in FIG. 2, the server 100 includes a communication unit 110, a storage unit 140, and a control unit 150.

通信部110は、ネットワーク50に接続された他の装置との間でデータ通信を実行する通信装置である。例えば、通信部110は、クライアント200、他のサーバ100とデータ通信を行う。後述する制御部150は、この通信部110を利用して、クライアント200、他のサーバ200とデータをやり取りする。   The communication unit 110 is a communication device that performs data communication with other devices connected to the network 50. For example, the communication unit 110 performs data communication with the client 200 and another server 100. A control unit 150 (described later) uses the communication unit 110 to exchange data with the client 200 and other servers 200.

記憶部140は、セッションテーブル140a、削除待ちセッションテーブル140b、ファイル管理テーブル140cを記憶する記憶装置である。   The storage unit 140 is a storage device that stores a session table 140a, a deletion waiting session table 140b, and a file management table 140c.

セッションテーブル140aは、マスタの役割を有するサーバ100とクライアント200とのセッションに関する情報を有するテーブルである。図3は、本実施形態に係るセッションテーブルのデータ構造の一例を示す図である。図3に示すように、セッションテーブル140aは、セッションIDと、クライアント情報と、ロックファイルのエントリとを対応付ける。このうち、セッションID(Identifier)は、マスタの役割を有するサーバ100と、クライアント200との間で確立されるセッションを識別する情報である。クライアント情報は、クライアント200を一意に識別する情報であり、例えば、クライアント200のIP(Internet Protocol)アドレスに対応する。ロックファイルのエントリは、ロックをかけられたファイルを一意に識別するファイルID(Fid)と、ロックの種別とを示す情報である。ロックの種別には、共有ロック、排他ロックが含まれる。   The session table 140a is a table having information related to a session between the server 100 having a master role and the client 200. FIG. 3 is a diagram illustrating an example of the data structure of the session table according to the present embodiment. As shown in FIG. 3, the session table 140a associates a session ID, client information, and a lock file entry. Among these, the session ID (Identifier) is information for identifying a session established between the server 100 having a master role and the client 200. The client information is information for uniquely identifying the client 200, and corresponds to, for example, the IP (Internet Protocol) address of the client 200. The entry of the lock file is information indicating a file ID (Fid) that uniquely identifies the locked file and the type of lock. The lock type includes a shared lock and an exclusive lock.

例えば、図3の2段目を例にして説明すると、セッションID「2」によって、マスタの役割を有するサーバ100とクライアント200とが接続しており、係るクライアント200のクライアント情報は「192.10.10.15」である。また、クライアント200は、ファイルID「1」のファイルに共有ロックをかけている。   For example, referring to the second row in FIG. 3, the server 100 having the role of master and the client 200 are connected by the session ID “2”, and the client information of the client 200 is “192.168.”. .10.15 ". Further, the client 200 locks the file with the file ID “1”.

削除待ちセッションテーブル140bは、マスタの役割を有するサーバ100が切り替わった場合に、復元できなかったセッションに関する情報を有するテーブルである。図4は、本実施形態に係る削除待ちセッションテーブルのデータ構造の一例を示す図である。図4に示すように、この削除待ちセッションテーブル140bは、セッションIDと、クライアント情報と、ロックファイルのエントリとを対応付ける。セッションID、クライアント情報、ロックファイルのエントリに関する説明は、図3に示したセッションテーブル140aと同様である。   The deletion-waiting session table 140b is a table having information on a session that could not be restored when the server 100 having the master role is switched. FIG. 4 is a diagram showing an example of the data structure of the deletion waiting session table according to the present embodiment. As shown in FIG. 4, this deletion waiting session table 140b associates session IDs, client information, and lock file entries. The description of the session ID, client information, and lock file entry is the same as that of the session table 140a shown in FIG.

例えば、図4の2段目を例にして説明すると、セッションID「2」によって識別されるセッションが復元できなかったため、クライアント情報「192.10.10.15」のクライアント200との接続が確立していないのに、このクライアント200によって、ファイルID「1」のファイルに共有ロックがかかった状態になっている。この共有ロックは、後述する復元処理部150dによって解除される。   For example, taking the second row in FIG. 4 as an example, since the session identified by the session ID “2” could not be restored, the connection with the client 200 having the client information “192.168.1.15” is established. However, the client 200 is in a state in which a shared lock is applied to the file with the file ID “1”. This shared lock is released by the restoration processing unit 150d described later.

ファイル管理テーブル140cは、ファイルに対するロック情報を有するテーブルである。図5は、本実施形態に係るファイル管理テーブルのデータ構造の一例を示す図である。図5に示すように、このファイル管理テーブルは、ファイルIDと、ロック上限数と、ロック中セッションと、ロック待ちセッションとを対応付ける。   The file management table 140c is a table having lock information for files. FIG. 5 is a diagram showing an example of the data structure of the file management table according to the present embodiment. As shown in FIG. 5, this file management table associates a file ID, the upper limit number of locks, a locked session, and a lock waiting session.

ファイルID(Fid)は、ファイルを一意に識別する情報である。ロック上限数は、単一のファイルに対して、同時にロックをかけられる共有ロックの最大数である。なお、ロック上限数に関わらず、単一のファイルに対して、同時にロックをかけられる排他ロックの数は1である。   The file ID (Fid) is information for uniquely identifying a file. The upper limit number of locks is the maximum number of shared locks that can be locked simultaneously for a single file. Note that the number of exclusive locks that can be locked simultaneously for a single file is one regardless of the upper limit number of locks.

ロック中セッションは、該当ファイルにロックをかけているセッションIDとロックの種類とを示す。ロック待ちセッションは、該当ファイルに対するロック待ちを行っているセッションIDとロックの種類とを示す。ロック待ちセッションは、ロック中セッションに空きが出来た場合に、登録された順番で、ロック中セッションに移行する。   The in-lock session indicates a session ID that locks the file and the type of lock. The lock waiting session indicates the session ID and lock type for which the corresponding file is waiting to be locked. When there is a vacant session in the locked session, the lock waiting session shifts to the locked session in the registered order.

例えば、図5の1段目を例にして説明すると、ファイルID「1」のファイル上限数は「2」であり、ファイルID「1」のファイルに対して、2つの共有ロックがかけられている。係るロックは、セッションID「2」による共有ロックと、セッションID「3」による共有ロックである。また、ロック待ちセッションでは、セッションID「4」による排他ロック、セッションID「28」による共有ロックの順で、ロック待ちが発生している。   For example, taking the first row in FIG. 5 as an example, the upper limit number of files with file ID “1” is “2”, and two shared locks are applied to the file with file ID “1”. Yes. Such locks are a shared lock with a session ID “2” and a shared lock with a session ID “3”. Further, in the lock waiting session, lock waiting occurs in the order of the exclusive lock by the session ID “4” and the shared lock by the session ID “28”.

図2の説明に戻る。制御部150は、マスタ調整部150a、レプリケーション部150b、要求処理部150c、復元処理部150dを有する。   Returning to the description of FIG. The control unit 150 includes a master adjustment unit 150a, a replication unit 150b, a request processing unit 150c, and a restoration processing unit 150d.

マスタ調整部150aは、Paxos等の多数決プロトコルを用いて、同一のネットワークに含まれるサーバ100から、単一のマスタを選出する処理部である。マスタ調整部150aは、自サーバ100が、マスタとして選出されたか否かの情報を、レプリケーション部150b、要求処理部150c、復元処理部150dに出力する。   The master adjustment unit 150a is a processing unit that selects a single master from the servers 100 included in the same network using a majority protocol such as Paxos. The master adjustment unit 150a outputs information on whether or not the server 100 is selected as a master to the replication unit 150b, the request processing unit 150c, and the restoration processing unit 150d.

マスタ調整部150aは、マスタを選出したことを契機にして、次回マスタ選出タイマ(図示略)をセットし、この次回マスタ選出タイマがタイムアウトしたら、再度マスタを選出する。すなわち、マスタ調整部150aは、次回マスタ選出タイマを利用して、所定の時間間隔で、マスタを選出する処理を繰り返し実行する。   The master adjustment unit 150a sets a next master selection timer (not shown) when the master is selected, and selects the master again when the next master selection timer times out. That is, the master adjustment unit 150a repeatedly executes a process of selecting a master at a predetermined time interval using a next master selection timer.

レプリケーション部150bは、記憶部140に格納された情報を複製する処理部である。自サーバ100がマスタである場合には、記憶部140のセッションテーブル140a、ファイル管理テーブル140cを、レプリカの役割を有するサーバ100に通知することで、レプリケーション要求を行う。   The replication unit 150 b is a processing unit that replicates information stored in the storage unit 140. When the local server 100 is a master, a replication request is made by notifying the server 100 having the role of a replica of the session table 140a and the file management table 140c in the storage unit 140.

これに対して、自サーバ100がレプリカの場合には、マスタの役割を有するサーバ100からのレプリケーション要求を受け付ける。そして、自サーバ100は、マスタの役割を有するサーバ100のセッションテーブル140a、ファイル管理テーブル140cを複製して、記憶部140に記憶する。   On the other hand, when the local server 100 is a replica, it receives a replication request from the server 100 having the master role. Then, the own server 100 duplicates the session table 140 a and the file management table 140 c of the server 100 having the role of the master and stores it in the storage unit 140.

レプリケーション部150bは、マスタ調整部150aによって、マスタの選定が行われたことを契機にして、マスタリータイマ(図示略)をセットする。レプリケーション部150bは、マスタリータイマがタイムアウトするまでの間、上記処理を繰り返し実行する。   The replication unit 150b sets a mastery timer (not shown) when the master is selected by the master adjustment unit 150a. The replication unit 150b repeatedly executes the above process until the mastery timer times out.

また、レプリケーション部150bは、自サーバ100がマスタの役割を有するサーバ100である場合に、セッションテーブル140a、ファイル管理テーブル140cが更新された場合にも、セッションテーブル140a、ファイル管理テーブル140cを、レプリカの役割を有するサーバ100に通知することで、レプリケーション要求を行う。   In addition, when the local server 100 is the server 100 having the role of the master and the session table 140a and the file management table 140c are updated, the replication unit 150b transmits the session table 140a and the file management table 140c to the replica. A replication request is made by notifying the server 100 having the above role.

要求処理部150cは、自サーバ100がマスタに選出された場合に動作し、クライアント200とのセッションを確立して、ファイル処理要求に応じて処理を行う処理部である。まず、要求処理部150cは、クライアント200からの接続要求に応答して、クライアント200にユニークなセッションIDを発行し、発行したセッションIDとクライアント200のIPアドレスとを対応付けて、セッションテーブル140aに登録する。   The request processing unit 150c is a processing unit that operates when the server 100 is elected as a master, establishes a session with the client 200, and performs processing in response to a file processing request. First, in response to a connection request from the client 200, the request processing unit 150c issues a unique session ID to the client 200, associates the issued session ID with the IP address of the client 200, and stores it in the session table 140a. sign up.

要求処理部150cは、セッションIDを発行して、クライアント200とのセッションが確立した後に、クライアント200からのファイル処理要求に応答して、セッションテーブル140aおよびファイル管理テーブル140cを更新する。例えば、クライアント200から受け付けるファイル処理要求には、排他ロック取得要求、排他ロック解放要求、共有ロック取得要求、共有ロック解放要求のいずれかが含まれる。以下では、排他ロック取得要求、排他ロック解放要求、共有ロック取得要求、共有ロック解放要求を受け付けた場合の、要求処理部150cの処理について順に説明する。   The request processing unit 150c issues a session ID and establishes a session with the client 200, and then updates the session table 140a and the file management table 140c in response to a file processing request from the client 200. For example, the file processing request received from the client 200 includes any of an exclusive lock acquisition request, an exclusive lock release request, a shared lock acquisition request, and a shared lock release request. Hereinafter, processing of the request processing unit 150c when an exclusive lock acquisition request, an exclusive lock release request, a shared lock acquisition request, and a shared lock release request are received will be described in order.

要求処理部150cが「排他ロック取得要求」を取得した場合の処理について説明する。この排他ロック取得要求には、処理対象となるファイルIDが含まれる。要求処理部150cは、セッションIDに対応付けて、ロックファイルのエントリをセッションテーブル140aに登録する。例えば、セッションIDが「4」で、ファイルID「1」に対する排他ロックを要求されている場合には、要求処理部150cは、図3の4段目のロックファイルのエントリ「Fid=1(排他)」を、セッションテーブル140aに登録する。   Processing when the request processing unit 150c acquires an “exclusive lock acquisition request” will be described. This exclusive lock acquisition request includes the file ID to be processed. The request processing unit 150c registers the lock file entry in the session table 140a in association with the session ID. For example, when the session ID is “4” and an exclusive lock for the file ID “1” is requested, the request processing unit 150c determines that the entry “Fid = 1 (exclusive) in the fourth-stage lock file in FIG. Is registered in the session table 140a.

要求処理部150cは、ファイル管理テーブル140cを参照し、ファイルIDに対応するロック中セッションが存在するか否かを判定する。要求処理部150cは、ロック中セッションが存在しない場合には、該当するロック中セッションに、セッションIDとロック種別(排他ロック)とを対応付けて登録する。これに対して、要求処理部150cは、ロック中セッションが存在する場合には、セッションIDとロック種別(排他ロック)とを対応付けてロック待ちセッションに登録する。   The request processing unit 150c refers to the file management table 140c and determines whether there is a locked session corresponding to the file ID. When there is no locked session, the request processing unit 150c registers the session ID and the lock type (exclusive lock) in association with the corresponding locked session. On the other hand, when there is a locked session, the request processing unit 150c associates the session ID with the lock type (exclusive lock) and registers it in the lock waiting session.

続いて、要求処理部150cが「排他ロック解放要求」を取得した場合の処理について説明する。この排他ロック解放要求には、処理対象となるファイルIDが含まれる。要求処理部150cは、セッションIDに対応する、ロックファイルのエントリをセッションテーブル140aから削除する。例えば、セッションIDが「4」で、ファイルID「1」に対する排他ロックの解放を要求されている場合には、要求処理部150cは、図3の4段目のロックファイルのエントリ「Fid=1(排他)」を、セッションテーブル140aから削除する。   Next, processing when the request processing unit 150c acquires an “exclusive lock release request” will be described. This exclusive lock release request includes the file ID to be processed. The request processing unit 150c deletes the lock file entry corresponding to the session ID from the session table 140a. For example, when the session ID is “4” and the release of the exclusive lock for the file ID “1” is requested, the request processing unit 150c sets the entry “Fid = 1” in the lock file in the fourth row in FIG. (Exclusive) "is deleted from the session table 140a.

要求処理部150cは、ファイル管理テーブル140cを参照し、ファイルIDに対応するロック中セッションから値を削除する。例えば、セッションID「4」で、ファイルID「1」に対して排他ロックを行っていた場合には、ファイルID「1」のロック中セッションから値「Sid=4(排他)」を、ファイル管理テーブル140cから削除する。   The request processing unit 150c refers to the file management table 140c and deletes the value from the locked session corresponding to the file ID. For example, when the exclusive lock is performed on the file ID “1” with the session ID “4”, the value “Sid = 4 (exclusive)” from the locked session of the file ID “1” is set to the file management. Delete from table 140c.

要求処理部150cは、ファイル管理テーブル140cから値を削除した後に、該当するファイルIDのロック待ちセッションの先頭のエントリを取り出し、ロック中セッションの値に追加する。要求処理部150cは、追加する値のロック種別が共有ロックの場合には、ロック上限数を超えない範囲内で、ロック中セッションに値を追加する処理を繰り返し実行する。   After deleting the value from the file management table 140c, the request processing unit 150c extracts the top entry of the lock waiting session for the corresponding file ID and adds it to the value of the locked session. When the lock type of the value to be added is shared lock, the request processing unit 150c repeatedly executes a process of adding a value to the locked session within a range not exceeding the lock upper limit number.

続いて、要求処理部150cが「共有ロック取得要求」を取得した場合の処理について説明する。この共有ロック取得要求には、処理対象となるファイルIDが含まれる。要求処理部150cは、セッションIDに対応付けて、ロックファイルのエントリをセッションテーブルに登録する。例えば、セッションIDが「2」で、ファイルID「1」に対する共有ロックを要求されている場合には、要求処理部150cは、図3の2段目に示すファイルのエントリ「Fid=1(共有)」を、セッションテーブル140aに登録する。   Next, processing when the request processing unit 150c acquires a “shared lock acquisition request” will be described. This shared lock acquisition request includes the file ID to be processed. The request processing unit 150c registers the lock file entry in the session table in association with the session ID. For example, when the session ID is “2” and the sharing lock for the file ID “1” is requested, the request processing unit 150c performs the entry “Fid = 1 (shared) in the second row in FIG. Is registered in the session table 140a.

要求処理部150cは、ファイル管理テーブル140cのファイルIDに対応するロック中セッションを参照する。ロック中セッションにおいて、共有ロックの数がロック上限数未満の場合、または、排他ロックがかけられていない場合には、要求処理部150cは、該当するロック中セッションに、セッションIDとロック種別(共有ロック)とを対応付けて登録する。   The request processing unit 150c refers to the locked session corresponding to the file ID in the file management table 140c. When the number of shared locks in the locked session is less than the upper limit number of locks or when an exclusive lock is not applied, the request processing unit 150c sets the session ID and the lock type (shared) to the corresponding locked session. Lock) and register.

これに対して、要求処理部150cは、ロック中セッションにおいて、共有ロックの数がロック上限数以上の場合、または、排他ロックがかけられている場合には、セッションIDとロック種別(共有ロック)とを対応付けてロック待ちセッションに登録する。   In contrast, in the locked session, the request processing unit 150c determines the session ID and the lock type (shared lock) when the number of shared locks is equal to or greater than the upper limit number of locks or when an exclusive lock is applied. Are registered in the lock waiting session.

続いて、要求処理部150cが「共有ロック解放要求」を取得した場合の処理について説明する。この共有ロック解放要求には、処理対象となるファイルIDが含まれる。要求処理部150cは、セッションIDに対応する、ロックファイルのエントリをセッションテーブル140aから削除する。例えば、要求処理部150cは、セッションIDが「2」で、ファイルID「1」に対する共有ロックの解放を要求されている場合には、図3の2段目のロックファイルのエントリ「Fid=1(共有)」を、セッションテーブル140aから削除する。   Next, processing when the request processing unit 150c acquires a “shared lock release request” will be described. This shared lock release request includes the file ID to be processed. The request processing unit 150c deletes the lock file entry corresponding to the session ID from the session table 140a. For example, when the session ID is “2” and the request to release the shared lock for the file ID “1” is requested, the request processing unit 150c has the entry “Fid = 1” in the second-stage lock file in FIG. (Shared) ”is deleted from the session table 140a.

要求処理部150cは、ファイル管理テーブル140cを参照し、ファイルIDに対応するロック中セッションから値を削除する。例えば、セッションID「2」で、ファイルID「1」に対して排他ロックを行っていた場合には、ファイルID「1」のロック中セッションから値「Sid=2(共有)」を、ファイル管理テーブル140cから削除する。   The request processing unit 150c refers to the file management table 140c and deletes the value from the locked session corresponding to the file ID. For example, if the session ID “2” and the file ID “1” are exclusively locked, the value “Sid = 2 (shared)” from the locked session of the file ID “1” is set to the file management. Delete from table 140c.

要求処理部150cは、ファイル管理テーブル140cから値を削除した後に、該当するファイルIDのロック待ちセッションの先頭のエントリを取り出し、ロック中セッションの値に追加する。要求処理部150cは、追加する値のロック種別が共有ロックの場合には、ロック上限数を超えない範囲内で、ロック中セッションに値を追加する処理を繰り返し実行する。   After deleting the value from the file management table 140c, the request processing unit 150c extracts the top entry of the lock waiting session for the corresponding file ID and adds it to the value of the locked session. When the lock type of the value to be added is shared lock, the request processing unit 150c repeatedly executes a process of adding a value to the locked session within a range not exceeding the lock upper limit number.

上記のように、要求処理部150cは、クライアント200から接続要求を受け付けてセッションを確立した後に、クライアント200からのファイル処理要求には、排他ロック取得要求、排他ロック解放要求、共有ロック取得要求、共有ロック解放要求に応答して、セッションテーブル140a、ファイル管理テーブル140cを更新する。   As described above, after the request processing unit 150c receives a connection request from the client 200 and establishes a session, the file processing request from the client 200 includes an exclusive lock acquisition request, an exclusive lock release request, a shared lock acquisition request, In response to the shared lock release request, the session table 140a and the file management table 140c are updated.

また、要求処理部150cは、セッションを確立したクライアント200に対して、定期的にpingを送信することで、クライアント200を監視する。要求処理部150cは、pingを送信してから、所定の時間以内に、クライアント200からの応答を受け付けない場合には、該クライアント200に対応するセッションIDによって、ロックされているファイルを解放する。例えば、要求処理部150cは、セッションID「2」によってセッションを確立したクライアント200からpingの応答を受け付けない場合には、図5のファイル管理テーブルのロック中セッションの値「Sid=2(共有)」を削除する。なお、ロック中セッションを削除して、ロック待ちセッションの値をロック中セッションに追加する処理は、排他ロック解放要求、共有ロック解放要求を取得した場合の処理と同様である。   Further, the request processing unit 150c monitors the client 200 by periodically sending a ping to the client 200 that has established a session. When the request processing unit 150c does not accept a response from the client 200 within a predetermined time after transmitting the ping, the request processing unit 150c releases the locked file with the session ID corresponding to the client 200. For example, when the request processing unit 150c does not accept a ping response from the client 200 that has established a session with the session ID “2”, the value “Sid = 2 (shared) of the locked session in the file management table of FIG. "Is deleted. The process of deleting the locked session and adding the value of the lock waiting session to the locked session is the same as the process when the exclusive lock release request and the shared lock release request are acquired.

復元処理部150dは、自サーバ100がレプリカの役割を有するサーバから、マスタの役割を有するサーバに切り替わった場合に動作し、クライアント200とのセッションを復元する処理部である。まず、復元処理部150dは、セッションテーブル140aに登録された全情報を、削除待ちセッションテーブル140bへ書き込み、セッション削除タイマ(図示略)をセットする。また、復元処理部150dは、セッションテーブル140aの全情報を削除する。   The restoration processing unit 150d is a processing unit that operates when the server 100 switches from a server having a replica role to a server having a master role, and restores a session with the client 200. First, the restoration processing unit 150d writes all information registered in the session table 140a to the deletion waiting session table 140b, and sets a session deletion timer (not shown). In addition, the restoration processing unit 150d deletes all information in the session table 140a.

復元処理部150dは、セッション削除タイマがタイムアウトする前に、クライアント200から再接続要求を受け付ける。この再接続要求には、マスタの役割を有するサーバが切り替わる前に、このサーバから発行されたセッションIDが含まれる。復元処理部150dは、再接続要求に含まれるセッションIDと、削除待ちセッションテーブル140bとを比較し、再接続要求に含まれるセッションIDと同一のセッションIDを有するレコードを、削除待ちセッションテーブル140bから削除する。また、復元処理部150dは、再接続要求に含まれるセッションIDを、セッションテーブル140aに登録する。   The restoration processing unit 150d receives a reconnection request from the client 200 before the session deletion timer times out. This reconnection request includes the session ID issued from this server before the server having the master role is switched. The restoration processing unit 150d compares the session ID included in the reconnection request with the deletion waiting session table 140b, and records a record having the same session ID as the session ID included in the reconnection request from the deletion waiting session table 140b. delete. In addition, the restoration processing unit 150d registers the session ID included in the reconnection request in the session table 140a.

復元処理部150dは、セッション削除タイマがタイムアウトした場合に、削除待ちセッションテーブル140bに含まれるセッションIDとロックファイルのエントリとを基にして、ファイル管理テーブル140cのロック中セッションから該当する値を削除する。   When the session deletion timer times out, the restoration processing unit 150d deletes the corresponding value from the locked session of the file management table 140c based on the session ID and the lock file entry included in the deletion waiting session table 140b. To do.

復元処理部150dは、ロックファイルのエントリに示されるロックの種別が、排他ロックである場合には、上述した「排他ロック解放要求」を取得した場合の処理と同様の処理を実行する。また、復元処理部150dは、ロックファイルのエントリに示されるロックの種別が、共有ロックである場合には、上述した「共有ロック解放要求」を取得した場合の処理と同様の処理を実行する。   When the lock type indicated in the entry of the lock file is an exclusive lock, the restoration processing unit 150d executes the same process as the process when the “exclusive lock release request” described above is acquired. In addition, when the lock type indicated in the lock file entry is a shared lock, the restoration processing unit 150d executes the same process as the process performed when the above-described “shared lock release request” is acquired.

次に、図1に示したクライアント200の構成について説明する。図6は、本実施形態に係るクライアントの構成を示す機能ブロック図である。図6に示すように、このクライアント200は、通信部210、入力部220、表示部230、記憶部240、制御部250を有する。   Next, the configuration of the client 200 shown in FIG. 1 will be described. FIG. 6 is a functional block diagram showing the configuration of the client according to the present embodiment. As illustrated in FIG. 6, the client 200 includes a communication unit 210, an input unit 220, a display unit 230, a storage unit 240, and a control unit 250.

通信部210は、ネットワーク50に接続された他の装置との間でデータ通信を実行する通信装置である。例えば、通信部210は、サーバ100、アプリケーション60とデータ通信を行う。後述する制御部250は、この通信部210を利用して、サーバ200、アプリケーション60とデータをやり取りする。   The communication unit 210 is a communication device that performs data communication with other devices connected to the network 50. For example, the communication unit 210 performs data communication with the server 100 and the application 60. The control unit 250 described later exchanges data with the server 200 and the application 60 using the communication unit 210.

入力部220は、各種のデータをクライアント200に入力する入力装置である。例えば、入力部220は、キーボードやマウス、タッチパネル等に対応する。表示部230は、各種のデータを表示する表示装置である。例えば、表示部230は、ディスプレイ等に対応する。   The input unit 220 is an input device that inputs various data to the client 200. For example, the input unit 220 corresponds to a keyboard, a mouse, a touch panel, or the like. The display unit 230 is a display device that displays various data. For example, the display unit 230 corresponds to a display or the like.

記憶部240は、セッション情報240aを記憶する記憶装置である。セッション情報240aは、例えば、クライアント200がマスタの役割を有するサーバ100とセッションを確立した場合のセッションIDを有する情報である。   The storage unit 240 is a storage device that stores session information 240a. The session information 240a is information having a session ID when the client 200 establishes a session with the server 100 having the master role, for example.

制御部250は、接続要求部250a、要求部250b、再接続要求部250c、通知部250dを有する。   The control unit 250 includes a connection request unit 250a, a request unit 250b, a reconnection request unit 250c, and a notification unit 250d.

接続要求部250aは、マスタの役割を有するサーバ100とセッションを確立する処理部である。具体的に、接続要求部250aは、ネットワーク50に接続された全てのサーバ100に接続要求を送信する。接続要求部250aは、接続要求を送信した後に、マスタの役割を有するサーバ100から、セッションIDを受信し、受信したセッションIDを、セッション情報240aに登録する。そして、接続要求部250aは、マスタの役割を有するサーバ100に、受信確認を送信する。上記の一連の処理を接続要求部250aが実行することで、クライアント200とサーバ100とのセッションが確立する。   The connection request unit 250a is a processing unit that establishes a session with the server 100 having a master role. Specifically, the connection request unit 250 a transmits connection requests to all the servers 100 connected to the network 50. After transmitting the connection request, the connection request unit 250a receives the session ID from the server 100 having the role of the master, and registers the received session ID in the session information 240a. Then, the connection request unit 250a transmits a reception confirmation to the server 100 having the master role. A session between the client 200 and the server 100 is established by the connection request unit 250a executing the series of processes described above.

接続要求部250aは、死活監視タイマ(図示略)をセットし、この死活監視タイマがタイムアウトする前に、マスタの役割を有するサーバ100からの通信を受信した場合には、マスタへの受信確認を送信し、死活監視タイマをセットし直す処理を繰り返し実行する。なお、接続要求部250aは、死活監視タイマがタイムアウトする前に、マスタの役割を有するサーバ100から通信を受信しない場合には、再接続要求部250cに再接続を依頼する。   The connection request unit 250a sets a life / death monitoring timer (not shown), and when receiving communication from the server 100 having the role of the master before the life / death monitoring timer times out, the connection requesting unit 250a confirms reception to the master. Send and repeat the process of resetting the alive monitoring timer. Note that the connection request unit 250a requests the reconnection request unit 250c to reconnect before receiving a communication from the server 100 having the master role before the alive monitoring timer times out.

要求部250bは、クライアント200がマスタの役割を有するサーバ100との間でセッションが確立している間に、マスタに対してファイル処理要求を行う処理部である。例えば、要求部250bは、ファイル処理要求として、排他ロック取得要求、排他ロック解放要求、共有ロック取得要求、共有ロック解放要求等を行う。要求部250bは、アプリケーション60からの指示を受け付け、係る指示の内容に応じて、ファイル処理要求を行っても良い。   The request unit 250b is a processing unit that makes a file processing request to the master while the client 200 establishes a session with the server 100 having the role of the master. For example, the request unit 250b makes an exclusive lock acquisition request, an exclusive lock release request, a shared lock acquisition request, a shared lock release request, and the like as a file processing request. The request unit 250b may receive an instruction from the application 60 and make a file processing request according to the content of the instruction.

再接続要求部250cは、サーバ100に対する再接続要求を行う処理部である。具体的に、再接続要求部250cは、接続要求部250aから再接続の依頼を受け付けた場合に、再接続タイマ(図示略)をセットする。そして、再接続要求部250cは、再接続要求にセッション情報240aに登録されたセッションIDを登録し、ネットワークに接続された全てのサーバ100に再接続要求を送信する。   The reconnection request unit 250 c is a processing unit that makes a reconnection request to the server 100. Specifically, the reconnection request unit 250c sets a reconnection timer (not shown) when a reconnection request is received from the connection request unit 250a. Then, the reconnection request unit 250c registers the session ID registered in the session information 240a in the reconnection request, and transmits the reconnection request to all the servers 100 connected to the network.

再接続要求部250cは、再接続タイマがタイムアウトする前に、マスタの役割を有するサーバ100から返信が得られた場合には、再度セッションが確立したこととなり、その後の処理を、接続要求部250aに依頼する。   When a reply is obtained from the server 100 having the master role before the reconnection timer times out, the reconnection request unit 250c means that the session has been established again, and the subsequent processing is performed by the connection request unit 250a. To ask.

依頼を受けた接続要求部250aは、死活監視タイマをセットし、この死活監視タイマがタイムアウトする前に、マスタの役割を有するサーバ100からの通信を受信した場合には、マスタへの受信確認を送信し、死活監視タイマをセットし直す処理を繰り返し実行する。なお、接続要求部250aは、死活監視タイマがタイムアウトする前に、マスタの役割を有するサーバ100から通信を受信しない場合には、再接続要求部250cに再接続を依頼する。   Upon receipt of the request, the connection request unit 250a sets a life / death monitoring timer, and when communication from the server 100 having the role of the master is received before the life / death monitoring timer times out, the reception request to the master is confirmed. Send and repeat the process of resetting the alive monitoring timer. Note that the connection request unit 250a requests the reconnection request unit 250c to reconnect before receiving a communication from the server 100 having the master role before the alive monitoring timer times out.

これに対して、再接続要求部250cは、再接続タイマがタイムアウトする前に、マスタの役割を有するサーバ100から再接続要求に対する返信が得られない場合には、再接続要求に対する返信が得られない旨を通知部250dに出力する。   On the other hand, when the reconnection request unit 250c cannot obtain a reply to the reconnection request from the server 100 having the master role before the reconnection timer times out, the reconnection request unit 250c obtains a reply to the reconnection request. No notification is output to the notification unit 250d.

通知部250dは、再接続要求部250cが、再接続に失敗した場合に、再接続に失敗した旨の情報をアプリケーション60に通知する処理部である。再接続に失敗した場合には、例えば、アプリケーション60から、要求部250bに対して、マスタに対するファイル処理要求が制限される。   The notification unit 250d is a processing unit that notifies the application 60 of information indicating that reconnection has failed when the reconnection request unit 250c fails to reconnect. When the reconnection fails, for example, the application 60 limits the file processing request to the master from the request unit 250b.

次に、本実施形態に係るサーバ100の処理手順について説明する。図7は、本実施形態に係るサーバの処理手順を示すフローチャートである。図7に示すように、サーバ100は、Paxosによるマスタの選定を行い(ステップS101)、自サーバ100がマスタとして選出されたか否かを判定する(ステップS102)。   Next, a processing procedure of the server 100 according to the present embodiment will be described. FIG. 7 is a flowchart showing a processing procedure of the server according to the present embodiment. As shown in FIG. 7, the server 100 selects a master by Paxos (step S101), and determines whether or not the server 100 is selected as a master (step S102).

サーバ100は、自サーバ100がマスタとして選出されなかった場合には(ステップS102,No)、マスタリースタイマをセットする(ステップS103)。サーバ100は、マスタからのレプリケーション要求の受付を開始する(ステップS104)。   If the server 100 is not elected as a master (No at Step S102), the server 100 sets a master lease timer (Step S103). The server 100 starts accepting a replication request from the master (step S104).

サーバ100は、マスタリースタイマがタイムアウトしたか否かを判定する(ステップS105)。サーバ100は、マスタリースタイマがタイムアウトしていない場合には(ステップS105,No)、再度ステップS105に移行する。   The server 100 determines whether or not the master lease timer has timed out (step S105). If the master lease timer has not timed out (No at Step S105), the server 100 proceeds to Step S105 again.

一方、サーバ100は、マスタリースタイマがタイムアウトした場合には(ステップS105,Yes)、マスタからのレプリケーション要求受付を閉塞し(ステップS106)、ステップS101に移行する。   On the other hand, when the master lease timer times out (step S105, Yes), the server 100 closes the replication request reception from the master (step S106), and proceeds to step S101.

ところで、サーバ100は、自サーバがマスタとして選出された場合には(ステップS102,Yes)、マスタリースタイマをセットする(ステップS107)。サーバ100は、次回マスタ選出タイマをセットする(ステップS108)。   By the way, when the server 100 is elected as a master (step S102, Yes), the server 100 sets a master lease timer (step S107). The server 100 sets the next master selection timer (step S108).

サーバ100は、自サーバが以前のマスタであり、かつ、以前のマスタリースタイマがタイムアウトしていない場合には(ステップS109,Yes)、ステップS111に移行する。一方、サーバ100は、自サーバが以前のマスタでない場合、または、以前のマスタリースタイマがタイムアウトしている場合には(ステップS109,No)、ステップS110に移行する。   If the server 100 is the previous master and the previous master lease timer has not timed out (step S109, Yes), the server 100 proceeds to step S111. On the other hand, if the server 100 is not the previous master, or if the previous master lease timer has timed out (No in step S109), the server 100 proceeds to step S110.

サーバ100は、クライアント200とのセッションを復元し(ステップS110)、ステップS111に移行する。   The server 100 restores the session with the client 200 (step S110), and proceeds to step S111.

サーバ100は、クライアント200からの要求受け付けを開始し(ステップS111)、次回マスタ選出タイマがタイムアウトしたか否かを判定する(ステップS112)。サーバ100は、次回マスタ算出タイマがタイムアウトしていない場合には(ステップS112,No)、再度ステップS112に移行する。   The server 100 starts accepting a request from the client 200 (step S111), and determines whether or not the next master selection timer has timed out (step S112). If the next master calculation timer has not timed out (No at Step S112), the server 100 proceeds to Step S112 again.

サーバ100は、次回マスタ選出タイマがタイムアウトした場合には(ステップS112,Yes)、ステップS101に移行して処理を継続する。また、その一方で、サーバ100は、マスタリースがタイムアウトしたか否かを判定する(ステップS113)。サーバ100は、マスタリースタイマがタイムアウトしていない場合には(ステップS113)、再度ステップS113に移行する。一方、サーバ100は、マスタリースタイマがタイムアウトした場合には(ステップS113,Yes)、クライアントからの要求受付を閉塞する(ステップS114)。   If the next master selection timer times out (step S112, Yes), the server 100 proceeds to step S101 and continues the process. On the other hand, the server 100 determines whether or not the master lease has timed out (step S113). If the master lease timer has not timed out (step S113), the server 100 proceeds to step S113 again. On the other hand, when the master lease timer times out (step S113, Yes), the server 100 blocks the request reception from the client (step S114).

次に、図7のステップS110に示したクライアントとのセッションを復元する処理について説明する。図8は、セッションを復元する処理の処理手順を示すフローチャートである。図8に示すように、サーバ100は、セッションテーブル140aのマスタ交代前のセッション情報を読み込み、全情報を削除待ちセッションテーブル140bに書き込む(ステップS121)。サーバ100は、セッションテーブル140aの全情報を削除する(ステップS122)。   Next, the process for restoring the session with the client shown in step S110 of FIG. 7 will be described. FIG. 8 is a flowchart illustrating a processing procedure of processing for restoring a session. As shown in FIG. 8, the server 100 reads the session information before the master change in the session table 140a, and writes all the information in the deletion waiting session table 140b (step S121). The server 100 deletes all information in the session table 140a (step S122).

サーバ100は、セッション削除タイマをセットし(ステップS123)、セッション削除タイマがタイムアウトしたか否かを判定する(ステップS124)。サーバ100は、セッション削除タイマがタイムアウトしていない場合には(ステップS124,No)、再度ステップS124に移行する。   The server 100 sets a session deletion timer (step S123), and determines whether or not the session deletion timer has timed out (step S124). If the session deletion timer has not timed out (No at Step S124), the server 100 proceeds to Step S124 again.

サーバ100は、セッション削除タイマがタイムアウトした場合には(ステップS124,Yes)、削除待ちセッションテーブル140bが空か否かを判定する(ステップS125)。サーバ100は、削除待ちセッションテーブル140bが空の場合には(ステップS125,Yes)、セッションを復元する処理を終了する。   If the session deletion timer times out (step S124, Yes), the server 100 determines whether or not the deletion waiting session table 140b is empty (step S125). If the deletion waiting session table 140b is empty (step S125, Yes), the server 100 ends the process of restoring the session.

一方、サーバ100は、削除待ちセッションテーブル140bが空ではない場合には(ステップS125,No)、削除待ちセッションテーブル140bの任意の1セッションを選択する(ステップS126)。サーバ100は、セッション削除処理を実行し(ステップS127)、ステップS125に移行する。   On the other hand, when the deletion waiting session table 140b is not empty (step S125, No), the server 100 selects an arbitrary session in the deletion waiting session table 140b (step S126). The server 100 executes session deletion processing (step S127), and proceeds to step S125.

次に、図8のステップS127に示したセッション削除処理について説明する。図9は、セッション削除処理の処理手順を示すフローチャートである。図9に示すように、サーバ100は、セッションテーブル140aからセッションIDに関連するロックファイルのエントリを全て取得する(ステップS131)。   Next, the session deletion process shown in step S127 of FIG. 8 will be described. FIG. 9 is a flowchart showing a processing procedure of session deletion processing. As shown in FIG. 9, the server 100 acquires all lock file entries related to the session ID from the session table 140a (step S131).

サーバ100は、ロックファイルのエントリを基にして、自動アンロック操作を実施する(ステップS132)。ステップS132において、サーバ100は、アンロック対象となるファイルが共有ロックされている場合には、共有ロック解放要求処理に対する処理と同様の処理を行う。これに対して、アンロック対象となるファイルが排他ロックされている場合には、排他ロック解放要求に対する処理と同様の処理を行う。   The server 100 performs an automatic unlocking operation based on the lock file entry (step S132). In step S132, when the file to be unlocked is shared and locked, the server 100 performs the same process as the process for the shared lock release request process. On the other hand, when the file to be unlocked is exclusively locked, the same processing as that for the exclusive lock release request is performed.

次に、図7のステップS111に示したクライアントからの要求を開始してから、ステップS114のクライアントからの要求受け付けを閉塞するまでの要求受け付け処理の処理手順について説明する。図10は、要求受け付け処理の処理手順を示すフローチャートである。   Next, a description will be given of the processing procedure of request reception processing from the start of the request from the client shown in step S111 in FIG. 7 to the blocking of the request reception from the client in step S114. FIG. 10 is a flowchart showing a processing procedure of request acceptance processing.

図10に示すように、サーバ100は、クライアント200から要求があったか否かを判定する(ステップS141)。サーバ100は、クライアント200から要求が無い場合には(ステップS141,No)、再度ステップS141に移行する。   As shown in FIG. 10, the server 100 determines whether or not there is a request from the client 200 (step S141). When there is no request from the client 200 (No at Step S141), the server 100 proceeds to Step S141 again.

サーバ100は、クライアントから要求があった場合には(ステップS141,Yes)、クライアント200から接続要求を受け付けたか否かを判定する(ステップS142)。サーバ100は、接続要求を受け付けた場合には(ステップS142,Yes)、セッションIDを発行し、セッションテーブル140aに登録する(ステップS143)。   If there is a request from the client (step S141, Yes), the server 100 determines whether or not a connection request has been received from the client 200 (step S142). When the server 100 accepts the connection request (step S142, Yes), the server 100 issues a session ID and registers it in the session table 140a (step S143).

サーバ100は、セッションIDをクライアント200に通知し(ステップS144)、クライアント監視プロセスを起動し(ステップS145)、ステップS141に移行する。   The server 100 notifies the client 200 of the session ID (step S144), starts a client monitoring process (step S145), and proceeds to step S141.

ステップS142において、サーバ100は、クライアント200から接続要求を受けていない場合には(ステップS142,No)、再接続要求か否かを判定する(ステップS146)。サーバ100は、再接続要求を受け付けた場合には(ステップS146,Yes)、削除待ちセッションテーブル140bから、該当するセッションIDを削除する(ステップS147)。サーバ100は、セッションIDをセッションテーブル140aに追加し(ステップS148)、ステップS144に移行する。   In step S142, if the server 100 has not received a connection request from the client 200 (step S142, No), the server 100 determines whether or not it is a reconnection request (step S146). When the server 100 receives the reconnection request (step S146, Yes), the server 100 deletes the corresponding session ID from the deletion waiting session table 140b (step S147). The server 100 adds the session ID to the session table 140a (step S148), and proceeds to step S144.

ステップS146において、サーバ100は、クライアント200から再接続要求を受け付けていない場合には(ステップS146,No)、処理内容に応じてファイルに対する処理を実行する(ステップS149)。サーバ100は、処理結果をレプリカに送信する(ステップS150)。   In step S146, if the server 100 has not received a reconnection request from the client 200 (step S146, No), the server 100 executes processing for the file according to the processing content (step S149). The server 100 transmits the processing result to the replica (step S150).

サーバ100は、レプリカから返信が得られたか否かを判定する(ステップS151)。サーバ100は、レプリカから返信が得られた場合には(ステップS151,Yes)、ステップS141に移行する。一方、レプリカから返信が得られない場合には(ステップS151,No)、クライアント200からの要求受け付けを閉塞する(ステップS152)。   The server 100 determines whether or not a reply is obtained from the replica (step S151). When a reply is obtained from the replica (step S151, Yes), the server 100 proceeds to step S141. On the other hand, when a reply cannot be obtained from the replica (step S151, No), the request acceptance from the client 200 is blocked (step S152).

次に、図10のステップS145に示したクライアント監視プロセスを起動した場合のクライアント監視処理について説明する。図11は、クライアント監視処理の処理手順を示すフローチャートである。   Next, the client monitoring process when the client monitoring process shown in step S145 of FIG. 10 is started will be described. FIG. 11 is a flowchart illustrating a processing procedure of client monitoring processing.

図11に示すように、サーバ100は、一定時間待機後クライアント200にpingを送信する(ステップS171)。サーバ100は、タイマをセットし(ステップS172)、タイムアウト前にクライアントから返信があったか否かを判定する(ステップS173)。   As illustrated in FIG. 11, the server 100 transmits a ping to the client 200 after waiting for a predetermined time (step S171). The server 100 sets a timer (step S172), and determines whether or not there is a reply from the client before the timeout (step S173).

サーバ100は、タイムアウト前にクライアントから返信があった場合には(ステップS173,Yes)、ステップS171に移行する。一方、サーバ100は、タイムアウト前にクライアントから返信が無い場合には(ステップS173,No)、セッション削除処理を実行する(ステップS174)。   If there is a reply from the client before the timeout (Yes at Step S173), the server 100 proceeds to Step S171. On the other hand, when there is no reply from the client before the timeout (No at Step S173), the server 100 executes a session deletion process (Step S174).

次に、図10のステップS152に示したクライアントからの要求受け付けを閉塞する閉塞処理について説明する。図12は、閉塞処理の処理手順を示すフローチャートである。図12に示すように、サーバ100は、クライアント200からの要求受付プロセスを停止する(ステップS181)。   Next, the blocking process for blocking the request acceptance from the client shown in step S152 in FIG. 10 will be described. FIG. 12 is a flowchart showing the procedure of the blocking process. As shown in FIG. 12, the server 100 stops the process for accepting requests from the client 200 (step S181).

サーバ100は、全てのクライアント監視プロセスを停止し(ステップS182)、全てのセッション情報を削除する(ステップS183)。   The server 100 stops all client monitoring processes (step S182) and deletes all session information (step S183).

次に、サーバ100が、クライアント200から排他ロック取得要求、排他ロック解放要求、共有ロック取得要求、共有ロック解放要求を受け付けた場合の処理についてそれぞれ説明する。   Next, processing when the server 100 receives an exclusive lock acquisition request, an exclusive lock release request, a shared lock acquisition request, and a shared lock release request from the client 200 will be described.

図13は、排他ロック取得要求を受け付けた場合の処理手順を示すフローチャートである。図13に示すように、サーバ100は、ロック対象のファイルIDを取得し(ステップS201)、ファイルIDに対応するロック中セッションの値が空か否かを判定する(ステップS202)。   FIG. 13 is a flowchart showing a processing procedure when an exclusive lock acquisition request is received. As shown in FIG. 13, the server 100 acquires the file ID to be locked (step S201), and determines whether or not the value of the locked session corresponding to the file ID is empty (step S202).

サーバ100は、ファイルIDに対応するロック中セッションの値が空の場合には(ステップS202,Yes)、ロック中セッションに値を追加する(ステップS203)。   If the value of the locked session corresponding to the file ID is empty (step S202, Yes), the server 100 adds a value to the locked session (step S203).

一方、サーバ100は、ファイルIDに対応するロック中セッションの値が空ではない場合には(ステップS202,No)、ロック待ちセッションに値を追加する(ステップS204)。   On the other hand, if the value of the locked session corresponding to the file ID is not empty (No at Step S202), the server 100 adds a value to the lock waiting session (Step S204).

図14は、排他ロック解放要求を受け付けた場合の処理手順を示すフローチャートである。図14に示すように、サーバ100は、ファイル管理テーブル140cからロック対象のファイルIDを取得する(ステップS211)。サーバ100は、ロック中セッションからファイルIDに対応する値を削除する(ステップS212)。   FIG. 14 is a flowchart illustrating a processing procedure when an exclusive lock release request is received. As shown in FIG. 14, the server 100 acquires the file ID to be locked from the file management table 140c (step S211). The server 100 deletes the value corresponding to the file ID from the locked session (step S212).

サーバ100は、ファイルIDに対応する、ロック待ちセッションの値は全て空であるか否かを判定する(ステップS213)。サーバ100は、ファイルIDに対応する、ロック待ちセッションの値が全て空の場合には(ステップS213,Yes)、処理を終了する。   The server 100 determines whether or not all the lock waiting session values corresponding to the file ID are empty (step S213). If the values of the session waiting for lock corresponding to the file ID are all empty (step S213, Yes), the server 100 ends the process.

一方、サーバ100は、ファイルIDに対応する、ロック待ちセッションの値が全て空ではない場合には(ステップS213,No)、ファイルIDのロック待ちセッションの先頭のエントリを取り出し、ロック中セッションの値に追加する(ステップS214)。   On the other hand, if the values of the session waiting for lock corresponding to the file ID are not all empty (step S213, No), the server 100 extracts the first entry of the session waiting for lock of the file ID, and the value of the session being locked (Step S214).

サーバ100は、ロック中セッションに追加した値が排他ロックか否かを判定する(ステップS215)。サーバ100は、ロック中セッションに追加した値が排他ロックの場合には(ステップS215,Yes)、処理を終了する。   The server 100 determines whether or not the value added to the locked session is an exclusive lock (step S215). When the value added to the locked session is an exclusive lock (step S215, Yes), the server 100 ends the process.

一方、サーバ100は、ロック中セッションに追加した値が排他ロックでは無い場合には(ステップS215,No)、ロック待ちセッションが空ではないか否かを判定する(ステップS216)。サーバ100は、ロック待ちセッションが空の場合には(ステップS216,No)、処理を終了する。   On the other hand, if the value added to the locked session is not an exclusive lock (step S215, No), the server 100 determines whether the lock waiting session is not empty (step S216). If the session waiting for lock is empty (No in step S216), the server 100 ends the process.

一方、サーバ100は、ロック待ちセッションが空ではない場合には(ステップS216,Yes)、ロック待ちセッションの先頭が共有ロックか否かを判定する(ステップS217)。サーバ100は、ロック待ちセッションの先頭が共有ロックではない場合には(ステップS217,No)、処理を終了する。   On the other hand, if the lock waiting session is not empty (step S216, Yes), the server 100 determines whether or not the head of the lock waiting session is a shared lock (step S217). When the head of the lock waiting session is not the shared lock (step S217, No), the server 100 ends the process.

一方、サーバ100は、ロック待ちセッションの先頭が共有ロックの場合には(ステップS217,Yes)、ロック中セッションが上限数に達しているか否かを判定する(ステップS218)。サーバ100は、ロック中のセッションが上限数に達している場合には(ステップS218,Yes)、処理を終了する。   On the other hand, when the head of the session waiting for lock is a shared lock (step S217, Yes), the server 100 determines whether or not the number of locked sessions has reached the upper limit (step S218). If the number of locked sessions has reached the upper limit number (step S218, Yes), the server 100 ends the process.

一方、サーバ100は、ロック中のセッションが上限数に達していない場合には(ステップS218,No)、ロック待ちセッションの先頭のエントリを取り出し、ロック中セッションに追加し(ステップS219)、ステップS216に移行する。   On the other hand, if the number of locked sessions has not reached the upper limit (step S218, No), the server 100 extracts the top entry of the lock waiting session, adds it to the locked session (step S219), and step S216. Migrate to

図15は、共有ロック取得要求を受け付けた場合の処理手順を示すフローチャートである。図15に示すように、サーバ100は、ロック対象のファイルIDを取得し(ステップS221)、ファイルIDに対するロック中セッションの値は空か否かを判定する(ステップS222)。   FIG. 15 is a flowchart illustrating a processing procedure when a shared lock acquisition request is received. As shown in FIG. 15, the server 100 acquires the file ID to be locked (step S221), and determines whether or not the value of the locked session for the file ID is empty (step S222).

サーバ100は、ファイルIDに対するロック中セッションの値が空の場合には(ステップS222,Yes)、ロック中セッションに値を追加し(ステップS223)、処理を終了する。   If the value of the locked session for the file ID is empty (step S222, Yes), the server 100 adds a value to the locked session (step S223) and ends the process.

一方、サーバ100は、ファイルIDに対するロック中セッションの値が空ではない場合には(ステップS222,No)、ロック中セッションの値が共有ロックであるか否かを判定する(ステップS224)。   On the other hand, if the value of the locked session for the file ID is not empty (step S222, No), the server 100 determines whether the value of the locked session is a shared lock (step S224).

サーバ100は、ロック中セッションの値が共有ロックではない場合には(ステップS244,No)、ロック待ちセッションに追加する(ステップS225)。   When the value of the locked session is not the shared lock (step S244, No), the server 100 adds the session waiting for the lock (step S225).

一方、サーバ100は、ロック中セッションの値が上限数に達しているか否かを判定する(ステップS226)。サーバ100は、ロック中セッションが上限数に達していない場合には(ステップS226,Yes)、ステップS223に移行する。サーバ100は、ロック中セッションの値が上限数に達している場合には(ステップS226,No)、ステップS225に移行する。一方、サーバ100は、ロック中セッションの値が上限数に達していない場合には(ステップS226,Yes)、ステップS223に移行する。   On the other hand, the server 100 determines whether or not the value of the locked session has reached the upper limit number (step S226). When the number of locked sessions has not reached the upper limit number (step S226, Yes), the server 100 proceeds to step S223. If the value of the session being locked has reached the upper limit number (step S226, No), the server 100 proceeds to step S225. On the other hand, if the value of the locked session has not reached the upper limit number (step S226, Yes), the server 100 proceeds to step S223.

図16は、共有ロック解放要求を受け付けた場合の処理手順を示すフローチャートである。図16に示すように、サーバ100は、ファイル管理テーブル140cから、ロック対象のファイルIDを取得する(ステップS231)。サーバ100は、ファイルIDの、ロック中セッションからファイルIDに対応する値を削除する(ステップS232)。   FIG. 16 is a flowchart illustrating a processing procedure when a shared lock release request is received. As illustrated in FIG. 16, the server 100 acquires a file ID to be locked from the file management table 140c (step S231). The server 100 deletes the value corresponding to the file ID from the locked session (step S232).

サーバ100は、ファイルIDに対応する、ロック待ちセッションの値が全て空か否かを判定する(ステップS233)。サーバ100は、ロック待ちセッションの値が全て空の場合には(ステップS233,Yes)、処理を終了する。   The server 100 determines whether or not all the lock waiting session values corresponding to the file ID are empty (step S233). If all the values of the session waiting for lock are empty (step S233, Yes), the server 100 ends the process.

一方、サーバ100は、ロック待ちセッションの値が全て空ではない場合には(ステップS233,No)、ロック待ちセッションの先頭が共有ロックであるか否かを判定する(ステップS234)。サーバ100は、ロック待ちセッションの先頭が共有ロックではない場合には(ステップS234,No)、処理を終了する。   On the other hand, when all the values of the lock waiting session are not empty (step S233, No), the server 100 determines whether or not the head of the lock waiting session is a shared lock (step S234). When the head of the lock waiting session is not the shared lock (No in step S234), the server 100 ends the process.

一方、サーバ100は、ロック待ちセッションの先頭が共有ロックの場合には(ステップS234,Yes)、ロック中セッションが上限数に達しているか否かを判定する(ステップS235)。サーバ100は、ロック中セッションが上限数に達している場合には(ステップS235,Yes)、処理を終了する。   On the other hand, when the head of the session waiting for lock is the shared lock (step S234, Yes), the server 100 determines whether or not the number of locked sessions has reached the upper limit (step S235). If the number of locked sessions has reached the upper limit number (step S235, Yes), the server 100 ends the process.

一方、サーバ100は、ロック中セッションが上限数に達していない場合には(ステップS235,No)、ロック待ちセッションの先頭のエントリを取り出し、ロック中セッションに追加する(ステップS236)。   On the other hand, if the number of locked sessions has not reached the upper limit (No in step S235), the server 100 takes out the top entry of the lock waiting session and adds it to the locked session (step S236).

サーバ100は、ロック待ちセッションが空ではないか否かを判定する(ステップS237)。サーバ100は、ロック待ちセッションが空の場合には(ステップS237,No)、処理を終了する。一方、サーバ100は、ロック待ちセッションが空ではない場合には(ステップS237,Yes)、ステップS234に移行する。   The server 100 determines whether or not the lock waiting session is not empty (step S237). If the lock waiting session is empty (step S237, No), the server 100 ends the process. On the other hand, when the lock waiting session is not empty (step S237, Yes), the server 100 proceeds to step S234.

次に、本実施形態に係るクライアント200の処理手順について説明する。図17は、本実施形態に係るクライアントの処理手順を示すフローチャートである。図17に示すように、クライアント200は、同一のネットワークに接続された全てのサーバ100へ接続要求を送信する(ステップS301)。   Next, a processing procedure of the client 200 according to the present embodiment will be described. FIG. 17 is a flowchart showing the processing procedure of the client according to the present embodiment. As shown in FIG. 17, the client 200 transmits a connection request to all the servers 100 connected to the same network (step S301).

クライアント200は、マスタからセッションIDを受信し(ステップS302)、マスタへタイマ受信確認を送信する(ステップS303)。クライアント200は、死活監視タイマをセットする(ステップS304)。   The client 200 receives the session ID from the master (step S302), and transmits a timer reception confirmation to the master (step S303). The client 200 sets an alive monitoring timer (step S304).

クライアント200は、死活監視タイマがタイムアウトする前にマスタから通信を受信したか否かを判定する(ステップS305)。クライアント200は、死活監視タイマがタイムアウトする前に、マスタから通信を受信した場合には(ステップS305,Yes)、ステップS303に移行する。   The client 200 determines whether communication has been received from the master before the alive monitoring timer times out (step S305). If the client 200 receives communication from the master before the alive monitoring timer times out (step S305, Yes), the client 200 proceeds to step S303.

一方、クライアント200は、死活監視タイマがタイムアウトする前にマスタから通信を受信していない場合には(ステップS305,No)、再接続タイマをセットする(ステップS306)。   On the other hand, if the client 200 has not received communication from the master before the alive monitoring timer times out (No in step S305), the client 200 sets a reconnection timer (step S306).

クライアント200は、同一のネットワークに接続された全てのサーバ100へ再接続要求を行う(ステップS307)。この再接続要求には、セッションIDが含まれる。クライアント200は、再接続タイマがタイムアウトする前にマスタから返信が得られたか否かを判定する(ステップS308)。クライアント200は、再接続タイマがタイムアウトする前にマスタから返信が得られた場合には(ステップS308,Yes)、ステップS303に移行する。   The client 200 makes a reconnection request to all the servers 100 connected to the same network (step S307). This reconnection request includes a session ID. The client 200 determines whether a reply is obtained from the master before the reconnection timer times out (step S308). If a reply is obtained from the master before the reconnection timer times out (Yes in step S308), the client 200 proceeds to step S303.

クライアント200は、再接続タイマがタイムアウトする前にマスタから返信が得られなかった場合には(ステップS308,No)、アプリケーション60に再接続出来なかった旨の情報を送信する(ステップS309)。   If the reply is not obtained from the master before the reconnection timer times out (step S308, No), the client 200 transmits information indicating that reconnection could not be performed to the application 60 (step S309).

クライアント200は、アプリケーション60からの応答を受信し(ステップS310)、共有ロックおよび排他ロックを用いるファイル処理を中止する(ステップS311)。   The client 200 receives the response from the application 60 (step S310), and stops the file processing using the shared lock and the exclusive lock (step S311).

なお、クライアント200は、図17のステップS303〜S305の区間において、必要に応じて、ファイル操作を実行可能である。ここで、ファイル操作は、排他ロック取得要求、排他ロック解放要求、共有ロック取得要求、共有ロック解放要求に対応する。係るファイル操作を受け付けたマスタの役割を有するサーバ100は、上述した図13〜図16の処理を実行する。   Note that the client 200 can execute file operations as needed in the section of steps S303 to S305 in FIG. Here, the file operation corresponds to an exclusive lock acquisition request, an exclusive lock release request, a shared lock acquisition request, and a shared lock release request. The server 100 having the role of the master that has received the file operation executes the processes of FIGS. 13 to 16 described above.

次に、本実施形態に係るシステムの効果について説明する。本実施形態に係るシステムでは、サーバ100は、自サーバがマスタの役割を有するサーバである場合に、クライアント200からの接続要求に応答して、クライアント200にセッションIDを発行し、該セッションIDをセッションテーブル140aに登録すると共に、クライアント200からのファイル処理要求に応じて、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブル140cに登録する。また、サーバ100は、レプリカの役割を有するサーバである場合に、マスタの役割を有するサーバのセッションテーブル140aとファイル管理テーブル140cとを複製する。また、サーバ100は、自サーバがレプリカの役割を有するサーバから、マスタの役割を有するサーバに切り替わり、クライアント200から再接続要求を受け付けた場合には、セッションテーブル140aの情報を、削除待ちセッションテーブル140bに登録し、再接続要求に含まれるセッションIDと同一のセッションIDを削除待ちセッションテーブル140bから削除し、該削除待ちセッションテーブル140bに残されたセッションIDに対応するロック情報を、ファイル管理テーブル140cから削除する。   Next, the effect of the system according to the present embodiment will be described. In the system according to the present embodiment, when the server 100 is a server having a master role, the server 100 issues a session ID to the client 200 in response to a connection request from the client 200, and the session ID is issued. In addition to registering in the session table 140a, in response to a file processing request from the client 200, the lock information for the file and the session ID are associated and registered in the file management table 140c. Further, when the server 100 is a server having a role of replica, the server 100 duplicates the session table 140a and the file management table 140c of the server having the role of master. In addition, when the server 100 switches from the server having the role of replica to the server having the role of master and receives a reconnection request from the client 200, the server 100 stores the information in the session table 140a as the session table waiting for deletion. 140b, deletes the same session ID as the session ID included in the reconnection request from the deletion waiting session table 140b, and stores the lock information corresponding to the session ID remaining in the deletion waiting session table 140b in the file management table. Delete from 140c.

このような処理を実行することで、同期する複数のサーバ間でネットワークが分散した場合に、同一のネットワーク内に含まれる複数のサーバから単一のマスタを選出するようなシステムであっても、マスタの故障により資源に対するクライアントのロック情報を他のサーバが引き継ぐ際に、係るロック情報に矛盾発生することを防止することができる。   By executing such processing, even when the network is distributed among a plurality of synchronized servers, even in a system that selects a single master from a plurality of servers included in the same network, When another server takes over the lock information of the client for the resource due to the failure of the master, it is possible to prevent inconsistency in the lock information.

また、サーバ100は、ファイルに対するロックの数が上限数未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録する。このような処理を実行することで、資源の利用数を制限することができる。   Further, when the number of locks on the file is less than the upper limit, the server 100 associates the lock information on the file with the session ID and registers them in the file management table. By executing such processing, the number of resources used can be limited.

また、サーバ100は、クライアント200からのファイル処理要求が、ファイルに対する共有ロックを要求している場合には、ファイルに対するロックの数が上限数未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブル140cに登録し、クライアント200からのファイル処理要求が、ファイルに対する排他ロックを要求している場合には、ファイルに対するロックがかかっていない場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブル140cに登録する。このような処理を実行することで、資源の利用数を制限しつつ、排他ロックおよび共有ロックを適切にファイルにかけることができる。   Further, when the file processing request from the client 200 requests a shared lock for the file, the server 100 displays the lock information and the session ID for the file when the number of locks for the file is less than the upper limit number. When the file processing request from the client 200 requests an exclusive lock on the file, the file lock information and the session ID are registered when the file is not locked. Are registered in the file management table 140c. By executing such processing, the exclusive lock and the shared lock can be appropriately applied to the file while limiting the number of resources used.

また、クライアント200は、マスタの役割を有するサーバ100が切り替わった場合に、マスタの役割を有するサーバ100に再接続要求を行い、該再接続要求の応答をマスタの役割を有するサーバ100から受信しない場合には、再接続に失敗した情報をアプリケーション60に通知する。このような処理を行うことによって、クライアント200が、サーバ100との接続が出来ていない状況で、サーバ100に対して共有ロックや排他ロックを用いたファイル処理を行うことを防止することができる。   Further, when the server 100 having the master role is switched, the client 200 makes a reconnection request to the server 100 having the master role, and does not receive a response to the reconnection request from the server 100 having the master role. In such a case, the application 60 is notified of information on the reconnection failure. By performing such processing, it is possible to prevent the client 200 from performing file processing using a shared lock or exclusive lock on the server 100 in a situation where the connection with the server 100 is not established.

次に、実施形態に示したサーバ100と同様の機能を実現する制御プログラムを実行するコンピュータの一例を説明する。図18は、サーバと同様の機能を実現する制御プログラムを実行するコンピュータの一例を示す図である。図18に例示するように、コンピュータ300は、例えば、メモリ301と、CPU(Central Processing Unit)302と、ハードディスクドライブインタフェース303と、ディスクドライブインタフェース304と、シリアルポートインタフェース305と、ビデオアダプタ306と、ネットワークインタフェース307とを有し、これらの各部はバス308によって接続される。   Next, an example of a computer that executes a control program that realizes the same function as the server 100 described in the embodiment will be described. FIG. 18 is a diagram illustrating an example of a computer that executes a control program that implements the same function as the server. As illustrated in FIG. 18, the computer 300 includes, for example, a memory 301, a CPU (Central Processing Unit) 302, a hard disk drive interface 303, a disk drive interface 304, a serial port interface 305, a video adapter 306, A network interface 307, and these units are connected by a bus 308.

メモリ301は、図18に例示するように、ROM(Read Only Memory)301a及びRAM(Random Access Memory)301bを含む。ROM301aは、例えば、BIOS(Basic Input Output System)等のブートプログラムを記憶する。ハードディスクドライブインタフェース303は、図18に例示するように、ハードディスクドライブ303aに接続される。ディスクドライブインタフェース304は、図18に例示するように、ディスクドライブ304aに接続される。例えば磁気ディスクや光ディスク等の着脱可能な記憶媒体が、ディスクドライブ304aに挿入される。シリアルポートインタフェース305は、図18に例示するように、例えばマウス305a、キーボード305bに接続される。ビデオアダプタ306は、図18に例示するように、例えばディスプレイ306aに接続される。   As illustrated in FIG. 18, the memory 301 includes a ROM (Read Only Memory) 301a and a RAM (Random Access Memory) 301b. The ROM 301a stores a boot program such as BIOS (Basic Input Output System). The hard disk drive interface 303 is connected to the hard disk drive 303a as illustrated in FIG. The disk drive interface 304 is connected to the disk drive 304a as illustrated in FIG. For example, a removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 304a. As illustrated in FIG. 18, the serial port interface 305 is connected to, for example, a mouse 305a and a keyboard 305b. The video adapter 306 is connected to a display 306a, for example, as illustrated in FIG.

ここで、図18に例示するように、ハードディスクドライブ303aは、例えば、OS(Operating System)1、アプリケーションプログラム2、プログラムモジュール3、プログラムデータ4を記憶する。すなわち、サーバ100の処理を実行する制御プログラムは、コンピュータ300によって実行される指令が記述されたプログラムモジュール3として、例えばハードディスクドライブ303aに記憶される。具体的には、上記実施形態で説明したマスタ調整部150a、レプリケーション部150b、要求処理部150c、復元処理部150dに対応する各手順が記述されたプログラムモジュール3が、ハードディスクドライブ303aに記憶される。また、上記実施形態で説明した記憶部140に記憶されるデータのように、制御プログラムによる情報処理に用いられるデータは、プログラムデータ4として、例えばハードディスクドライブ303aあるいはメモリ301に記憶される。そして、CPU302が、ハードディスクドライブ303aに記憶されたプログラムモジュール3やプログラムデータ4を必要に応じてRAM301bに読み出し、各手順を実行する。   Here, as illustrated in FIG. 18, the hard disk drive 303 a stores, for example, an OS (Operating System) 1, an application program 2, a program module 3, and program data 4. That is, the control program for executing the processing of the server 100 is stored in, for example, the hard disk drive 303a as the program module 3 in which a command executed by the computer 300 is described. Specifically, the program module 3 in which the procedures corresponding to the master adjustment unit 150a, replication unit 150b, request processing unit 150c, and restoration processing unit 150d described in the above embodiment are described is stored in the hard disk drive 303a. . Further, data used for information processing by the control program, such as data stored in the storage unit 140 described in the above embodiment, is stored as program data 4 in, for example, the hard disk drive 303a or the memory 301. Then, the CPU 302 reads the program module 3 and program data 4 stored in the hard disk drive 303a to the RAM 301b as necessary, and executes each procedure.

なお、制御プログラムに係るプログラムモジュール3やプログラムデータ4は、ハードディスクドライブ303aに記憶される場合に限られず、例えば着脱可能な記憶媒体に記憶され、ディスクドライブ等を介してCPU302によって読み出されてもよい。あるいは、制御プログラムに係るプログラムモジュール3やプログラムデータ4は、ネットワーク(LAN(Local Area Network)、WAN(Wide Area Network)等)を介して接続された他のコンピュータに記憶され、ネットワークインタフェースを介してCPU302によって読み出されてもよい。   The program module 3 and the program data 4 relating to the control program are not limited to being stored in the hard disk drive 303a, but may be stored in, for example, a removable storage medium and read out by the CPU 302 via the disk drive or the like. Good. Alternatively, the program module 3 and the program data 4 relating to the control program are stored in another computer connected via a network (LAN (Local Area Network), WAN (Wide Area Network), etc.), and via a network interface. It may be read by the CPU 302.

次に、図18を利用して、クライアント200と同様の機能を実現する制御プログラムを実行するコンピュータの一例を説明する。クライアント200の処理を実行する制御プログラムは、コンピュータ300によって実行される指令が記述されたプログラムモジュール3として、例えばハードディスクドライブ303aに記憶される。具体的には、上記実施形態で説明した接続要求部250a、要求部250b、再接続要求部250c、通知部250dに対応する各手順が記述されたプログラムモジュール3が、ハードディスクドライブ303aに記憶される。また、上記実施形態で説明した記憶部240に記憶されるデータのように、制御プログラムによる情報処理に用いられるデータは、プログラムデータ4として、例えばハードディスクドライブ303aに記憶される。そして、CPU302が、ハードディスクドライブ303aに記憶されたプログラムモジュール3やプログラムデータ4を必要に応じてRAM301bに読み出し、各手順を実行する。その他の説明は、上述したサーバ100と同様の機能を実現する制御プログラムを実行するコンピュータの説明と同様である。   Next, an example of a computer that executes a control program that implements the same function as the client 200 will be described with reference to FIG. A control program for executing the processing of the client 200 is stored in, for example, the hard disk drive 303a as the program module 3 in which a command executed by the computer 300 is described. Specifically, the program module 3 in which the procedures corresponding to the connection request unit 250a, the request unit 250b, the reconnection request unit 250c, and the notification unit 250d described in the above embodiment are described is stored in the hard disk drive 303a. . Further, like data stored in the storage unit 240 described in the above embodiment, data used for information processing by the control program is stored as program data 4 in, for example, the hard disk drive 303a. Then, the CPU 302 reads the program module 3 and program data 4 stored in the hard disk drive 303a to the RAM 301b as necessary, and executes each procedure. The other description is the same as the description of the computer that executes the control program that implements the same function as the server 100 described above.

1 OS
2 アプリケーションプログラム
3 プログラムモジュール
4 プログラムデータ
50 ネットワーク
60 アプリケーション
100a,100b,100c,100d,100e サーバ
110,210 通信部
140,240 記憶部
140a セッションテーブル
140b 削除待ちセッションテーブル
140c ファイル管理テーブル
150,250 制御部
150a マスタ調整部
150b レプリケーション部
150c 要求処理部
150d 復元処理部
200a,200b クライアント
220 入力部
230 表示部
240a セッション情報
250a 接続要求部
250b 要求部
250c 再接続要求部
250d 通知部
300 コンピュータ
301 メモリ
301a ROM
301b RAM
302 CPU
303 ハードディスクドライブインタフェース
303a ハードディスクドライブ
304 ディスクドライブインタフェース
304a ディスクドライブ
305 シリアルポートインタフェース
307 ネットワークインタフェース
308 バス
1 OS
2 Application program 3 Program module 4 Program data 50 Network 60 Application 100a, 100b, 100c, 100d, 100e Server 110, 210 Communication unit 140, 240 Storage unit 140a Session table 140b Deletion waiting session table 140c File management table 150, 250 Control unit 150a Master adjustment unit 150b Replication unit 150c Request processing unit 150d Restoration processing unit 200a, 200b Client 220 Input unit 230 Display unit 240a Session information 250a Connection request unit 250b Request unit 250c Reconnection request unit 250d Notification unit 300 Computer 301 Memory 301a ROM
301b RAM
302 CPU
303 Hard Disk Drive Interface 303a Hard Disk Drive 304 Disk Drive Interface 304a Disk Drive 305 Serial Port Interface 307 Network Interface 308 Bus

Claims (6)

同一のネットワークに含まれる複数の他のサーバおよび自サーバから、マスタの役割を有する単一のサーバを選出するマスタ調整部と、
前記マスタ調整部により自サーバがマスタの役割を有するサーバとして選出された場合に、クライアントからの接続要求に応答して、前記クライアントからのファイル処理要求に応じて、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録する際に、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録し、
ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値に達している場合には、ファイルに対するロック情報とセッションIDとを対応付けてロック待ちセッションに登録し、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満となった時点で、前記ロック待ちセッションに登録されたファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録し、
セッションIDを発行して接続したクライアントに情報を送信して監視し、該クライアントからの応答が届かない場合には、前記クライアントに発行したセッションIDに対応するロック情報を、前記ファイル管理テーブルから削除し、
前記ファイル管理テーブルに登録されるセッションIDおよびロック情報に基づき、前記ファイルのロックを行う要求処理部と、
前記マスタ調整部により自サーバがレプリカの役割を有するサーバとして選出された場合に、マスタの役割を有するサーバのセッションテーブルとファイル管理テーブルとを複製するレプリケーション部と、
自サーバがレプリカの役割を有するサーバから、マスタの役割を有するサーバに切り替わった場合には、前記マスタの役割を有するサーバから複製されたセッションテーブルの情報を削除待ちセッションテーブルに登録し、クライアントからの再接続要求に応答して、該再接続要求に含まれるセッションIDと同一のセッションIDを前記削除待ちセッションテーブルから削除し、該削除待ちセッションテーブルに残されたセッションIDに対応するロック情報を、前記マスタの役割を有するサーバから複製されたファイル管理テーブルから削除する復元処理部と
を有することを特徴とするサーバ。
A master coordinator that selects a single server having a master role from a plurality of other servers and its own server included in the same network;
When the own server is selected as the server having the master role by the master adjustment unit , in response to a connection request from the client, in response to the file processing request from the client, lock information and session ID for the file, When the number of locks for a file is less than the threshold indicated in the file management table, the lock information for the file and the session ID are associated and registered in the file management table. ,
When the number of locks on the file reaches the threshold indicated in the file management table, the lock information on the file and the session ID are associated with each other and registered in the lock waiting session, and the number of locks on the file is the file management When it becomes less than the threshold shown in the table, the lock information for the file registered in the lock waiting session and the session ID are associated with each other and registered in the file management table,
Issue a session ID and send information to the connected client for monitoring. If no response is received from the client, the lock information corresponding to the session ID issued to the client is deleted from the file management table. And
A request processing unit for locking the file based on a session ID and lock information registered in the file management table ;
A replication unit that replicates a session table and a file management table of a server having a master role when the master adjustment unit is selected as a server having a replica role by the master adjustment unit ;
When the local server switches from the server having the role of replica to the server having the role of master, the information of the session table replicated from the server having the role of master is registered in the session table waiting for deletion, and from the client In response to the reconnection request, the same session ID as the session ID included in the reconnection request is deleted from the deletion waiting session table, and lock information corresponding to the session ID remaining in the deletion waiting session table is stored. And a restoration processing unit for deleting from the file management table replicated from the server having the role of the master .
前記要求処理部は、前記クライアントからのファイル処理要求が、ファイルに対する共有ロックを要求している場合には、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録し、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値に達している場合には、ファイルに対するロック情報とセッションIDとを対応付けて前記ロック待ちセッションに登録し、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満となった時点で、前記ロック待ちセッションに登録されたファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録し、
前記クライアントからのファイル処理要求が、ファイルに対する排他ロックを要求している場合には、ファイルに対するロックがかかっていない場合に、ファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録し、前記クライアントに対するロックがかかっている場合には、ファイルに対するロック情報とセッションIDとを対応付けて前記ロック待ちセッションに登録し、ファイルに対するロックが解除された時点で、前記ロック待ちセッションに登録されたファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録することを特徴とする請求項1に記載のサーバ。
When the file processing request from the client requests a shared lock on the file, the request processing unit locks the file when the number of locks on the file is less than the threshold indicated in the file management table. Information and session ID are associated with each other and registered in the file management table, and when the number of locks on the file reaches the threshold indicated in the file management table, the lock information on the file is associated with the session ID. When the number of locks on the file becomes less than the threshold indicated in the file management table, the lock information and the session ID associated with the file registered in the lock waiting session are associated with each other. Register in the file management table ,
If the file processing request from the client requests an exclusive lock on the file, if the file is not locked, the file lock information and the session ID are associated with each other and registered in the file management table. When the lock is applied to the client, the lock information for the file and the session ID are associated with each other and registered in the lock waiting session. When the lock on the file is released, the lock information is registered in the lock waiting session. The server according to claim 1, wherein lock information and a session ID associated with the registered file are registered in the file management table in association with each other.
マスタまたはレプリカの役割を有する複数のサーバと、マスタの役割を有するサーバに接続する複数のクライアントとを備えたファイル管理システムであって、
前記サーバは、
同一のネットワークからマスタの役割を有する単一のサーバを選出するマスタ調整部と、
前記マスタ調整部により自サーバがマスタの役割を有するサーバとして選択された場合に、前記クライアントからの接続要求に応答して、前記クライアントにセッションIDを発行し、該セッションIDをマスタの役割を有するサーバから複製されたセッションテーブルに登録すると共に、前記クライアントからのファイル処理要求に応じて、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録する際に、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録し、
ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値に達している場合には、ファイルに対するロック情報とセッションIDとを対応付けてロック待ちセッションに登録し、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満となった時点で、前記ロック待ちセッションに登録されたファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録し、
セッションIDを発行して接続したクライアントに情報を送信して監視し、該クライアントからの応答が届かない場合には、前記クライアントに発行したセッションIDに対応するロック情報を、前記マスタの役割を有するサーバから複製されたファイル管理テーブルから削除し、
前記ファイル管理テーブルに登録されるセッションIDおよびロック情報に基づき、前記ファイルのロックを行う要求処理部と、
前記マスタ調整部により自サーバがレプリカの役割を有するサーバとして選択された場合に、マスタの役割を有するサーバのセッションテーブルとファイル管理テーブルとを複製するレプリケーション部と、
自サーバがレプリカの役割を有するサーバから、マスタの役割を有するサーバに切り替わった場合には、前記マスタの役割を有するサーバから複製されたセッションテーブルの情報を削除待ちセッションテーブルに登録し、クライアントからの再接続要求に応答して、該再接続要求に含まれるセッションIDと同一のセッションIDを前記削除待ちセッションテーブルから削除し、該削除待ちセッションテーブルに残されたセッションIDに対応するロック情報を、前記マスタの役割を有するサーバから複製されたファイル管理テーブルから削除する復元処理部と
を有することを特徴とするファイル管理システム。
A file management system comprising a plurality of servers having a master or replica role and a plurality of clients connected to the server having a master role,
The server
A master coordinator that selects a single server having a master role from the same network;
When the master adjustment unit selects the server as a server having the master role, in response to a connection request from the client, a session ID is issued to the client, and the session ID has the master role When registering in the session table copied from the server and registering in the file management table in association with the lock information and session ID for the file in response to the file processing request from the client, the number of locks for the file is If it is less than the threshold shown in the file management table, the lock information for the file and the session ID are associated with each other and registered in the file management table,
When the number of locks on the file reaches the threshold indicated in the file management table, the lock information on the file and the session ID are associated with each other and registered in the lock waiting session, and the number of locks on the file is the file management When it becomes less than the threshold shown in the table, the lock information for the file registered in the lock waiting session and the session ID are associated with each other and registered in the file management table,
Sending and monitoring information to the connected client by issuing a session ID, and if the response from the client does not arrive, lock information corresponding to the session ID issued to the client has the role of the master Delete from the file management table replicated from the server ,
A request processing unit for locking the file based on a session ID and lock information registered in the file management table ;
A replication unit that replicates a session table and a file management table of a server having a master role when the master adjustment unit is selected as a server having a replica role by the master adjustment unit ;
When the local server switches from the server having the role of replica to the server having the role of master, the information of the session table replicated from the server having the role of master is registered in the session table waiting for deletion, and from the client In response to the reconnection request, the same session ID as the session ID included in the reconnection request is deleted from the deletion waiting session table, and lock information corresponding to the session ID remaining in the deletion waiting session table is stored. And a restoration processing unit for deleting from the file management table replicated from the server having the role of the master .
前記クライアントは、アプリケーションからの指示に応じて、前記ファイル処理要求をマスタの役割を有するサーバに行い、
前記クライアントは、マスタの役割を有するサーバが切り替わった場合に、マスタの役割を有するサーバに前記再接続要求を行い、該再接続要求の応答を前記マスタの役割を有するサーバから受信しない場合には、再接続に失敗した情報を前記アプリケーションに通知する通知部を有することを特徴とする請求項3に記載のファイル管理システム。
In response to an instruction from the application, the client performs the file processing request to a server having a master role,
When the server having the master role is switched, the client makes the reconnection request to the server having the master role, and does not receive a response to the reconnection request from the server having the master role. The file management system according to claim 3, further comprising a notification unit that notifies the application of information that failed to reconnect.
サーバで実行されるファイル管理方法であって、
同一のネットワークに含まれる複数の他のサーバおよび自サーバから、マスタの役割を有する単一のサーバを選出するマスタ調整工程と、
前記マスタ調整工程により自サーバがマスタの役割を有するサーバとして選出された場合に、クライアントからの接続要求に応答して、前記クライアントにセッションIDを発行し、該セッションIDをセッションテーブルに登録すると共に、前記クライアントからのファイル処理要求に応じて、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録する際に、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録し、
ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値に達している場合には、ファイルに対するロック情報とセッションIDとを対応付けてロック待ちセッションに登録し、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満となった時点で、前記ロック待ちセッションに登録されたファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録し、
セッションIDを発行して接続したクライアントに情報を送信して監視し、該クライアントからの応答が届かない場合には、前記クライアントに発行したセッションIDに対応するロック情報を、前記ファイル管理テーブルから削除する要求処理工程と、
前記マスタ調整工程により自サーバがレプリカの役割を有するサーバとして選出された場合に、マスタの役割を有するサーバのセッションテーブルとファイル管理テーブルとを複製するレプリケーション工程と、
自サーバがレプリカの役割を有するサーバから、マスタの役割を有するサーバに切り替わった場合には、前記マスタの役割を有するサーバから複製されたセッションテーブルの情報を削除待ちセッションテーブルに登録し、クライアントからの再接続要求に応答して、該再接続要求に含まれるセッションIDと同一のセッションIDを前記削除待ちセッションテーブルから削除し、該削除待ちセッションテーブルに残されたセッションIDに対応するロック情報を、前記マスタの役割を有するサーバから複製されたファイル管理テーブルから削除し、前記ファイル管理テーブルに登録されるセッションIDおよびロック情報に基づき、前記ファイルのロックを行う復元工程と
を含んだことを特徴とするファイル管理方法。
A file management method executed on a server,
A master adjustment step of selecting a single server having a master role from a plurality of other servers and its own server included in the same network;
When the server is elected as a server having the master role by the master adjustment step , in response to a connection request from the client, a session ID is issued to the client, and the session ID is registered in the session table. When the lock information for a file and the session ID are registered in the file management table in association with the file processing request from the client, the number of locks for the file is less than the threshold indicated in the file management table In addition, the file lock table and the session ID are associated with each other and registered in the file management table,
When the number of locks on the file reaches the threshold indicated in the file management table, the lock information on the file and the session ID are associated with each other and registered in the lock waiting session, and the number of locks on the file is the file management When it becomes less than the threshold shown in the table, the lock information for the file registered in the lock waiting session and the session ID are associated with each other and registered in the file management table,
Issue a session ID and send information to the connected client for monitoring. If no response is received from the client, the lock information corresponding to the session ID issued to the client is deleted from the file management table. Request processing step to
A replication step of replicating the session table and file management table of the server having the role of the master when the server is elected as a server having the role of the replica by the master adjustment step ;
When the local server switches from the server having the role of replica to the server having the role of master, the information of the session table replicated from the server having the role of master is registered in the session table waiting for deletion, and from the client In response to the reconnection request, the same session ID as the session ID included in the reconnection request is deleted from the deletion waiting session table, and lock information corresponding to the session ID remaining in the deletion waiting session table is stored. A restoration step of deleting the file from the file management table replicated from the server having the role of the master and locking the file based on the session ID and lock information registered in the file management table. File management method.
同一のネットワークに含まれる複数の他のサーバおよび自サーバから、マスタの役割を有する単一のサーバを選出するマスタ調整ステップと、
前記マスタ調整ステップにより自サーバがマスタの役割を有するサーバとして選出された場合に、クライアントからの接続要求に応答して、前記クライアントにセッションIDを発行し、該セッションIDをセッションテーブルに登録すると共に、前記クライアントからのファイル処理要求に応じて、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録する際に、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満の場合に、ファイルに対するロック情報とセッションIDとを対応付けてファイル管理テーブルに登録し、
ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値に達している場合には、ファイルに対するロック情報とセッションIDとを対応付けてロック待ちセッションに登録し、ファイルに対するロックの数が前記ファイル管理テーブルに示される閾値未満となった時点で、前記ロック待ちセッションに登録されたファイルに対するロック情報とセッションIDとを対応付けて前記ファイル管理テーブルに登録し、
セッションIDを発行して接続したクライアントに情報を送信して監視し、該クライアントからの応答が届かない場合には、前記クライアントに発行したセッションIDに対応するロック情報を、前記ファイル管理テーブルから削除する要求処理ステップと、
前記マスタ調整ステップにより自サーバがレプリカの役割を有するサーバとして選出された場合に、マスタの役割を有するサーバのセッションテーブルとファイル管理テーブルとを複製するレプリケーションステップと、
自サーバがレプリカの役割を有するサーバから、マスタの役割を有するサーバに切り替わった場合には、前記マスタの役割を有するサーバから複製されたセッションテーブルの情報を削除待ちセッションテーブルに登録し、クライアントからの再接続要求に応答して、該再接続要求に含まれるセッションIDと同一のセッションIDを前記削除待ちセッションテーブルから削除し、該削除待ちセッションテーブルに残されたセッションIDに対応するロック情報を、前記マスタの役割を有するサーバから複製されたファイル管理テーブルから削除し、前記ファイル管理テーブルに登録されるセッションIDおよびロック情報に基づき、前記ファイルのロックを行う復元処理ステップと、
をコンピュータに実行させるためのファイル管理プログラム。
A master adjustment step of selecting a single server having a master role from a plurality of other servers and its own server included in the same network;
When the server is selected as a server having the master role by the master adjustment step , in response to a connection request from the client, a session ID is issued to the client, and the session ID is registered in the session table. When the lock information for a file and the session ID are registered in the file management table in association with the file processing request from the client, the number of locks for the file is less than the threshold indicated in the file management table In addition, the file lock table and the session ID are associated with each other and registered in the file management table,
When the number of locks on the file reaches the threshold indicated in the file management table, the lock information on the file and the session ID are associated with each other and registered in the lock waiting session, and the number of locks on the file is the file management When it becomes less than the threshold shown in the table, the lock information for the file registered in the lock waiting session and the session ID are associated with each other and registered in the file management table,
Issue a session ID and send information to the connected client for monitoring. If no response is received from the client, the lock information corresponding to the session ID issued to the client is deleted from the file management table. Request processing steps to
A replication step for replicating a session table and a file management table of a server having a master role when the server is elected as a server having a replica role by the master adjustment step ;
When the local server switches from the server having the role of replica to the server having the role of master, the information of the session table replicated from the server having the role of master is registered in the session table waiting for deletion, and from the client In response to the reconnection request, the same session ID as the session ID included in the reconnection request is deleted from the deletion waiting session table, and lock information corresponding to the session ID remaining in the deletion waiting session table is stored. A restoration processing step for deleting the file from the file management table replicated from the server having the role of the master and locking the file based on the session ID and lock information registered in the file management table ;
File management program that causes a computer to execute.
JP2012192477A 2012-08-31 2012-08-31 Server, file management system, file management method, and file management program Active JP5497861B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012192477A JP5497861B2 (en) 2012-08-31 2012-08-31 Server, file management system, file management method, and file management program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012192477A JP5497861B2 (en) 2012-08-31 2012-08-31 Server, file management system, file management method, and file management program

Publications (2)

Publication Number Publication Date
JP2014048969A JP2014048969A (en) 2014-03-17
JP5497861B2 true JP5497861B2 (en) 2014-05-21

Family

ID=50608553

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012192477A Active JP5497861B2 (en) 2012-08-31 2012-08-31 Server, file management system, file management method, and file management program

Country Status (1)

Country Link
JP (1) JP5497861B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6676352B2 (en) * 2015-11-27 2020-04-08 株式会社三菱Ufj銀行 Data processing device
SG11201703159XA (en) 2015-12-14 2017-07-28 Huawei Tech Co Ltd Lock management method in cluster, lock server, and client
BR112017011541B1 (en) 2015-12-30 2023-09-26 Huawei Technologies Co., Ltd METHOD FOR PROCESSING A BLOCK REQUEST, BLOCK REQUEST MANAGEMENT APPARATUS AND SERVER
JP6683049B2 (en) 2016-07-20 2020-04-15 富士通株式会社 Information processing apparatus, information processing method, information processing system, and program
JP2018142129A (en) * 2017-02-27 2018-09-13 富士通株式会社 Information processing system, information processing method, and information processing apparatus
JP6561162B2 (en) * 2018-03-07 2019-08-14 華為技術有限公司Huawei Technologies Co.,Ltd. Lock management method, lock server and client in cluster

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08235043A (en) * 1995-02-28 1996-09-13 N T T Data Tsushin Kk Cooperative distributed system
JP2001067257A (en) * 1999-08-30 2001-03-16 Toshiba Corp Inter-distributed node exclusive updating device
JP2008033778A (en) * 2006-07-31 2008-02-14 Nec Corp Computer system, database restoration method, and database restoration program

Also Published As

Publication number Publication date
JP2014048969A (en) 2014-03-17

Similar Documents

Publication Publication Date Title
JP5497861B2 (en) Server, file management system, file management method, and file management program
US20190146884A1 (en) Systems and methods for service replication, validation, and recovery in cloud-based systems
US8655851B2 (en) Method and system for performing a clean file lock recovery during a network filesystem server migration or failover
US10127124B1 (en) Performing fencing operations in multi-node distributed storage systems
US8930309B2 (en) Interval-controlled replication
WO2018036148A1 (en) Server cluster system
US9785691B2 (en) Method and apparatus for sequencing transactions globally in a distributed database cluster
JP2018534665A (en) Input / output fencing optimization
US20120259820A1 (en) Method and system for restarting file lock services at an adoptive node during a network filesystem server migration or failover
US7620721B2 (en) Pre-existing content replication
TW497071B (en) Method and apparatus for managing clustered computer systems
US11409622B1 (en) Methods and systems for a non-disruptive planned failover from a primary copy of data at a primary storage system to a mirror copy of the data at a cross-site secondary storage system without using an external mediator
US11144405B2 (en) Optimizing database migration in high availability and disaster recovery computing environments
Jian-Hua et al. Cloud computing-based data storage and disaster recovery
US11550679B2 (en) Methods and systems for a non-disruptive planned failover from a primary copy of data at a primary storage system to a mirror copy of the data at a cross-site secondary storage system
US20080077635A1 (en) Highly Available Clustered Storage Network
US20180052902A1 (en) Network partition handling in fault-tolerant key management system
US20220318104A1 (en) Methods and systems for a non-disruptive automatic unplanned failover from a primary copy of data at a primary storage system to a mirror copy of the data at a cross-site secondary storage system
KR20130131362A (en) Providing transparent failover in a file system
EP3928208A1 (en) System and method for self-healing in decentralized model building for machine learning using blockchain
JP2009508191A (en) Enterprise server version migration via ID storage
US11537314B1 (en) Resynchronization of individual volumes of a consistency group (CG) within a cross-site storage solution while maintaining synchronization of other volumes of the CG
Hine et al. An architecture for distributed OASIS services
US20150186485A1 (en) Robust communication system for guaranteed message sequencing with the detection of duplicate senders
CN112783694B (en) Long-distance disaster recovery method for high-availability Redis

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140115

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140304

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140306

R150 Certificate of patent or registration of utility model

Ref document number: 5497861

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150