JP4571090B2 - Scheduler program, server system, scheduler device - Google Patents
Scheduler program, server system, scheduler device Download PDFInfo
- Publication number
- JP4571090B2 JP4571090B2 JP2006089542A JP2006089542A JP4571090B2 JP 4571090 B2 JP4571090 B2 JP 4571090B2 JP 2006089542 A JP2006089542 A JP 2006089542A JP 2006089542 A JP2006089542 A JP 2006089542A JP 4571090 B2 JP4571090 B2 JP 4571090B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- node
- data
- transaction
- processing
- 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.)
- Expired - Fee Related
Links
- 238000012545 processing Methods 0.000 claims description 84
- 238000000034 method Methods 0.000 claims description 52
- 230000008569 process Effects 0.000 claims description 41
- 238000003860 storage Methods 0.000 claims description 18
- 230000004044 response Effects 0.000 claims description 15
- 230000010076 replication Effects 0.000 claims description 5
- 230000004308 accommodation Effects 0.000 description 40
- 238000007726 management method Methods 0.000 description 24
- 230000006870 function Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 9
- 238000002360 preparation method Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000002688 persistence Effects 0.000 description 3
- 239000000470 constituent Substances 0.000 description 2
- 230000010006 flight Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 125000002066 L-histidyl group Chemical group [H]N1C([H])=NC(C([H])([H])[C@](C(=O)[*])([H])N([H])[H])=C1[H] 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000004215 lattice model Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、複数のノードを含むサーバシステムにおけるタスク処理技術に関する。 The present invention relates to a task processing technique in a server system including a plurality of nodes.
ユーザがウェブブラウザ等を使用してインターネット経由でサーバシステムに送信するサービス要求は、年々増大している。このようなウェブブラウザからなされるサービス要求は、ユーザが対話的に実行するためにサーバとのセッションが長時間に及ぶ場合がある。セッションからの断続的な要求にも即時応答するためには、セッション情報やプログラムをサーバのメモリ上に保持しておかなくてはならない。サービス要求の増大とともにサーバが必要とするメモリリソースも増加する傾向にあるため、メモリリソースを安価に確保したいという要請が存在する。 Service requests that users transmit to server systems via the Internet using a web browser or the like are increasing year by year. A service request made from such a web browser may be executed for a long time by a session with the server because the user interactively executes the service request. In order to respond immediately to intermittent requests from a session, session information and programs must be stored in the server's memory. As the service demand increases, the memory resources required by the server tend to increase, and there is a demand for securing memory resources at a low cost.
そこで、比較的安価な複数のサーバまたはパーソナルコンピュータを網目状に接続してサービス要求から派生するタスクを分散することで、高速処理を実現するグリッドコンピューティングが注目されている。グリッドコンピューティングのユーザは、グリッドにプーリングされている膨大な処理能力や記憶容量を利用することができる。 Accordingly, attention has been paid to grid computing that realizes high-speed processing by connecting a plurality of relatively inexpensive servers or personal computers in a network and distributing tasks derived from service requests. Grid computing users can use the enormous processing power and storage capacity pooled in the grid.
一般に、サービス要求においては、データベースからのデータの読み出しやデータベースへの書き込みが頻繁に実施される。そのため、データベースとのトランザクションに要する時間を短縮できれば、サービス要求に対する応答時間の短縮が期待できる。例えば、特許文献1には、データベースとのトランザクションにおいて永続化すべきデータをデータベースに保存させる処理であるコミットに必要な時間を削減するために、ディスクよりも高速に書き込みできる揮発性のメモリを利用するものが開示されている。
実行順序の定められている複数のタスクを実行するとき、タスクを複数のノードに分散配置しても、前のタスクが終了しない限り後のタスクの処理を開始できない。この制約をもたらす大きな要因として、前のタスクでデータベースとのトランザクションを実施する場合、該トランザクションにおけるデータの変更がコミットで確定されるまでは、後のタスクを開始できないことが挙げられる。すなわち、トランザクションのコミットに時間がかかると、その分サービス要求に対する応答が遅くなる。 When a plurality of tasks having a predetermined execution order are executed, even if the tasks are distributed to a plurality of nodes, the processing of the subsequent task cannot be started unless the previous task is completed. A major factor causing this restriction is that when a transaction with a database is performed in the previous task, the subsequent task cannot be started until the data change in the transaction is confirmed by the commit. That is, if it takes time to commit the transaction, the response to the service request is delayed accordingly.
本発明はこうした状況に鑑みてなされたものであり、その目的は、サービス要求の応答速度を改善する技術を提供することにある。 The present invention has been made in view of such circumstances, and an object thereof is to provide a technique for improving the response speed of a service request.
本発明のある態様は、それぞれがプロセッサを備える複数のノードと所定のデータを格納するデータベースとを含むサーバシステムにおいて、該サーバシステム内のノードにおけるタスクのスケジューリングを担当するスケジュールノードで実行されるスケジューラプログラムである。このプログラムは、クライアント端末から与えられるサービス要求に応じて、実行順序が定められた複数タスクの各ノード上での実行を制御する。このプログラムは、複数タスクをサーバシステム内の異なるタスク実行ノードに割り当てる割り当て機能と、1つのタスク実行ノードにおける、データベース内のデータの利用または編集を含む現行のタスクの処理が完了する前に、そのタスクでの処理結果の予測をもとに別のタスク実行ノードにおいて後続のタスクの処理を先行して実行させるタスク先行実行指示機能と、クライアント端末との接続に必要となるデータを、後続のタスクに引き渡すために前記別のタスク実行ノードに対して送信するデータ複製機能と、をスケジュールノードに発揮させる。 An aspect of the present invention is a server system including a plurality of nodes each including a processor and a database storing predetermined data, and a scheduler executed by a schedule node responsible for scheduling tasks in the nodes in the server system It is a program. This program controls the execution on each node of a plurality of tasks whose execution order is determined in response to a service request given from a client terminal. This program has an assignment function that assigns multiple tasks to different task execution nodes in the server system, and before one task execution node completes the processing of the current task, including the use or editing of data in the database. Based on the prediction of the processing result of the task, the task pre-execution instruction function that executes the processing of the succeeding task in advance in another task execution node and the data required for the connection with the client terminal are sent to the succeeding task. The schedule node is caused to exhibit a data replication function to be transmitted to the other task execution node for delivery to the other node.
この態様では、実行順序が定められた複数のタスクを異なるノードに割り当てる分散コンピューティングにおいて、実行中の現行タスクの処理が完了する前に後続のタスクの実行を先行して開始する。これによって、後続のタスクをより早く完了できるので、サービス要求に対する全体としての応答時間を短縮することができる。また、実行の順序が決まっているタスクでも、実質的な並列処理を実現できる。 In this aspect, in distributed computing in which a plurality of tasks having a predetermined execution order are assigned to different nodes, execution of the subsequent task is started before the processing of the current task being executed is completed. As a result, subsequent tasks can be completed earlier, and the overall response time to a service request can be reduced. In addition, substantial parallel processing can be realized even for tasks whose execution order is determined.
タスク先行実行指示機能は、現行のタスクの処理が、当該タスクの処理が割り当てられたタスク実行ノードとデータベースとの間のトランザクションで発生したデータ書き込みまたはデータ書き換えを確定させるデータ永続化処理であるときに、後続のタスクの処理を先行して実行させてもよい。 In the task advance execution instruction function, when the current task process is a data persistence process that confirms data write or data rewrite that occurred in the transaction between the task execution node to which the task process is assigned and the database In addition, the processing of the subsequent task may be executed in advance.
データ永続化処理が終了するまで現行のタスクは待機しなければならないが、この態様によると後続のタスクがその待機時間の間に先行して実行されるので、データベースにおけるトランザクションの負荷の大小にかかわらず、現行タスクの実質的な待機時間を削減することができる。 The current task must wait until the data persistence process is finished, but according to this aspect, subsequent tasks are executed in advance during the waiting time, so the transaction load in the database is large or small. Therefore, the substantial waiting time of the current task can be reduced.
本発明の別の態様は、それぞれがプロセッサを備える複数のノードと所定のデータを格納するデータベースとを含むサーバシステムである。このシステムは、上述のスケジューラプログラムを実行するスケジュールノードである子ノードと、上述の割り当て機能により割り当てられたタスクを実行するタスク実行ノードである孫ノードと、データベースに対する処理を取り扱うトランザクションノードと、を含む。 Another aspect of the present invention is a server system including a plurality of nodes each including a processor and a database storing predetermined data. This system includes a child node that is a schedule node that executes the scheduler program, a grandchild node that is a task execution node that executes a task assigned by the assignment function, and a transaction node that handles processing for a database. Including.
サーバシステムは、複数のノードと接続されいずれのノードからもアクセス可能に構成され、上述のスケジューラプログラムを格納する記憶装置をさらに備えてもよい。これによって、サーバシステム内のいずれのノードが子ノードに決定された場合であっても、そのノードにスケジューラプログラムをロードすることができる。 The server system may be connected to a plurality of nodes and configured to be accessible from any node, and may further include a storage device that stores the above-described scheduler program. Thus, even if any node in the server system is determined as a child node, the scheduler program can be loaded on that node.
なお、以上の構成要素の任意の組合せ、本発明を方法、装置、システム、記録媒体、コンピュータプログラムにより表現したものもまた、本発明の態様として有効である。 It should be noted that any combination of the above-described components and a representation of the present invention by a method, apparatus, system, recording medium, and computer program are also effective as an aspect of the present invention.
本発明によれば、サービス要求の応答速度を改善することができる。 According to the present invention, the response speed of service requests can be improved.
本発明の一実施形態は、それぞれがプロセッサを備える複数のノードを含むサーバシステムにおいて、サービス要求から派生する実行順序の定められた複数のタスクをシステム内の異なるノードに展開しておき、あるタスクの処理が完了する前に、そのタスクの処理結果の予測をもとに別のノードにおいて後続するタスクを先行して実行するものである。前のタスクが完了する前に後続のタスクの処理を開始することによって、サービス要求への応答時間を改善することができる。
以下、図面を参照してこの実施形態について詳細に説明する。
According to an embodiment of the present invention, in a server system including a plurality of nodes each including a processor, a plurality of tasks having a predetermined execution order derived from a service request are expanded to different nodes in the system. Before the process is completed, the subsequent task is executed in advance in another node based on the prediction of the processing result of the task. By starting the processing of the subsequent task before the previous task is completed, the response time to the service request can be improved.
Hereinafter, this embodiment will be described in detail with reference to the drawings.
図1は、本発明の一実施形態に係る格子型コンピュータシステム100と、これに接続されるクライアント端末12の全体構成図である。ここで、本実施形態が対象とする「格子型コンピュータシステム」とは、サーバまたはパーソナルコンピュータ等のそれぞれがプロセッサを備える複数のノードを格子状に接続させたシステムのことを言う。
FIG. 1 is an overall configuration diagram of a
図1に示すように、格子型コンピュータシステム100は、クライアント端末12から発行される要求に対して特定のサービスを提供するノード群10を備える。ノード群10は、複数列複数行(図1では四行四列)の格子を形成するようにノードが配置される。図1では、各ノードを白抜きの正方形で表している。これら格子状に配列されたノードが他のノードの全てと通信可能なように複数のルータ(図示せず)がノード間に設けられ、これらのルータはインターネット、LAN、WAN等のネットワーク14に接続される。格子型コンピュータシステム100は、企業のデータセンタ等に配置され、多数のサービス要求に同時に応答することが可能である。
As shown in FIG. 1, the
図1のノード群10は、各ノードを論理ノードとして表した格子モデルとして示されている。論理ノードとは、一台のルータに複数のサーバまたはパーソナルコンピュータが接続されているときそれらを1つのノードに代表させて表したものである。しかしながら、図1の各ノードが一台のサーバまたはパーソナルコンピュータに対応していてもよい。また、図1ではノード群10を四行四列としているが、より多数またはより少数のノードで構成されていてもよいことは言うまでもない。
The
ノード群10内の各ノードは、ルータを介して記憶装置24にアクセス可能に構成されている。サービス要求の処理に必要となるスケジューラプログラム、アプリケーションプログラムは記憶装置24に格納されており、必要に応じてプログラムやデータは記憶装置24から各ノードに送信可能となっている。また、アプリケーションの実行に必要なテーブルはデータベース26に格納されている。ノード群10内の各ノードは、トランザクションノード16を介してデータベース26にアクセス可能に構成されている。トランザクションノード16の詳細については、図3を参照して後述する。
記憶装置24とデータベース26は、一般にはハードディスク装置であり、多数のノードからの書き込み要求に見合った性能を発揮するように複数のディスクをまとめて構成される。記憶装置24とデータベース26は光磁気ディスク装置や不揮発性メモリであってもよい。
Each node in the
The
クライアント端末12は、キーボードやマウスなどの入力装置とディスプレイなどの出力装置を備えるパーソナルコンピュータ、または、それに準ずる入出力装置を備える携帯電話であってもよい。ただし、携帯電話の場合には、無線で通信することを想定する。ユーザは、クライアント端末12上でウェブブラウザ等を使用して、格子型コンピュータシステム100に対してサービス要求を発行する。このサービス要求は、例えば、証券の発注処理や、旅行の予約処理などが考えられる。これらの例に見られるサービス要求をサーバで処理する際に、ユーザはウェブブラウザを使用して対話的にサービス要求を具体化していく。
The
図2は、ノード群10を構成する各ノードの構成を示す。ノードは、プログラムにしたがって各種処理を実行するプロセッサ92と、一時的にデータやプログラムを記憶するメモリ94と、ノードの再起動があっても記録内容が失われないハードディスクドライブ、DVDドライブなどの記憶装置96と、ネットワークに接続し各種の入出力処理を実行するネットワークインタフェース98と、これらを相互接続するバス90とを少なくとも含む。各ノードは、必要に応じて、キーボードやマウスなどの入力装置、ディスプレイなどの出力装置を有していてもよい。なお、1つのノードが2つ以上のネットワークインタフェース98を有していてもよい。
FIG. 2 shows the configuration of each node constituting the
各ノードは、格子型コンピュータシステムを構成するのに適したコンパクトな形状、すなわちプロセッサ、メモリ、ハードディスク、バスなどが搭載されたブレード型の筐体を有する。ノード群10は、このブレード型筐体がラックに多数並ぶ配置となることが好ましいが、他の態様であってもよい。
Each node has a compact shape suitable for configuring a lattice type computer system, that is, a blade-type housing on which a processor, a memory, a hard disk, a bus, and the like are mounted. The
ところで、図1に示すような複数のノードを接続して使用するグリッドコンピューティングにおいては、グリッドを構成するノード間で、サービス要求から派生するタスクをどのように割り当てるかが大きな問題となる。 By the way, in grid computing using a plurality of nodes connected to each other as shown in FIG. 1, how to assign a task derived from a service request between nodes constituting the grid is a big problem.
例えば、1つのサービス要求からいくつものタスクが派生し、それらのタスク間で情報を交換する場合には、タスクが割り当てられるノードを近傍にまとめた方が効率的に要求を処理することができる。しかしながら、いくつかのサービス要求に対してグリッド内のノードの占有を自由に認めると、データフローの交差などにより特定のノードの負荷が増大し、その結果システム全体のパフォーマンスが低下してしまうおそれがある。したがって、グリッドコンピューティングにおいては、サービス要求の特性を考慮したタスク割り当ての必要性が高い。
そこで、本実施形態では、サービス要求の特性に応じたタスク割り当てを実行するスーパースケジューラとスケジューラとをノード群10内のノードに配置している。
For example, when a number of tasks are derived from one service request and information is exchanged between the tasks, the request can be processed more efficiently if the nodes to which the tasks are assigned are grouped in the vicinity. However, if it is possible to freely occupy a node in the grid for some service requests, the load on a specific node may increase due to the crossing of data flows, and as a result, the performance of the entire system may decrease. is there. Therefore, in grid computing, there is a high need for task assignment in consideration of the characteristics of service requests.
Therefore, in the present embodiment, a super scheduler and a scheduler that execute task assignment according to the characteristics of the service request are arranged in the nodes in the
図1に戻り、本明細書においては、ノード群10の中で、スーパースケジューラ22を有し格子型コンピュータシステム100全体のタスク割り当てを監視するノードを「親ノード」、スケジューラ30を有しサービス要求に応じて一定範囲内でのタスク割り当てを監視するノードを「子ノード」、子ノードのスケジューラ30によりタスク割り当てがなされるノードを「孫ノード」と呼ぶことにする。
Returning to FIG. 1, in this specification, among the
また、本明細書において「タスク」とは、ある目的を達成するアプリケーションのプログラムコードを分割したものを指し、「サービス要求」から「タスク」が派生するとき、それらのタスクの間には並列や直列といった実行の順序関係が明確になっていることが前提となる。タスクは、トランザクションを含む場合もあれば、含まない場合もある。後者の例として、ウェブページに埋め込まれているスクリプトの実行やコンポーネント呼出しを伴うもののデータベースにはアクセスしないタスクが挙げられる。本実施形態が効果をもたらすのは、サービス要求から派生したタスクのうち、少なくとも1つのタスクがトランザクションを含む場合である。 Further, in this specification, “task” refers to a division of the program code of an application that achieves a certain purpose, and when “task” is derived from “service request”, these tasks are processed in parallel. It is assumed that the order relationship of execution such as serial is clear. A task may or may not include a transaction. As an example of the latter, there is a task that does not access the database although it involves execution of a script embedded in a web page or component call. This embodiment is effective when at least one task among transactions derived from a service request includes a transaction.
続いてスーパースケジューラ22とスケジューラ30の動作の概略を説明する。
Next, an outline of operations of the
クライアント端末12から格子型コンピュータシステム100に対して発行されたサービス要求は、まず親ノード18により受け取られる。サービス要求を受け取ると、親ノード18のスーパースケジューラ22は、そのサービス要求を分析する。具体的には、システム100に到来するサービス要求の種類や同時トランザクション数などの見積もりにしたがって、必要リソース量を推定する。この見積もりは、システム100のオペレータによって手作業で入力されてもよいし、過去の統計に基づいてスーパースケジューラ22が算出してもよい。
A service request issued from the
続いて、スーパースケジューラ22は、この見積もりにしたがって、サービス要求毎に必要となるノード数をノード群10内で確保し、サービス要求処理の起点となる子ノード20の数を決定し、子ノード20をノード群10内に展開させて配置する。
Subsequently, according to this estimate, the
子ノードの配置が決定すると、子ノードと決定されたノードに対して記憶装置24からスケジューラプログラムが送信され、子ノード20においてスケジューラ30として機能する。スケジューラ30は、自身のサービス要求を処理するために必要なリソースをスーパースケジューラ22に通知する。スーパースケジューラ22は、システム外部のクライアント端末12に対して子ノード20のネットワークアドレスを通知する。これ以降のサービス要求は、子ノード20に直接送られる。
When the placement of the child node is determined, the scheduler program is transmitted from the
スケジューラ30は、サービス要求の特性に基づいて、タスクをノード群10内のいくつかのノードに割り当てる処理を実行する。まず、スケジューラ30は、サービス要求毎に予め対応させているアプリケーションを呼び出し、アプリケーションを構成するタスクを処理するために、タスク処理プログラムをノード群10内の他のノードに割り当てる。これらが孫ノード50、54になる。タスク処理プログラムのコードは、記憶装置24から孫ノード50、54に送信されて、メモリに読み込まれた後、サービス要求に備えてメモリ上に待機する。そして、タスクが割り当てられた孫ノード50、54において、タスク処理プログラムによりタスクの処理が実行される。タスク処理の結果は、ネットワーク14経由でクライアント端末12に送信される。クライアント端末12は、送信されたデータに基づいてディスプレイに結果を表示する。
The
一般に、サービス要求から派生するタスクを複数のノードに展開することによって、以下のようなメリットがある。
第1に、タスクの実行に必要なリソースを確保することができる。また、同一のノードで複数のタスクを同時に起動する場合に発生するリソースの競合が起こりにくい。
さらに、同一ノードで複数のタスクを実行する場合と比べて、オペレーティングシステムにおけるタスク切り換えのオーバーヘッドが少ない。したがって、タスクを別ノードに分けることで、レスポンスおよびスループットの向上が期待できる。
In general, deploying a task derived from a service request to a plurality of nodes has the following advantages.
First, it is possible to secure resources necessary for executing a task. Also, resource contention that occurs when a plurality of tasks are activated simultaneously on the same node is less likely to occur.
Furthermore, the task switching overhead in the operating system is less than when a plurality of tasks are executed on the same node. Therefore, the response and throughput can be improved by dividing the task into different nodes.
ところで、高度なサービス要求の場合には、タスク間の依存関係を反映した実行順序制御が必要になる。例えば、インターネット経由で海外旅行の予約を受け付けるウェブサイトでは、「希望旅程の入力」に続いて「交通機関の予約」「宿泊施設の予約」などのタスクを逐次実行していく必要がある。このような場合、後のタスクを実行するためには前のタスクの情報を引き継ぐ必要がある。 By the way, in the case of an advanced service request, execution order control reflecting the dependency between tasks is required. For example, on a website that accepts reservations for overseas travel via the Internet, it is necessary to sequentially execute tasks such as “reservation of transportation facilities” and “reservation of accommodation facilities” following “input of desired itinerary”. In such a case, it is necessary to take over the information of the previous task in order to execute the subsequent task.
このようなタスク間に依存関係があり直列的に処理する必要のあるタスクを、本明細書では「直列関係にあるタスク」と呼ぶ。直列関係にあるタスクは、通常は前のタスクが正常に終了するまでは、後のタスクを開始することができない。例えば、後述する分散トランザクションにおける2フェーズコミットでは、コミットの結果がタスクに通知されるまでの間、そのタスクは待機する必要があり、次のタスク処理に移行することができない。 Such a task that has a dependency relationship between tasks and needs to be processed in series is called a “task in a serial relationship” in this specification. A task in a serial relationship usually cannot start a subsequent task until the previous task is completed normally. For example, in a two-phase commit in a distributed transaction described later, the task needs to wait until the commit result is notified to the task, and cannot move to the next task process.
そこで、本実施形態では、ある孫ノードで実行中のタスク(以下、「現行タスク」という)とデータベースとの間のトランザクションが完了する前に、実行中のタスクの結果、具体的にはトランザクションの結果を予測した上で、その予測に基づいて別の孫ノードにおいて後続のタスクを先行して実行するようにした。 Therefore, in this embodiment, before a transaction between a task being executed on a grandchild node (hereinafter referred to as “current task”) and the database is completed, the result of the task being executed, specifically, the transaction After predicting the result, the subsequent task is executed in advance in another grandchild node based on the prediction.
図3は、タスクの先行実行を可能にする子ノード20のスケジューラ30と、トランザクションノード16の構成を示す機能ブロック図である。これらの構成は、ハードウェア的には、プロセッサ、メモリ、バス等で実現でき、ソフトウェア的にはメモリにロードされたプログラムなどによって実現されるが、ここではそれらの連携によって実現される機能ブロックを描いている。したがって、これらの機能ブロックがハードウェアのみ、ソフトウェアのみ、またはそれらの組合せによっていろいろな形で実現できることは、当業者には理解されるところである。
FIG. 3 is a functional block diagram showing a configuration of the
スケジューラ30は、もっぱらソフトウェアとして実装され、そのプログラムはノードの記憶装置96、またはノードに共有される記憶装置24からロードされる。図3によれば、スケジューラ30には、タスク割り当て部32、タスク先行実行指示部34、データ複製部42、画面表示制御部44、障害処理部46が含まれる。
The
タスク割り当て部32は、上述した手順にしたがって、サービス要求から派生した各タスクをノード群10内の適切な孫ノードに割り当てる。図3では、孫ノードAと孫ノードBにそれぞれ現行タスク52、次タスク56を割り当てている。現行タスク52と次タスク56とは直列関係にある。
The
タスク先行実行指示部34は、データベース26内のデータの利用または編集を含む現行タスクの処理が完了する前に、現行タスクでの処理結果の予測をもとに、別のノードに割り当てた次タスクの処理を先行して実行させる。より具体的には、孫ノードAにおける現行タスク52が、現行タスク52とデータベース26との間のトランザクションで発生したデータ書き込みまたはデータ書き換えを確定させる命令であるコミット(データ永続化)をトランザクションマネージャ36に依頼したとき、タスク先行実行指示部34は、そのコミットの完了通知を待たずに、トランザクションが成功したものとして、次タスク56の処理開始を孫ノードBに指示する。トランザクションマネージャ36の機能および処理については後述する。
The task pre-execution
データ複製部42は、現行タスク52のコミットの完了を待たずに次タスク56を先行して実行するときに必要となるセッションデータを、次タスク56に引き渡すために次タスク56が割り当てられた孫ノードBに送信する。孫ノードAの現行タスク52のメモリイメージに保持されているセッションデータをデータ複製部42が複製した上で、孫ノードBに送信してもよいし、孫ノードAに対して、セッションデータを孫ノードBに送信するように指示してもよい。
The
セッションデータは、クライアント端末のIPアドレス、ユーザ名、タスクが実行されているノードのID、タスクの状態などのクライアント端末との通信に必要となるデータと、現行タスクがトランザクションでデータベースに書き込むべきデータのうち次タスクの実行に必要となるデータとを含む。 Session data includes data required for communication with the client terminal, such as the IP address of the client terminal, the user name, the ID of the node on which the task is executed, and the task status, and data that the current task should write in the database in a transaction Data necessary for executing the next task.
データ複製部42により、セッションデータが孫ノードAと孫ノードBとに二重化されることになる。そのため、いずれかのノードで障害が発生したときにもセッションデータが維持され、その後のクライアント端末との通信が可能になるので、障害時のシステムの耐性を上げることができるという効果もある。
The
データ複製部42によってセッションデータを次タスク56に複製し、タスク先行実行指示部34が孫ノードBに対して次タスク56の実行を指示することで、現行タスク52のトランザクションにおけるコミットの待ち時間の間に、次タスク56の実行を開始することができる。
The
現行タスク52と次タスク56のいずれにもクライアント端末12への画面表示が伴う場合には、現行タスク52と次タスク56とを並列的に実行し、それぞれのタスクの処理結果がクライアント端末12に送信され画面表示がなされると、ユーザを混乱させることになる。そこで、画面表示制御部44は、複数のタスクが同時実行されているときの画面表示を調整する。
When both the
図4は、画面表示制御部44による制御を説明する図である。図中、横軸は時間経過を表し、実線は、クライアント端末12のディスプレイに画面が表示される状態を表している。
FIG. 4 is a diagram for explaining control by the screen
現行タスクについての画面表示がなされている間に、現行タスクによりトランザクションマネージャ36に対してコミットが依頼され、これを契機にタスク先行実行指示部34により次タスクの開始が指示されると(t1)、画面表示制御部44は、タスクの処理結果としての画面表示データの受け取り先を現行タスクから次タスクに切り換える。そして、現行タスクの画面表示データをバッファに蓄積するとともに、現行タスクの処理結果の予測に基づいた次タスクの画面表示データをクライアント端末12に対して送信する(t1〜t2)。これによって、ユーザには、現行タスクは終了して次のタスクに制御が移ったように見える。
While the screen for the current task is being displayed, a commit is requested to the
現行タスクのトランザクションが正常に完了すると(t2)、バッファに蓄積された現行タスクの画面表示データは破棄し、次タスク56の画面表示データの送信を継続する(t2以降)。現行タスクが正常に完了しなかった場合には、後述する障害処理部46によって障害処理プロセスが実行される。
When the transaction of the current task is completed normally (t2), the screen display data of the current task accumulated in the buffer is discarded, and transmission of the screen display data of the
画面表示制御部44は、画面表示データの受け取り先を現行タスクから次タスクに切り換える間(t1〜t2)に、ユーザからクライアント端末12を介してなされた入力をバッファする機能を備えていてもよい。この間になされた入力は、現行タスクのトランザクションが正常に完了した後(t2以降)、次タスクに送られる。
The screen
このように、データ複製部42と画面表示制御部44とによって、クライアント端末12を操作するユーザからは2つのタスクが同時に実行されていることが見えなくなり、ユーザに意識させずに次タスクの先行実行を進めることができる。
In this way, the
図3に戻り、障害処理部46は、現行タスク52のトランザクションの完了前に障害が発生したとき、現行タスクまたはサービス要求毎に予め定められている障害処理プロセスを、現行タスク52および次タスク56が割り当てられた孫ノードA、孫ノードBに実行させる。現行タスク52のトランザクションが正常に終了した場合には何もしない。障害処理プロセスは、例えば、1.次タスクに割り込み処理をする、2.現行タスクのコミットの成功予測に基づいて次タスクにおいてデータベースへの書き込みや変更が既になされていた場合には、データベースをロールバックする、3.現行タスクのコミットの成功予測に基づいてクライアント端末に既にメッセージが送信されていた場合には、クライアント端末にエラーメッセージを送信する、4.障害の状況をログに残す、などがある。
Returning to FIG. 3, when a failure occurs before the completion of the transaction of the
次に、トランザクションノード16の説明に移る。トランザクションノード16は、データベースへのデータの書き込み、書き換え、データの読み取りなどを担当するノードである。図1では、トランザクションノード16をノード群10の外部に描いているが、ノード群10に含まれるノードであってもよい。トランザクションノード16には、トランザクションマネージャ36、データベースライタ38、ログライタ40が含まれる。
Next, the description of the
トランザクションマネージャ36は、タスクとデータベースの間に位置し、トランザクションを制御、監視する機能を有する。孫ノードAで実行されている現行タスク52は、データベース26にアクセスする必要がある場合、トランザクションにトランザクションIDを割り当てた上で、予め有している呼出しライブラリを参照してトランザクションノード16にあるトランザクションマネージャ36を呼び出す。トランザクションIDは、スケジューラ30とデータベースライタ38に渡される。現行タスク52がトランザクションマネージャ36に対してコミットを依頼すると、そのことが現行タスク52を経由してスケジューラ30にも伝達される。
The
スケジューラ30のタスク先行実行指示部34は、コミット依頼の情報を受け取ると、現行タスクのコミットの結果を予測する。通常は、現行タスクによるコミットが成功すると予測する。コミットが成功するとの前提の上で、タスク先行実行指示部34は孫ノードBに割り当てた次タスク56の実行開始を指示する。
When the task predecessor
一旦タスクからトランザクションマネージャ36に対してデータのコミットが依頼されると、以降の処理はトランザクションマネージャ36が実行する。そのため、タスク側で複数の命令をデータベースに対して発する必要が無くなり、タスクからトランザクションの処理が隠蔽される。
Once the task requests the
トランザクションマネージャ36は、コミットの成功または失敗についても現行タスクを経由してスケジューラに伝達する。スケジューラの障害処理部46は、これに基づいて障害処理の実行を判断する。
The
データベースライタ38は、データベース26へのデータの書き込み、書き換えを実行する。
The
ログライタ40は、データベースライタ38によるデータベースの状態の変更やコミットの順序などをログに記録する。このログを参照することで、障害発生時にデータベースのロールバックが可能になる。「ロールバック」とは、データベースの変更を取り消す処理であり、新しいデータをデータベースに書き込んだ場合であっても、コミットする前なら書き込みを破棄することができる。ロールバックが実施されると、データベースはデータを変更していない元の状態に維持される。
The
図5は、トランザクションマネージャ36による分散トランザクションの一般的な処理手順を示す。1つのトランザクションで複数のデータベースにアクセスする分散トランザクションでは、それぞれのデータベースのデータ一貫性を維持するために2フェーズコミットという手法が採用される。2フェーズコミットでは、全てのデータベースに対する変更がともに反映されるか、いずれも変更しないで終了するかのいずれかをとる。
FIG. 5 shows a general processing procedure of a distributed transaction by the
一回のトランザクションは、1つ以上のSQL文で構成される。まず、タスクは、トランザクションマネージャに対してコミット(commit)を依頼する(S100)。続いて、第1のフェーズとして、トランザクションマネージャ36は、データベースA、データベースBに対してそれぞれ、SQL文とともにコミットできる状態であるか否かを確認する準備命令(prepare)を送信する(S102,S106)。この時点では、書き込まれるべきデータがSQL文としてデータベースのログに書き込まれた状態になり、トランザクションマネージャからデータベースに対してコミットの命令がくるまでは実際の書き込みは行われない。これを受けたデータベースA、データベースBは、ログ書き込みが正常に行われたか否かをトランザクションマネージャ36に伝える。ログ書き込みが正常に行われたことがログライタ40によって確認されると、トランザクションマネージャ36に対して準備完了(ok)を伝える(S104,S108)。ログ書き込みが異常終了していれば、トランザクションマネージャに対して準備未了であることを伝える。
One transaction is composed of one or more SQL statements. First, the task requests the transaction manager to commit (S100). Subsequently, as a first phase, the
第2フェーズでは、トランザクションマネージャ36は、データベースA、データベースBからの準備完了か準備未了かの通知をもとに、全てのデータベースに対してコミット命令またはロールバック命令を送信する。データベースA、データベースBの両方から準備完了の通知を受け取った場合にのみ、トランザクションマネージャは両データベースに対してコミットの命令を送る(S110,S114)。データベースA、データベースBは、ログに書かれたSQL文を解釈してテーブルに反映させる。
In the second phase, the
トランザクションマネージャがコミットを命令する前に何らかの障害が発生し、データベースから1つでも不可の通知を受け取った場合、トランザクションマネージャは、全てのデータベースに対してロールバック命令を送る。 If some failure occurs before the transaction manager commands a commit and if any notification is received from the database, the transaction manager sends a rollback command to all databases.
障害の例としては、データベースの更新ルールに合わないタイムスタンプ(時間外など)、別のプロセスによるテーブルのロック、指定時間内にデータベースからの通知がないなどの他、ハードウェア障害や通信障害なども含まれる。 Examples of failures include time stamps that do not match the database update rules (out of hours, etc.), table locking by another process, no notification from the database within the specified time, hardware failures, communication failures, etc. Is also included.
データベースA、データベースBにおけるデータ更新が成功すると(S112,S116)、その情報がトランザクションマネージャに伝えられる(S118、S119)。トランザクションマネージャ36は、トランザクションの実行結果を現行タスクに通知する。トランザクションマネージャがコミット命令を出し、データベースでの更新が成功した場合には、トランザクション成功の情報をタスクに送る(S120)。トランザクションマネージャがロールバックを命令した場合、および、コミットを命令したがデータベースから指定時間内にデータ更新成功の通知がない場合には、トランザクション失敗の情報をタスクに送る。
When the data update in the databases A and B is successful (S112, S116), the information is transmitted to the transaction manager (S118, S119). The
このように、複数のデータベースに対する全ての書き込み操作を1つのトランザクション内で実行することで、トランザクションの途中で何らかの障害が生じた場合であっても、全てのデータベースのデータ一貫性を保つことができる。 In this way, by executing all the write operations for a plurality of databases within one transaction, it is possible to maintain the data consistency of all databases even if some failure occurs during the transaction. .
本実施形態におけるトランザクションは、OASIS(Organization for the Advancement of Structured Information Standards)で策定が行われているBTP(Business Transaction Protocol)にしたがうことが好ましいが、これに限定されず、他のプロトコルにしたがっていてもよい。 The transaction in the present embodiment preferably conforms to BTP (Business Transaction Protocol) established by OASIS (Organization for the Advancement of Structured Information Standards), but is not limited thereto, and is in accordance with other protocols. Also good.
図6は、本実施形態による格子型コンピュータシステム100におけるタスクの先行実行を説明するフローチャートである。
FIG. 6 is a flowchart for explaining the pre-execution of a task in the lattice
現行タスク52がトランザクションマネージャ36に対してデータのコミットを依頼すると(S10)、現行タスク52はスケジューラ30に対してコミット依頼中であることを伝える(S12)。タスク先行実行指示部34は、これに応じてコミットが正常に完了すると予測し、次タスク56を割り当てた孫ノードBに対して、コミットが正常に完了するという前提のもとに次タスク56の実行を開始するように指示する(S14)。なお、次タスク56のタスク処理プログラムは、S14の前に予め孫ノードBに対してロードしておいてもよいし、S14において、対応するタスク処理プログラムを記憶装置24から取得するように孫ノードBに対して指示してもよい。
When the
データ複製部42は、現行タスク52のセッションデータを複製して次タスク56に送信し、次タスク56の先行実行が開始される(S16)。トランザクションマネージャ36は、データベース26とのトランザクションを制御し、現行タスク52を介してトランザクションの結果をスケジューラ30に通知する(S18)。トランザクションが成功していれば(S20のY)、現行タスク52を終了し、孫ノードBにおいて次タスク56の実行をそのまま継続する(S22)。トランザクションが失敗していれば(S20のN)、次タスクを終了させた上で、障害処理部46によって所定の障害処理プロセスが実行される(S24)。
The
なお、S18のトランザクションの結果通知は、次タスク56の実行が開始された後でなく、その前になされることも当然考えられる。その場合、タスク先行実行指示部34は、次タスク56の先行実行をさせずに、現行タスク52のコミットの結果を確認した上で次タスク56の実行を孫ノードBに指示することが好ましい。
Of course, the notification of the result of the transaction in S18 may be made before the start of the execution of the
現行タスクのコミットが失敗した場合には、タスクの種類や障害のケース毎に応じて予め定められている障害処理プロセス、またはスケジューラで予め定められている障害処理プロセスにしたがって処理がなされる。ただし、サービス要求に応じたアプリケーションレベルで障害処理プロセスが定められている場合には、こちらを優先することが望ましい。例えば、コミットが失敗したときには全てのタスクを終了させるという障害処理プロセスがアプリケーションで定義されている場合、個々のタスクに関わる障害処理プロセスを実行しても無意味だからである。 When the commit of the current task fails, processing is performed according to a failure processing process predetermined according to the type of task and each failure case, or a failure processing process predetermined by the scheduler. However, if a failure handling process is defined at the application level according to the service request, it is desirable to give priority to this. For example, if a fault handling process that terminates all tasks when a commit fails is defined in the application, it is meaningless to execute the fault handling process related to each task.
続いて、格子型コンピュータシステム100において分散トランザクションを含むサービス要求を処理する場合を2つ挙げて、本実施形態におけるタスクの先行実行処理をより具体的に説明する。
Next, two cases of processing a service request including a distributed transaction in the lattice
(実施例1)
図7は、インターネットを介して車の購入予約をするシステムの全体的な構成図である。図7中、図1、図3と同一の符号を付した要素は、図1、図3に関して上述したのと同様の機能を有するので、詳細な説明を省略する。また、図7においては、1つのサービス要求にのみ対応する場合を想定しているので、子ノードの割り当てを行う親ノードとスーパースケジューラ、およびサービスに関与しない他のノードを省略して示している。
Example 1
FIG. 7 is an overall configuration diagram of a system for making a reservation for purchasing a car via the Internet. 7, elements denoted by the same reference numerals as those in FIGS. 1 and 3 have the same functions as those described above with reference to FIGS. 1 and 3, and thus detailed description thereof is omitted. Further, in FIG. 7, since it is assumed that only one service request is supported, the parent node that assigns child nodes, the super scheduler, and other nodes that are not involved in the service are omitted. .
ユーザがクライアント端末12を介して車の購入予約を受け付けるサイトにアクセスすると、希望車種データ入力画面70と顧客属性データ入力画面72がクライアント端末12のディスプレイに表示される。ユーザがこれらに所定の事項を入力して送信ボタンをクリックすると、希望車種データと顧客属性データとを含むサービス要求が子ノード20に対して送信される。希望車種データには、購入の予約をしたい車名、モデル、色などの情報が含まれ、顧客属性データには、ユーザの氏名、電話番号、メールアドレスなどの情報が含まれる。
When the user accesses a site for accepting a car purchase reservation via the
子ノード20のスケジューラ30は、サービス要求を受け取ると、予め対応付けのされているアプリケーションを記憶装置から読み出す。ここでは、このアプリケーションは購入予約タスク62と納期通知タスク66とを含むものとする。スケジューラ30のタスク割り当て部32は、購入予約タスク62を孫ノードAに、納期通知タスク66を孫ノードBに割り当てる。
When the
まず、孫ノードAにおいて、購入予約タスク62が実行される。購入予約タスク62は、顧客属性データをデータベース内の顧客管理テーブル80に書き込むと同時に、希望車種データを発注管理テーブル82に書き込む必要がある。そこで、購入予約タスク62は、トランザクションノード16にあるトランザクションマネージャを呼び出し、データのコミットを依頼する。
First, the
スケジューラ30のタスク先行実行指示部34は、購入予約タスク62がトランザクションマネージャに対してデータのコミットを依頼したことを知ると、孫ノードBに対して、コミットの完了前に納期通知タスク66の実行を開始するように指示する。また、スケジューラ30のデータ複製部42は、購入予約タスク62に保持され、発注管理テーブル82に対して書き込み中である希望車種データ68を複製し、納期通知タスク66に引き渡す。
When the task advance
納期通知タスク66は、購入予約タスク62によるコミット依頼が成功する前提で、希望車種データ68を参照して、希望する車がいつ頃出荷可能であるかを、データベース26の在庫管理テーブル84または生産管理テーブル86を検索して調べる。在庫管理テーブル84には、車名、モデル、色毎の在庫台数が記録されており、生産管理テーブル86には、車名、モデル、色毎の生産予定台数が記録されている。これらを調べることで、納期通知タスク66は車の納入可能日を計算し、納入可能日を含むメッセージ74をクライアント端末12に対して送信する。クライアント端末12は、メッセージ74を画面表示する。
The delivery
購入予約タスク62によるコミットが成功であれば、購入予約タスク62は終了し、納期通知タスク66がそのまま実行される。コミットが失敗であれば、スケジューラ30の障害処理部46が所定の障害処理プロセスを実行し、クライアント端末12に対してエラーメッセージ76を送信する。
If the commit by the
このように、購入予約タスクによるコミット依頼が完了する前に納期通知タスクを先行して実行することで、サービス要求に対する全体としての応答時間を短縮することができる。このようなタスクの先行開始ができるのは、トランザクションマネージャによるテーブルの更新処理が高い確率で成功することに基づいている。 Thus, by executing the delivery date notification task before the commit request by the purchase reservation task is completed, the overall response time to the service request can be shortened. The reason why such a task can be started in advance is based on the fact that table update processing by the transaction manager succeeds with high probability.
図8は、図7のシステムにおけるタスクの先行実行処理を説明するフローチャートである。まず、クライアント端末12からサービス要求がなされる(S30)。スケジューラ30のタスク割り当て部32は、サービス要求に対応する購入予約タスク62と納期通知タスク66とをシステム内の適切なノードに割り当てる(S32)。購入予約タスク62の実行が開始され、トランザクションノード16のトランザクションマネージャ36に対してデータのコミットが依頼される(S34)。これに続いて、データ複製部42により購入予約タスク62から複製された希望車種データが納期通知タスク66に送信され、タスク先行実行指示部34により納期通知タスク66の実行開始が指示される(S36)。納期通知タスク66はデータベース26を参照して、納入可能日を含むメッセージ74をクライアント端末12に送信する(S38)。
FIG. 8 is a flowchart for explaining the task pre-execution process in the system of FIG. First, a service request is made from the client terminal 12 (S30). The
トランザクションマネージャ36は、購入予約タスク62から依頼されたコミットの成否を、購入予約タスク62を介してスケジューラ30に伝える(S40)。コミットが成功していれば(S42のY)、購入予約タスク62を終了し、納期通知タスク66を継続する(S44)。コミットが失敗していれば(S42のN)、障害処理部46が所定の障害処理プロセスを実施する(S46)。
The
S46における障害処理プロセスは、障害の発生原因によって異なる。
図9は、障害処理プロセスの一例のフローチャートである。ここでは、データベースの容量不足やハードウェアの故障によって、コミットが失敗した場合を想定する。この場合、トランザクションマネージャ36は、購入予約タスク62を介してスケジューラ30に対してコミットが失敗したことを通知する(S50)。購入予約タスク62は、障害発生時に出力するために予め準備されていたエラーメッセージ76をクライアント端末12に送信する(S52)。スケジューラ30の障害処理部46は、納期通知タスク66に割り込みをかけ、強制終了させる(S54)。納期通知タスク66は、データベース26とのトランザクションを既に実施していた場合は、そのトランザクションをロールバックするようにトランザクションマネージャ36に通知する(S56)。
The failure processing process in S46 differs depending on the cause of the failure.
FIG. 9 is a flowchart of an example of a failure handling process. Here, it is assumed that the commit fails due to insufficient database capacity or hardware failure. In this case, the
図10は、障害処理プロセスの別の例のフローチャートである。ここでは、購入予約タスク62の異常停止などのアプリケーションのエラーによって、コミットが失敗した場合を想定する。この場合、トランザクションマネージャ36からのエラー通知はなされない。したがって、スケジューラ30が購入予約タスク62の動作状況を定期的に調べることによって、コミットの失敗を検出する(S60)。障害処理部46は、購入予約タスク62から事前に受け取っていたトランザクションIDを使用して、トランザクションマネージャ36に対して、購入予約タスク62とのトランザクションをロールバックするように通知する(S62)。今回は、購入予約タスク62からエラーメッセージが出力されないので、スケジューラ30が予め準備されているエラーメッセージ76をクライアント端末12に送信する(S64)。障害処理部46は、納期通知タスク66に割り込みをかけ、強制終了させる(S66)。納期通知タスク66は、データベース26とのトランザクションを実施していた場合は、そのトランザクションをロールバックするようにトランザクションマネージャ36に通知する(S68)。
FIG. 10 is a flowchart of another example of the failure handling process. Here, it is assumed that the commit fails due to an application error such as an abnormal stop of the
(実施例2)
図7では、システム内のデータベースへのアクセスで完結する場合のタスクの先行実施について説明したが、システム外のデータベースにアクセスする場合にも本実施形態を適用できる。
(Example 2)
In FIG. 7, the prior implementation of the task when it is completed by accessing the database in the system has been described, but this embodiment can also be applied to accessing a database outside the system.
図11は、旅行代理店における旅行手配システムの全体的な構成図である。このシステムでは、外部に構築された別のシステムにアクセスしてタスクの処理を完了する。図11においても、図1、図3と同一の符号を付した要素は、図1、図3に関して上述したのと同様の機能を有するので、詳細な説明を省略する。また、図11においては、1つのサービス要求にのみ対応する場合を想定しているので、子ノードの割り当てを行う親ノードとスーパースケジューラ、およびサービスに関与しない他のノードを省略して示している。 FIG. 11 is an overall configuration diagram of a travel arrangement system in a travel agency. In this system, another system constructed outside is accessed to complete task processing. Also in FIG. 11, elements having the same reference numerals as those in FIGS. 1 and 3 have the same functions as those described above with reference to FIGS. In FIG. 11, since it is assumed that only one service request is supported, the parent node that assigns child nodes, the super scheduler, and other nodes that are not involved in the service are omitted. .
この例では、航空券予約システムおよび宿泊先予約システムがそれぞれ独立したサービスとしてネットワーク上で提供されており、旅行手配システムはこれらの外部のシステムにアクセスして旅行の手配処理を完結させる。 In this example, the air ticket reservation system and the accommodation reservation system are provided as independent services on the network, and the travel arrangement system accesses these external systems to complete the travel arrangement processing.
ユーザがクライアント端末12を介して旅行の手配を受け付けるサイトにアクセスすると、旅程入力画面160がクライアント端末12のディスプレイに表示される。ユーザが自身の氏名、飛行機の搭乗日時、出発地、目的地などのデータを入力して送信ボタンをクリックすると、これらのデータを含むサービス要求が子ノード20に送信される。
When the user accesses a site that accepts travel arrangements via the
子ノード20のスケジューラ30は、サービス要求を受け取ると、予め対応付けのされているアプリケーションを記憶装置から読み出す。このアプリケーションは、旅程管理タスク112、航空券手配タスク114、宿泊先手配タスク116および料金請求タスク118とを含むものとする。スケジューラ30のタスク割り当て部32は、旅程管理タスク112を孫ノードAに、航空券手配タスク114を孫ノードBに、宿泊先手配タスク116を孫ノードCに、料金請求タスク118を孫ノードDに割り当てる。
When the
まず、孫ノードAにおいて、旅程管理タスク112が実行される。旅程管理タスク112は、旅程データをデータベース内の旅程管理テーブル156に書き込む必要がある。そこで、旅程管理タスク112は、トランザクションノード16にあるトランザクションマネージャ36を呼び出し、データのコミットを依頼する。
First, in the grandchild node A, the
スケジューラ30のタスク先行実行指示部34は、旅程管理タスク112がトランザクションマネージャ36に対してデータのコミットを依頼したことを知ると、孫ノードB、孫ノードCに対して、コミットの完了前に、航空券手配タスク114、宿泊先手配タスク116の実行を開始するようにそれぞれ指示する。スケジューラ30のデータ複製部42は、旅程管理タスク112に保持され旅程管理テーブル156に対して書き込み中である旅程データのうち、航空券の手配に必要となる航空券データ120を複製し、航空券手配タスク114に引き渡す。また、データ複製部42は、旅程データのうち、宿泊先の手配に必要となる宿泊先データ122を複製し、宿泊先手配タスク116に引き渡す。
When the task predecessor
航空券手配タスク114と宿泊先手配タスク116とは、旅程管理タスク112によるコミット依頼が成功する前提で動作する。航空券手配タスク114は、ネットワークを経由してシステムの外部にある航空券予約システム140にアクセスし、座席予約テーブル142を参照して、航空券データ120に基づいて航空券の予約手続を実行する。座席予約テーブル142には、日時や出発地、目的地に応じた多数の航空便の予約状況が記録されており、航空券手配タスク114はこれらの航空便のうち条件に適合するものを予約する。
The airline
また、宿泊先手配タスク116は、ネットワークを経由してシステムの外部にある宿泊先予約システム150にアクセスし、宿泊予約テーブル152を参照して、宿泊先データ122に基づいて宿泊先の予約手続を実行する。宿泊予約テーブル152には、日時と目的地に応じた多数の宿泊施設の予約状況が記録されており、宿泊先手配タスク116は、これらの宿泊施設のうち条件に適合するものを予約する。
The
航空券手配タスク114と宿泊先手配タスク116においても、アクセス先の外部システムにおいてデータベースとのトランザクションが発生し、予約をする場合にはデータの更新が必要になる。そこで、航空券手配タスク114と宿泊先手配タスク116とが外部システムにアクセスしデータのコミットを依頼したとき、スケジューラ30のタスク先行実行指示部34は、孫ノードDに対して料金請求タスク118の実行を開始するように指示してもよい。このとき、データ複製部42は、航空券手配タスク114から航空券データ124を、宿泊先手配タスク116から宿泊先データ126をそれぞれ複製し、料金請求タスク118に引き渡す。このときの航空券データ124には、航空券手配タスク114が予約しようとしている航空便の情報が含まれ、宿泊先データ126には、宿泊先手配タスク116が予約しようとしている宿泊施設の情報が含まれる。
Also in the airline
料金請求タスク118は、航空券手配タスク114と宿泊先手配タスク116において予約のためのコミット依頼が成功する前提で動作する。料金請求タスク118は、ネットワークを経由して航空券予約システム140にアクセスし、航空運賃テーブル144を参照して、航空券手配タスク114が予約するであろう航空便の航空運賃を調べる。航空運賃テーブル144には、航空便毎の航空運賃が記録されている。また、料金請求タスク118は、ネットワークを経由して宿泊先予約システム150にアクセスし、宿泊料金テーブル154を参照して、宿泊先手配タスク116が予約するであろう宿泊施設の料金を調べる。宿泊料金テーブル154には、宿泊施設毎の料金が記録されている。料金請求タスク118は、こうして調べた航空運賃と宿泊料金のデータを含むメッセージ162をクライアント端末12に送信する。クライアント端末12は、メッセージ162を画面表示する。
The
旅程管理タスク112、航空券手配タスク114、および宿泊先手配タスク116によるコミットが成功であれば、これらのタスクは終了し、料金請求タスク118がそのまま実行される。これらのコミットのうちいずれかが失敗した場合は、スケジューラ30の障害処理部46が所定の障害処理プロセスを実行し、各タスクにより実行されたトランザクションは全てロールバックされ、またクライアント端末12に対してエラーメッセージが送信される。
If the commitment by the
図12は、図11のシステムにおけるタスクの先行実行処理を説明するフローチャートである。まず、クライアント端末12からサービス要求がなされる(S70)。スケジューラ30のタスク割り当て部32は、サービス要求に対応する各タスク112〜118をシステム内の適切なノードに割り当てる(S72)。旅程管理タスク112の実行が開始され、トランザクションノード16のトランザクションマネージャ36に対してデータのコミットが依頼される(S74)。これに応じて、データ複製部42により旅程管理タスク112から複製された航空券データ120が航空券手配タスク114に送信され、タスク先行実行指示部34により航空券手配タスク114の実行開始が孫ノードBに対して指示される。また、旅程管理タスク112から複製された宿泊先データ122が宿泊先手配タスク116に送信され、タスク先行実行指示部34により宿泊先手配タスク116の実行が孫ノードCに指示される(S76)。さらに、航空券手配タスク114および宿泊先手配タスク116が、それぞれ対応するテーブルに対するデータのコミットを依頼している間に、データ複製部42により航空券データ124および宿泊先データ126が複製され、料金請求タスク118に送信されてもよく、料金請求タスク118は、これらのデータをもとにユーザに請求する料金を計算してもよい(S78)。料金請求タスク118は航空運賃テーブル144、宿泊料金テーブル154を参照して、請求料金を含むタスクの処理結果を表すメッセージをクライアント端末12に送信する(S80)。
FIG. 12 is a flowchart for explaining a task pre-execution process in the system of FIG. First, a service request is made from the client terminal 12 (S70). The
トランザクションマネージャ36は、旅程管理タスク112から依頼されたコミットの成否を、旅程管理タスク112を介してスケジューラ30に伝える(S82)。コミットが成功していれば(S84のY)、旅程管理タスク112を終了し、その他のタスクを継続する(S86)。コミットが失敗していれば(S84のN)、障害処理部46が所定の障害処理プロセスを実施する(S88)。
The
以上説明したように、本実施形態によれば、サービス要求から派生する、直列関係のある複数のタスクを異なるノードに割り当てる分散コンピューティングにおいて、実行中のタスクのコミットが完了する前に後続タスクの実行を先行して開始するようにした。これによって、データベースにおけるトランザクションの負荷の大小にかかわらず、現行タスクのコミットの待機時間が実質的に削減され、サービス要求に対する全体としての応答時間を短縮することができる。このように、本実施形態では、直列関係のある複数のタスクを一時的に並列して処理するような状況を作り出すことができる。 As described above, according to the present embodiment, in distributed computing in which a plurality of serially related tasks derived from a service request are assigned to different nodes, the subsequent task is not committed before the task being committed is completed. The execution was started in advance. As a result, regardless of the transaction load on the database, the waiting time for committing the current task is substantially reduced, and the overall response time to the service request can be shortened. Thus, in this embodiment, it is possible to create a situation in which a plurality of tasks having a serial relationship are temporarily processed in parallel.
以上、本発明をいくつかの実施の形態をもとに説明した。これらの実施の形態は例示であり、それらの各構成要素や各処理プロセスの組合せにいろいろな変形例がありうること、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。 The present invention has been described based on some embodiments. Those skilled in the art will understand that these embodiments are exemplifications, and that there may be various modifications to the combinations of the respective constituent elements and processing processes, and such modifications are also within the scope of the present invention. By the way.
請求項に記載の各構成要件が果たすべき機能は、本実施例において示された各機能ブロックの単体もしくはそれらの連係によって実現されることも当業者には理解されるところである。 It should also be understood by those skilled in the art that the functions to be fulfilled by the constituent elements described in the claims are realized by a single function block shown in the present embodiment or a combination thereof.
ノード間のデータ通信は、共有の記憶装置を利用して行ってもよいし、例えばDAFS(Direct Access File System)プロトコルを利用してノード間で直接通信してもよい。 Data communication between nodes may be performed using a shared storage device, or may be performed directly between nodes using, for example, a DAFS (Direct Access File System) protocol.
トランザクションマネージャが存在せず、タスク自身がデータベースとのトランザクションを直接実行してもよい。この場合、トランザクションの成否の状況は、スケジューラが定期的に監視する必要がある。 There is no transaction manager, and the task itself may directly execute a transaction with the database. In this case, the scheduler needs to periodically monitor the success or failure of the transaction.
実施形態では、トランザクションマネージャが2フェーズコミットの手法を用いてデータベースとのトランザクションを調整することを述べた。しかしながら、上述の実施形態は、データベースへの書き込みを確定させるコミットが完了するまでの間に待ち時間がある任意の手法に対して適用することができる。 In the embodiment, it has been described that the transaction manager uses a two-phase commit technique to coordinate transactions with the database. However, the above-described embodiment can be applied to any method in which there is a waiting time until the commit for finalizing writing to the database is completed.
実施形態では、スケジューラが直列タスクを子ノードの近隣の孫ノードに割り当てることを述べた。直列タスクを互いに近接するノードに配置することで処理の高速化が期待されるためであるが、本発明は、タスクを実行するノードがノード群内のいずれに位置していようと関係なく適用できる。 In the embodiment, it has been described that the scheduler assigns the serial task to the grandchild node adjacent to the child node. This is because high-speed processing is expected by arranging serial tasks at nodes adjacent to each other, but the present invention can be applied regardless of where the node executing the task is located in the node group. .
実施形態では格子型コンピュータシステムを用いて説明したが、本発明はタスクを分散配置できる任意の処理システムに適用することができる。 Although the embodiment has been described using a lattice computer system, the present invention can be applied to any processing system capable of distributing tasks.
10 ノード群、 12 クライアント端末、 14 ネットワーク、 16 トランザクションノード、 18 親ノード、 20 子ノード、 22 スーパースケジューラ、 24 記憶装置、 30 スケジューラ、 32 タスク割り当て部、 34 タスク先行実行指示部、 36 トランザクションマネージャ、 38 データベースライタ、 40 ログライタ、 42 データ複製部、 44 画面表示制御部、 46 障害処理部、 50 孫ノードA、 52 現行タスク、 54 孫ノードB、 56 次タスク、 100 格子型コンピュータシステム。
10 node group, 12 client terminal, 14 network, 16 transaction node, 18 parent node, 20 child node, 22 super scheduler, 24 storage device, 30 scheduler, 32 task allocation unit, 34 task advance execution instruction unit, 36 transaction manager, 38 database writer, 40 log writer, 42 data replication unit, 44 screen display control unit, 46 fault processing unit, 50 grandchild node A, 52 current task, 54 grandchild node B, 56th task, 100 grid computer system.
Claims (8)
前記スケジュールノードにより割り当てられるタスクを実行するタスク実行ノードと、
所定のデータを格納するデータベースに対する処理を取り扱うトランザクションノードと、
を含むサーバシステムにおいて、前記スケジュールノードで実行されるスケジューラプログラムであって、
前記サーバシステムに接続されたクライアント端末から与えられるサービス要求に応じて、実行順序が定められた複数タスクを前記サーバシステム内の異なるタスク実行ノードに割り当てる割り当て機能と、
1つのタスク実行ノードと前記データベースとの間のトランザクションで発生したデータ書き込みまたはデータ書き換えを確定させるデータ永続化処理が前記トランザクションノードに依頼されたとき、該永続化処理が正常に完了したとの通知が前記トランザクションノードから前記1つのタスク実行ノードで実行中の現行のタスクに来る前に、別のタスク実行ノードにおいて後続のタスクの処理を開始させるタスク先行実行指示機能と、
前記後続のタスクの処理を実行するときに必要となるデータを、該後続のタスクが実行される別のタスク実行ノードに対して送信するデータ複製機能と、
を含むことを特徴とするスケジューラプログラム。 A schedule node responsible for scheduling tasks in a plurality of nodes each having a processor;
A task execution node for executing a task assigned by the schedule node;
A transaction node that handles processing for a database that stores predetermined data; and
A scheduler program executed by the schedule node, comprising:
An allocation function for allocating a plurality of tasks with execution orders determined to different task execution nodes in the server system in response to a service request given from a client terminal connected to the server system;
When the transaction node is requested to perform data perpetuation processing for confirming data writing or data rewriting that occurs in a transaction between one task execution node and the database , the notification that the perpetuation processing has been completed normally A task predecessor execution instruction function that starts processing of a subsequent task at another task execution node before the current task from the transaction node is being executed at the one task execution node ;
The data required for executing the processing of the subsequent tasks, and data replication to be transmitted to another task execution node the subsequent task is executed,
A scheduler program comprising:
請求項1ないし3のいずれかに記載のスケジューラプログラムを実行するスケジュールノードである子ノードと、
前記割り当て機能により割り当てられたタスクを実行するタスク実行ノードである孫ノードと、
前記データベースに対する処理を取り扱うトランザクションノードと、
を含むことを特徴とするサーバシステム。 A server system including a plurality of nodes each including a processor and a database storing predetermined data,
A child node that is a schedule node for executing the scheduler program according to claim 1;
A grandchild node that is a task execution node for executing a task assigned by the assignment function;
A transaction node that handles processing for the database;
A server system comprising:
前記サーバシステムに接続されたクライアント端末から与えられるサービス要求に応じて、実行順序が定められた複数タスクを前記サーバシステム内の異なるタスク実行ノードに割り当てるタスク割り当て部と、
1つのタスク実行ノードと前記データベースとの間のトランザクションで発生したデータ書き込みまたはデータ書き換えを確定させるデータ永続化処理が前記トランザクションノードに依頼されたとき、該永続化処理が正常に完了したとの通知が前記トランザクションノードから前記1つのタスク実行ノードで実行中の現行のタスクに来る前に、別のタスク実行ノードにおいて後続のタスクの処理を開始させるタスク先行実行指示部と、
前記後続のタスクの処理を実行するときに必要となるデータを、該後続のタスクが実行される別のタスク実行ノードに対して送信するデータ複製部と、
を備えることを特徴とするスケジューラ装置。 A scheduler device arranged in a server system including a plurality of task execution nodes each having a processor and executing an assigned task, and a transaction node handling a process for a database storing predetermined data,
A task assigning unit that assigns a plurality of tasks in which an execution order is determined to different task execution nodes in the server system in response to a service request given from a client terminal connected to the server system;
When the transaction node is requested to perform data perpetuation processing for confirming data writing or data rewriting that occurs in a transaction between one task execution node and the database , the notification that the perpetuation processing has been completed normally A task pre-execution instruction unit that starts processing of a subsequent task at another task execution node before the current task from the transaction node is being executed at the one task execution node ;
The data required for executing the processing of the subsequent tasks, and data replication unit to be transmitted to another task execution node the subsequent task is executed,
A scheduler device comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006089542A JP4571090B2 (en) | 2006-03-28 | 2006-03-28 | Scheduler program, server system, scheduler device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006089542A JP4571090B2 (en) | 2006-03-28 | 2006-03-28 | Scheduler program, server system, scheduler device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2007265043A JP2007265043A (en) | 2007-10-11 |
JP4571090B2 true JP4571090B2 (en) | 2010-10-27 |
Family
ID=38637962
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006089542A Expired - Fee Related JP4571090B2 (en) | 2006-03-28 | 2006-03-28 | Scheduler program, server system, scheduler device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4571090B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5326308B2 (en) | 2008-03-13 | 2013-10-30 | 日本電気株式会社 | Computer link method and system |
US8549536B2 (en) * | 2009-11-30 | 2013-10-01 | Autonomy, Inc. | Performing a workflow having a set of dependancy-related predefined activities on a plurality of task servers |
CN111666138B (en) * | 2020-05-19 | 2025-03-11 | 微民保险代理有限公司 | Scheduled task processing method, device, system, computer equipment and storage medium |
CN111782390B (en) * | 2020-06-28 | 2024-03-22 | 武汉安辰鑫信息科技有限公司 | Scheduling method of timing task and related equipment |
CN112269647B (en) * | 2020-10-26 | 2024-10-25 | 广州华多网络科技有限公司 | Node scheduling, switching and coordination method and corresponding device, equipment and medium thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000047887A (en) * | 1998-07-30 | 2000-02-18 | Toshiba Corp | Speculative multi-thread processing method and its device |
JP2001075802A (en) * | 1999-09-08 | 2001-03-23 | Fujitsu Ltd | Speculative execution device and verification device |
JP2001101045A (en) * | 1999-09-29 | 2001-04-13 | Toshiba Corp | Method and system for processing transaction |
JP2005063139A (en) * | 2003-08-12 | 2005-03-10 | Toshiba Corp | Computer system and program |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06332773A (en) * | 1993-05-21 | 1994-12-02 | Nec Corp | Data base updating system |
JPH1031606A (en) * | 1996-07-17 | 1998-02-03 | Nec Corp | Method and system for updating interactive file |
JP3550289B2 (en) * | 1997-11-28 | 2004-08-04 | 富士通株式会社 | Operation information management method in multi-cluster system, multi-cluster system and program storage medium for online operation information management |
-
2006
- 2006-03-28 JP JP2006089542A patent/JP4571090B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000047887A (en) * | 1998-07-30 | 2000-02-18 | Toshiba Corp | Speculative multi-thread processing method and its device |
JP2001075802A (en) * | 1999-09-08 | 2001-03-23 | Fujitsu Ltd | Speculative execution device and verification device |
JP2001101045A (en) * | 1999-09-29 | 2001-04-13 | Toshiba Corp | Method and system for processing transaction |
JP2005063139A (en) * | 2003-08-12 | 2005-03-10 | Toshiba Corp | Computer system and program |
Also Published As
Publication number | Publication date |
---|---|
JP2007265043A (en) | 2007-10-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11425194B1 (en) | Dynamically modifying a cluster of computing nodes used for distributed execution of a program | |
US10474547B2 (en) | Managing contingency capacity of pooled resources in multiple availability zones | |
US9280390B2 (en) | Dynamic scaling of a cluster of computing nodes | |
KR102013005B1 (en) | Managing partitions in a scalable environment | |
US8418181B1 (en) | Managing program execution based on data storage location | |
US8321558B1 (en) | Dynamically monitoring and modifying distributed execution of programs | |
US8260840B1 (en) | Dynamic scaling of a cluster of computing nodes used for distributed execution of a program | |
US9413604B2 (en) | Instance host configuration | |
US11061884B2 (en) | Method and system to accelerate transaction commit using non-volatile memory | |
KR102013004B1 (en) | Dynamic load balancing in a scalable environment | |
JP6254949B2 (en) | Pricing resources in virtual machine pools | |
US20180129570A1 (en) | Saving program execution state | |
US8966025B2 (en) | Instance configuration on remote platforms | |
JP2004302937A (en) | Program arrangement method, its execution system, and its processing program | |
CN113886089A (en) | Task processing method, device, system, equipment and medium | |
JP4571090B2 (en) | Scheduler program, server system, scheduler device | |
AU2019371362B2 (en) | Methods, devices and systems for non-disruptive upgrades to a distributed coordination engine in a distributed computing environment | |
CN114546644A (en) | Cluster resource scheduling method, device, software program, electronic device and storage medium | |
JP2004280457A (en) | Data management system, batch control system, and batch control program | |
CN118981498A (en) | Real-time data processing method, device and storage medium for distributed database |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080908 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091203 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091222 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100222 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100601 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100716 |
|
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: 20100810 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100811 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130820 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |