This application is based upon and claims the benefit of priority of the prior Japanese Patent application No. 2018-004323, filed on Jan. 15, 2018, the entire contents of which are incorporated herein by reference.
The embodiment discussed herein relates to an information processing apparatus, a method for controlling, and a non-transitory computer-readable recording medium having stored therein a control program.
In an information system, a competitive operation may sometimes occur in which multiple jobs simultaneously execute processes, such as accesses, on multiple volumes or chunks, which are obtained by dividing each volume in units of a constant logical block size. In order to avoid occurrence of such a competitive operation, exclusion control (mutual exclusion control) is carried out for each resource (hereinafter simply called an object) such as a volume or a chunk.
Accompanying drawings
[Patent Literature 1] Japanese Laid-open Patent Publication No. 2014-178831
[Patent Literature 2] Japanese Laid-open Patent Publication No. 2009-37544
[Patent Literature 3] Japanese Laid-open Patent Publication No. 2016-95638
In some traditional exclusion controls as the above, the exclusion sequence, which is exemplified by obtaining exclusion firstly for a volume and then for a chunk, is sometimes determined in the design stage. Accompanying drawings
Description will now be made in relation to an example that, in an information processing system adopting a giant lock scheme, the access-source (updating source) chunk X accesses the volumeA (101a) of the access-destination (updating-destination) the volume A (101a) with reference to
In the most cases, it is sufficient for an access from the chunk X to the volume A described above to execute exclusion control only on the range covering the access source and the access destination. Here, a range in which exclusion is to be obtained is referred to as an exclusion range and is represented by a reference number 103 in the drawings. However, in cases where the giant lock scheme is adopted, the exclusion range 103 is set so as to include the volume B, the chunk Y, and the chunk Z as illustrated in
According to an aspect of the embodiments, an information processing apparatus of an embodiment of the present invention includes a memory; a processor coupled to the memory; and one or more resources, the processor being configured to allow a plurality of the processes to be performed on one of the one or more resources to obtain the exclusion in parallel by optimistic locking control in a first phase, and execute one of the plurality of processes on the resource in a state where the exclusion is obtained by pessimistic locking control in a second phase.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
Hereinafter, description will now be made in relation to an embodiment of the present invention with reference to the accompanying diagram. The embodiment to be detailed below is merely exemplary and does not have intention to exclude various modifications and applications of techniques not referred in the following embodiment. For example, the following embodiment may be variously modified without departing from the scope thereof. Throughout the drawings used in the following embodiment, like reference numbers designate the same or substantially same part and elements unless otherwise described.
(1) One Embodiment
(1-1) Example of the Configuration of the Information Processing System of the Embodiment:
As illustrated in
Each server 10 includes multiple Central Processing Units (CPUs) 11 each having a multi-core configuration. The server 10 further includes a Random-Access Memory (RAM) 12, and a memory 13. Each CPU 11 executes the Operating System (OS) and programs stored in the memory 13, and carries out exclusion control of an object in response to an access request input from an external device exemplified by the host computer 2. The memory 13 is a non-volatile memory, for example, and stores a volume table 51, a chunk table 52, a waiting queues 54, and an exclusion control table 53 (see
Each storage device (database for management) 20 is a physical disk used for a Relational Database (RDB), and multiple objects are mapped on the RDB. An example of each storage device 20 is a database (persistent database) aiming at making the information to be stored therein persistent. The information to be stored therein is information to achieve the persistence, which information can be regarded as information to be persistent.
Next,
(1-2) Example of Functional Configuration of the Server in the Information Processing System According to the Embodiment:
As illustrated in
The exclusion controller 41 carries out, in cases where the host computer 2 is connected to the present information processing system 1 and the host computer 2 issues an access request, exclusion control responsively on an object related to the access request.
The disk controller 42 controls, in cases where the host computer 2 is connected to the present information processing system 1, an access process of, for example, writing data into and reading data from a storage device 20. This means that the disk controller 42 writes data in the memory 13 into a storage device 20 and stores data in a storage device 20 into the memory 13.
The exclusion obtainer 43 carries out, as a part of the exclusion control carried out by the exclusion controller 41, an exclusion obtaining phase (prepare) that is to be detailed below. The exclusion obtaining phase is also referred to as a first phase.
The process executor 44 carries out, as another part of the exclusion control carried out by the exclusion controller 41, a process executing phase (execute) that is to be detailed below. The process executing phase is also referred to as a second phase.
The volume table manager 45 manages a volume table 51 that is to be detailed below. In other words, the volume table manager 45 manages, for example, attribute values related to each volume included in the present information processing system 1, using the volume table 51.
The chunk table manager 46 manages the chunk table 52 that is to be detailed below. In other words, the chunk table manager 46 manages allocation of a physical region to a chunk included in a volume, using the chunk table 52.
The exclusion control table manager 47 obtains (refers to) an exclusion control table 53 of an object, which table is to be detailed below, and updates the values stored in the exclusion control table 53. In cases where each object stores its own exclusion control table 53, the exclusion control table manager 47 obtains or updates the exclusion control table 53 of the object via the network 3.
The memory 13 of the server 10 stores the volume table 51, the chunk table 52, the exclusion control table 53, and the waiting queue 54. Alternatively, the memory 13 may store multiple volume tables 51, multiple chunk tables 52, multiple exclusion control tables 53, and multiple waiting queues 54.
The volume table 51 includes a field “v_name” to store the volume name of each volume 101 and a field “size” to store the size of the volume 101.
The chunk table 52 includes a field “c_name” to store the chunk name of each chunk 102, and a field “index” to store the index of the chunk 102. The chunk table 52 further includes a field “v_name” to store the associated volume name. The index of a chunk 102 is an identification number provided to the chunk 102, and the associated volume name represents a volume having a physical region to be allocated to the chunk 102.
An exclusion control table 53 represents information to manage a state (competitive state) of occurrence of competition (conflict) of jobs and is provided for each object. The exclusion control table 53 will be further detailed below with reference to
The waiting queue 54 is a queue that stores a competitive job that fails to obtain exclusion.
(1-3) Exclusion Control Process in the Information Processing System of the Present Embodiment:
Description will now be made in relation to a process of exclusion control in the information processing system 1 of an example of the present embodiment.
In the present embodiment, the exclusion control of the information processing system 1 is divided into two phases of an exclusion obtaining phase and a process executing phase.
First of all, the exclusion obtaining phase of the present embodiment will now be described. The exclusion obtaining phase corresponds to a preparation stage to obtain exclusion and execute optimistic locking control. Consequently, multiple jobs are allowed to access an object in parallel with one another to obtain exclusion of the access-destination object. Such optimistic locking control has been known to the public, so the detailed description is omitted here. The exclusion obtaining phase is achieved by the exclusion obtainer 43.
Next, the process executing phase of the present embodiment will now be described. The process executing phase corresponds to a stage of executing a process after exclusion is obtained in the exclusion obtaining phase, and specifically carries out pessimistic locking control. Accordingly, only a job that obtains exclusion is allowed to access the target object and, in cases where one or more jobs (competitive jobs) that failed to obtain exclusion are present, the jobs are added to the waiting queue 54. Such pessimistic locking control has been known to the public, so the detailed description is omitted here. The process executing phase is achieved by the process executor 44.
When the job 1 and the job 2 as denoted in
(1-4) Example of Operation:
Next, description will now be made in relation to examples of operations of the exclusion obtaining phase and the process executing phase carried out by the information processing system 1 having the above configuration.
(1-4-1) Example of the Operation in the Exclusion Obtaining Phase of the Information Processing System of the Present Embodiment:
Description will now be made in relation to an example of the operation in the exclusion obtaining phase of the present embodiment along the flow diagram of
When the manager inputs a job from the host computer 2, the exclusion controller 41 receives the input job and requests, for example, the disk controller 42 to store the received job into the storage device 20 in Step E1. When being stored in the storage device 20, the input job becomes information that makes the information stored in the storage device 20 to be persistent. Then, the exclusion controller 41 instructs the exclusion obtainer 43 to carryout the exclusion obtaining phase for the job received in Step E1. In the example illustrated in
In Step E2, the job refers to an object, and the exclusion obtainer requests the exclusion control table manager 47 to update the exclusion control table 53 of the object.
Here, description will now be made in relation to the exclusion control table 53 of the present embodiment with reference to
The exclusion control table (exclusion control information) 53 is control information to be used to execute exclusion and is provided for each object. The exclusion control table 53 is stored in, for example, the storage device 20. The exclusion control table 53 has components of a reference counter 531, a version counter 532, and a lock retainer 533.
The reference counter (reference status) 531 is indicative of the real-time number of jobs referring to the object. When a job starts to referring to the object, the value “1” is added to the reference counter 531, and after the process executing phase to be detailed below is completed, the value “1” is subtracted from the number represented by the counter.
The version counter (version status) 532 is indicative of the status of updating (version of) data in the object. In cases where the data is written (updated), the value “1” is added to the version counter 532 after the process executing phase to be detailed below is completed. In the example of
The lock retainer (i.e., a job that has obtained exclusion) 533 indicates a job that has obtained exclusion. For example, the identifier (ID) of the job is set in the lock retainer 533. In the present embodiment, the value of the lock retainer 533 is written in Step E2 of
In the present embodiment, the exclusion control table 53, which is provided for each object, is referred or updated when a process is carried out on the object and therefore can be said to be indicative of the latest status. The latest exclusion control table 53 that is updated after the execution of a process on the object may be stored in the memory 13 of the server 10.
The present embodiment carries out the process related to the exclusion control using the exclusion control table 53, which stores the above values.
Now, description will now be returned in relation to Step E2 of the flow diagram of
In the ensuing step E3, the exclusion obtainer 43 confirms whether or not the values of the reference counter 531 and the version counter 532 of the exclusion control table 53 of the object referred by the job are updated. For example, in cases where the job carries out a reading process, the exclusion obtainer 43 confirms whether or not the value of the version counter 532 in the exclusion control table 53 of the target object is changed. The purpose in confirming whether or not the value of the version counter 532 is changed is to confirm that the data is not updated by another job immediately before the job reads data. For example, in cases where the job carries out a writing process, the exclusion obtainer 43 confirms whether the values of the reference counter 531 and the version counter 532 in the exclusion control table 53 of the target object are changed. The purpose in confirming whether the values of the reference counter 531 and the version counter 532 are changed is to confirm that data is not referred to or updated by another job immediately before the job writes data. In the example of
In step E4, the exclusion obtainer 43 determines whether or not the value “NULL” is set in the lock retainer 533 in the exclusion control table 53 of an object being referred to by the job. In cases where the exclusion obtainer 43 determines that the value “NULL” is set in the lock retainer 53, the process proceeds to Step E5 (Yes in Step E4). On the other hand, in cases where the exclusion obtainer 43 determines that a value different from “NULL” is set in the lock retainer 533 (No in Step E4), there is a high possibility that another job obtains exclusion for the object being referred to. Consequently, the job, which is determined to have failed to obtain the exclusion, is stored into a waiting queue 54 (Step E6). Although not illustrated here, the process of the exclusion obtaining phase for a job stored in the waiting queue 54 may be resumed (executed again) at a predetermined timing. As an example of this case, the process of the job may be restarted from Step E1 of
Instep E5, a process of obtaining exclusion is carried out as a finalization process. In the example of
In cases where the job successfully obtains exclusion through the steps (i.e., Steps E1-E6) of the above exclusion obtaining phase, the process is shifted to the ensuing process executing phase (i.e., transition from the first phase to the second phase).
(1-4-2) Example of the Operation in the Process Executing Phase of the Information Processing System of the Present Embodiment:
Description will now be made in relation to an example of the operation in the process executing phase performed in the information processing system 1 according to an example of the present embodiment along the flow diagram (Steps F1-F3) by referring to
The process executor 44 receives notification that the exclusion obtaining phase is finished (notification that exclusion obtaining is completed) from the exclusion obtainer 43 and moves into the process executing phase (Step F1-F3). In Step F1, the process executor 44 requests the disk controller 42 to store the exclusion control table 53 referred to by the job into, for example, the storage device 20. The data in the object of the stored exclusion control table 53 is made persistent by the disk controller 42 storing the exclusion control table 53 in the storage device 20. In the example of
In the next step F2, the process executor 44 carries out the actual process and thereby the object is updated. The specific contents of the actual process that the process executor 44 carries out is a process unique to the job. In the example of
In the ensuing step F3, the process executor 44 performs the finalization process of the process executing phase. Specifically, the process executor 44 requests the disk controller 42 to store (the information of) the object referred to by the job into, for example, the storage device 20. Furthermore, the process executor 44 carries out a process of cancelling the exclusion obtained for the job and requests the exclusion control table manager 47 to update the information of the exclusion control table 53. In the example of
In step F3, the process executor 44 requests the disk controller 42 to store the updated exclusion control table 53 into, for example, the storage device 20. Consequently, the object is made persistent by the disk controller 42 storing (the information of) the referred object and/or the updated exclusion control table 53 into, for example, the storage device 20. In the example 11, as carried out in the process (8)-2, the disk controller 42 stores the information of the volume A and the chunk X and the exclusion control tables 53 of the volume A and the chunk X into the storage device 20.
In the manner described above, in cases where multiple competitive jobs are present, it is sufficient that the present embodiment carries out a process of obtaining exclusion immediately before any one of the jobs starts its process and releases the obtained exclusion immediately after the process is completed. This eliminates the requirement for executing the process of obtaining exclusion throughout the time period from requesting a process to completing the process. Consequently, since the time period for which a process of obtaining exclusion can be shortened in the present embodiment, the time period for which another job can access the object is prolonged, resulting in enhancement in process throughput.
(1-5) Process when Overtaking Occurs in the Information Processing System of the Present Embodiment:
Description will now be made in relation to a process performed when overtaking occurs in the information processing system 1 according to an example of the present embodiment with reference to
As illustrated in
As described above, providing the version counter 532 to the exclusion control table 53 as well as the reference counter 531 makes it possible to, in cases where overtaking as illustrated in
(2) Effects:
As detailed above, the information processing system 1 of the present embodiment divides the exclusion control into the exclusion obtaining phase and the process executing phase, and carries out optimistic locking control in the exclusion obtaining phase, so that the exclusion is not obtained until immediately before the execution of the process. This shortens the time period for which the exclusion is obtained over a particular object, and thereby prolongs the time (period) for which another job can access the particular object. Furthermore, the information processing system 1 of the present embodiment can carry out the exclusion control in the optimum range by restricting the exclusion range. Thereby, the throughput of the process of the entire information processing system 1 can be enhanced.
The information processing system 1 of the present invention saves the amount of program code to be implemented, and can thereby achieve versatile implementation.
The information processing system 1 of the present embodiment carries out the exclusion control, using the exclusion control tables 53, and can thereby efficiently carry out the exclusion control even under a state of the presence of multiple competitive jobs.
Even when overtaking as illustrated in
(3) Others:
The technique according to the embodiment detailed above can be changed or modified as follows.
In the information processing system 1 of the above embodiment, the exclusion control table 53 for each object is stored in the storage device 20, but may alternatively be stored in, for example, the memory 13 of the server 10.
In the information processing system 1 of the above embodiment, the exclusion control tables 53 are provided one for each object, but alternatively a competitive state for multiple objects may be managed with a single table.
According to the embodiment described above, exclusion control can be accomplished in the optimum range in an information processing system.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2018-004323 | Jan 2018 | JP | national |