LVM data processing method, device, computer equipment and computer readable medium

By adopting a centralized lock mechanism in the LVM environment stored in virtualized storage, the problem of high communication costs of the existing distributed lock mechanism is solved, and efficient lock management and data reliability are realized.

CN112988319BActive Publication Date: 2025-01-24ZTE CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN201911214200.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-02
Publication Date
2025-01-24
Estimated Expiration
2039-12-02

AI Technical Summary

Technical Problem

The existing distributed lock mechanism has high communication costs in the LVM environment with virtualized storage, which is not conducive to early deployment and post-management.

Method used

Provide a centralized lock mechanism, calling the entrance file and the lock file to be processed by the lock list of the device to achieve the centralized lock management of multiple volume groups and reduce communication costs.

Benefits of technology

The efficient lock management of multiple volume groups has been implemented, the communication cost is reduced, the lock -up efficiency is improved, and multiple calculation nodes are avoided at the same time to process meta -data of the same VG, which enhances data reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988319B_ABST
    Figure CN112988319B_ABST
Patent Text Reader

Abstract

The present disclosure provides an LVM data processing method. When a data processing request is received, an entry file is called from a lock directory of a management device, and the entry file is locked, wherein the entry file corresponds to multiple volume groups VGs, and a lock file of a to-be-processed VG corresponding to the data processing request is called from the lock directory of the management device, and a write lock is added to the lock file of the to-be-processed VG, wherein one lock file corresponds to one VG, and according to the data processing request, metadata in the to-be-processed VG is processed, and the write lock of the lock file and the lock of the entry file are released. A centralized lock mechanism provided by an embodiment of the present disclosure can save communication costs, and by setting an entry file, the locking efficiency can be improved. The present disclosure also provides an LVM data processing device, a computer device, and a computer-readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of virtualized storage technology, and in particular to an LVM data processing method, device, computer equipment, and computer-readable medium. Background Art

[0002] In the field of virtualized storage technology, virtual machine disks are hosted in the form of LVM (Logical Volume Manager). Figure 1 As shown, a networking method for virtualized storage includes: management nodes, computing nodes and magnetic arrays. The management node interacts with each computing node through a management network switch, and each computing node accesses the magnetic array through a storage network switch. Among them, the management node is responsible for managing basic resources such as computing resources, network resources and storage resources, as well as managing the life cycle of virtual machines such as creating virtual machines, deleting virtual machines, and backing up virtual machines. Virtual machines run on computing nodes. Computing nodes use their own CPU (Central Processing Unit) and memory to provide computing resources for virtual machines, use their own network cards to provide network resources for virtual machines, and use magnetic arrays to provide storage resources for virtual machines. Multiple computing nodes can access one or more magnetic arrays at the same time.

[0003] like Figure 2 As shown, multiple hard disks in the magnetic array form a volume group (RAID), and the volume group is divided into logical volumes of appropriate sizes to provide to computing nodes. The computing node uses LVM to manage the LUN (Logical Unit Number) of the magnetic array, and one logical volume corresponds to one LUN. Each LUN is formatted into a PV (Physical Volume), and multiple PVs form a VG (Volume Group). Each VG is used as a storage repository in the management node. LV (Logical Volume) is created in the VG as a virtual machine disk. The computing node uses LVM commands to perform subsequent operations such as modifying and deleting virtual machine disks, and also uses LVM commands to process metadata in all PVs. When multiple computing nodes operate different virtual machines at the same time (that is, when multiple computing nodes use one or more magnetic arrays at the same time), a lock mechanism needs to be provided to ensure that the LVM command can mutually exclusively process the metadata of a VG, or mutually exclusively process the metadata of all VGs, so as to avoid interference between operations of various computing nodes.

[0004] The existing lock mechanism is a distributed lock mechanism, which needs to be sent to each cluster when in use. The communication cost required for operation is high, which is not conducive to early deployment and later management. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present disclosure provides an LVM data processing method, apparatus, computer device and computer-readable medium.

[0006] In a first aspect, an embodiment of the present disclosure provides an LVM data processing method, the method comprising:

[0007] When a data processing request is received, an entry file is called from a lock directory of a management device, and the entry file is locked, wherein the entry file corresponds to a plurality of volume groups VG;

[0008] Recalling the lock file of the to-be-processed VG corresponding to the data processing request from the lock directory of the management device, and adding a write lock to the lock file of the to-be-processed VG, wherein one lock file corresponds to one VG;

[0009] According to the data processing request, processing the metadata in the to-be-processed VG;

[0010] Release the write lock of the lock file and the lock of the entry file.

[0011] Preferably, the step of locking the entry file comprises:

[0012] The entry file is locked within a preset time period; if the locking is successful, the lock file of the to-be-processed VG corresponding to the data processing request is called from the lock directory of the management device; if the locking is unsuccessful, the entry file is locked again.

[0013] Preferably, the entry file and the lock file are stored in a configuration file of a network file system of the management device.

[0014] Preferably, the to-be-processed VGs corresponding to the data processing request are all VGs managed by the management device, and the locking of the entry file comprises: adding a write lock to the entry file;

[0015] The releasing the lock of the entry file includes: releasing the write lock of the entry file.

[0016] Further, calling the lock file of the to-be-processed VG corresponding to the data processing request from the lock directory of the management device includes:

[0017] Calling a lock file list from the lock directory of the management device, wherein the lock file list is used to record the names of the lock files corresponding to all VGs managed by the management device;

[0018] Adding a write lock to the lock file of the VG to be processed includes:

[0019] Write locks are added to each lock file recorded in the lock file list one by one.

[0020] Preferably, the to-be-processed VG corresponding to the data processing request is one VG, and the locking of the entry file comprises: adding a read lock to the entry file;

[0021] The releasing the lock of the entry file includes: releasing the read lock of the entry file.

[0022] Further, the releasing the write lock of the lock file and the lock of the entry file includes:

[0023] First release the read lock of the entry file, and then release the write lock of the lock file of the VG to be processed.

[0024] In another aspect, an embodiment of the present disclosure provides a method for processing LVM data, the method comprising:

[0025] A lock directory is configured in the configuration file of the network file system. The lock directory includes an entry file and multiple lock files. The entry file corresponds to multiple volume groups VG, and each lock file corresponds to one VG.

[0026] Furthermore, the lock directory also includes a lock file list, and the lock file list is used to record the names of the lock files corresponding to all VGs managed by the management device.

[0027] In another aspect, the embodiment of the present disclosure further provides an LVM data processing device, comprising: a receiving module, a calling module and a processing module;

[0028] The receiving module is used to receive a data processing request;

[0029] The calling module is used to call the entry file corresponding to the data processing request from the lock directory of the management device, wherein the entry file corresponds to multiple volume groups VGs, and one lock file corresponds to one VG; and call the lock file of the VG to be processed from the lock directory of the management device;

[0030] The processing module is used to lock the entry file; process the metadata in the to-be-processed VG according to the data processing request; and release the write lock of the lock file and the lock of the entry file.

[0031] In yet another aspect, an embodiment of the present disclosure further provides a management device, including: a configuration module;

[0032] The configuration module is used to configure a lock directory in the configuration file of the network file system, wherein the lock directory includes an entry file and multiple lock files, wherein the entry file corresponds to multiple volume groups VG, and each lock file corresponds to one VG.

[0033] On the other hand, the embodiments of the present disclosure further provide a computer device, comprising: one or more processors and a storage device; wherein one or more programs are stored on the storage device, and when the one or more programs are executed by the one or more processors, the one or more processors implement the LVM data processing method provided in the aforementioned embodiments.

[0034] The embodiments of the present disclosure further provide a computer-readable medium on which a computer program is stored, wherein when the computer program is executed, the LVM data processing method provided in the aforementioned embodiments is implemented.

[0035] The LVM data processing method provided by the embodiment of the present disclosure, when receiving a data processing request, calls the entry file from the lock directory of the management device, and locks the entry file, wherein the entry file corresponds to multiple volume groups VG, calls the lock file of the VG to be processed from the lock directory of the management device, and adds a write lock to the lock file of the VG to be processed, wherein one lock file corresponds to one VG, processes the metadata in the VG to be processed according to the data processing request, and releases the write lock of the lock file and the lock of the entry file. The embodiment of the present disclosure provides a centralized lock mechanism, in which the management device centrally manages the file lock, and when each computing node needs to use the file lock, it only needs to call the corresponding lock file for locking processing, saving communication costs; in addition, by setting the entry file, it is possible to implement global locks for multiple VGs, without locking each VG separately, thereby improving locking efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of the existing virtual storage networking environment;

[0037] Figure 2 This is a schematic diagram of existing LVM data storage and access;

[0038] Figure 3 A flow chart of an LVM data processing method provided by an embodiment of the present disclosure;

[0039] Figure 4 A schematic diagram of a configuration lock directory provided for yet another embodiment of the present disclosure;

[0040] Figure 5 A schematic diagram of the structure of an LVM data processing device provided by another embodiment of the present disclosure;

[0041] Figure 6 A schematic diagram of the structure of a management device provided in yet another embodiment of the present disclosure. DETAILED DESCRIPTION

[0042] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.

[0043] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0044] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.

[0045] The embodiments described herein may be described with reference to plan views and / or cross-sectional views by means of idealized schematic diagrams of the present disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the accompanying drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0046] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0047] The present disclosure provides a method for processing LVM data. Figure 3 As shown, the LVM data processing method includes the following steps:

[0048] Step 11, when a data processing request is received, the entry file is called from the lock directory of the management device and the entry file is locked, wherein the entry file corresponds to multiple VGs.

[0049] like Figure 4As shown in the figure, the management device manages multiple VGs. During the initialization phase, the management device generates a lock directory and provides it to all computing nodes for mounting through NFS (Network File System). The management device configures an empty file as a lock file for each volume group VG it manages under the lock directory. Each lock file is named according to the corresponding VG name, such as Figure 4 The management device can further configure an empty file with a special name as the entry file for all lock files, such as Figure 4 The .xxxx-00000000 files in .

[0050] In this step, the computing node receives a data processing request (the data processing request is a request to process metadata in a VG), first calls the entry file from the management device, and then locks the entry file according to the number of VGs to be processed, where the entry file can be read locked or write locked.

[0051] Step 12: call the lock file of the VG to be processed corresponding to the data processing request from the lock directory of the management device, and add a write lock to the lock file of the VG to be processed, wherein one lock file corresponds to one VG.

[0052] In this step, after the computing node locks the entry file, it can call the lock file of the corresponding name from the lock directory of the management device according to the name of the VG to be processed. After adding a write lock to the lock file of the VG to be processed, the VG to be processed can be locked, and the computing node can process the metadata in the VG to be processed, and no matter whether the entry file is added with a read lock or a write lock in step 11, other computing nodes can no longer lock the lock file of the VG to be processed, that is, after adding a write lock to the lock file of the VG to be processed, other computing nodes will not be able to read or modify the metadata in the VG to be processed, avoiding multiple computing nodes from processing the metadata in the same VG at the same time, realizing the mutual exclusion of multiple computing node LVMs concurrently accessing the same VG, and improving data reliability.

[0053] Step 13: Process the metadata in the VG to be processed according to the data processing request.

[0054] In this step, the computing node may perform corresponding LVM operations according to the data processing request. The data request may include a request to read and / or modify metadata in the VG to be processed. Since a write lock is added to the lock file of the VG to be processed in step 12, in this step, the computing node will not be interfered with by other computing nodes whether reading or modifying the metadata in the VG to be processed.

[0055] Step 14, release the write lock of the lock file and the lock of the entry file.

[0056] In this step, in order not to affect other computing nodes in processing the metadata of the pending VG, the computing node needs to release the write lock of the lock file and the lock of the entry file after processing the metadata in the pending VG.

[0057] It can be seen from steps 11-14 that the LVM data processing method provided by the embodiment of the present disclosure, when receiving a data processing request, calls the entry file from the lock directory of the management device, and locks the entry file, wherein the entry file corresponds to multiple volume groups VG, calls the lock file of the VG to be processed corresponding to the data processing request from the lock directory of the management device, and adds a write lock to the lock file of the VG to be processed, wherein one lock file corresponds to one VG, and according to the data processing request, processes the metadata in the VG to be processed, and releases the write lock of the lock file and the lock of the entry file. The embodiment of the present disclosure provides a centralized lock mechanism, in which the management device centrally manages the file lock, and when each computing node needs to use the file lock, it only needs to call the corresponding lock file for locking processing, saving communication costs; in addition, by setting the entry file, it is possible to implement global locks for multiple VGs, without locking each VG separately, thereby improving locking efficiency.

[0058] In some embodiments, the locking of the entry file (i.e., step 11) may include the following steps: locking the entry file within a preset time length; wherein, if the locking is successful, calling the lock file of the VG to be processed corresponding to the data processing request from the lock directory of the management device; if the locking is unsuccessful, locking the entry file again. In some embodiments of this step, a preset time length may be set as a locking timeout period, during which the computing node may lock the entry file. If the locking is successful, the computing node may directly call the lock file of the VG to be processed from the lock directory of the management device. If the locking is unsuccessful, it means that the entry file may currently be write-locked by other computing nodes and the write lock has not been released. At this time, the entry file may be locked again until the locking is successful. If the entry file is not successfully locked within the locking timeout period, the process ends.

[0059] In some embodiments, the entry file and the lock file are stored in a configuration file of the network file system of the management device. The management device can configure the lock directory (including the entry file and the lock file) into the NFS configuration file during the initialization phase for use by each computing node to mount. The file record lock using NFS can be automatically unlocked after the process is destroyed, thus effectively solving the problem of the entire VG being unusable in the future due to the lock remaining after the locking process is forcibly closed or the computing node crashes.

[0060] The disclosed embodiment may add a global lock to all VGs managed by the management device, that is, the VGs to be processed may be all VGs managed by the management device, and the locking of the entry file (i.e., step 11) may include: adding a write lock to the entry file. Correspondingly, releasing the lock of the entry file (i.e., step 14) may include: releasing the write lock of the entry file.

[0061] By adding a write lock to the entry file, all VGs managed by the management device can be managed uniformly. Since the execution priority of adding a write lock is higher than the execution priority of adding a read lock, the LVM command to add a write lock to the entry file is executed first, and other computing nodes can no longer lock the entry file (neither read lock nor write lock can be added). In addition, after adding a write lock to the entry file, when adding a write lock to the lock file of the VG to be processed later, there is no need to sort the lock files first and then lock the lock files in order to prevent deadlock, thereby improving the locking efficiency.

[0062] In some embodiments, the lock directory may further include a lock file list, where the lock file list is used to record the names of the lock files corresponding to all VGs managed by the management device.

[0063] When the VG to be processed is all the VGs managed by the management device, the calling of the lock file of the VG to be processed corresponding to the data processing request from the lock directory of the management device (i.e., step 12) includes: calling the lock file list from the lock directory of the management device. Correspondingly, the adding of a write lock to the lock file of the VG to be processed includes: adding a write lock to each lock file recorded in the lock file list one by one. It should be noted that the operation of adding a write lock to each lock file cannot be performed in parallel, so according to the name of the lock file recorded in the lock file list, each lock file is added with a write lock one by one. In some embodiments, the computing node directly calls the lock file list and adds a write lock to each lock file according to the order of the lock file names recorded in the lock file list. Since the entry file has been written before, the order of adding write locks to different lock files will not cause a deadlock. At this time, it is not necessary to sort the lock files first and then add write locks to each lock file in order. It is only necessary to add write locks to each lock file one by one according to the names of the lock files corresponding to all the VGs managed by the management device recorded in the lock file list until all are successfully locked.

[0064] The disclosed embodiment can also lock a certain VG managed by the management device separately, that is, the VG to be processed can be a VG managed by the management device, and the locking of the entry file (i.e., step 11) can include: adding a read lock to the entry file. Correspondingly, the releasing of the lock of the entry file (i.e., step 14) can include: releasing the read lock of the entry file. It should be noted that after adding a read lock to the entry file, other computing nodes can also add a read lock to the entry file, but cannot add a write lock to the entry file. In other words, by adding a read lock to the entry file, other computing nodes can still add a read lock to the entry file, so that other computing nodes can add a write lock to the lock file of other VGs and process the metadata of the VG, thereby realizing concurrent processing of data operations in different VGs.

[0065] It should be noted that in the scenario where a certain VG is locked separately (that is, the VG to be processed is a VG managed by the management device), a write lock can also be added to the entry file. However, if a write lock is added to the entry file, other computing nodes can neither read lock nor write lock the entry file. In this way, concurrent processing of data operations in different VGs cannot be achieved, resulting in low data processing efficiency.

[0066] In some embodiments, when the VG to be processed is a VG managed by the management device, the releasing the write lock of the lock file and the lock of the entry file may include: first releasing the read lock of the entry file, and then releasing the write lock of the lock file of the VG to be processed. Releasing the lock of the entry file first, and then releasing the write lock of the lock file of the VG to be processed, can enable other computing nodes to add a write lock to the entry file in a timely manner.

[0067] It should be noted that when the VG to be processed is a VG managed by the management device, the computing node can also release the read lock of the entry file after adding a write lock to the lock file of the VG to be processed (i.e., step 12), and then process the metadata in the VG to be processed (i.e., step 13), and finally release the write lock of the lock file of the VG to be processed. Releasing the read lock of the entry file first after step 12 can also enable other computing nodes to add a write lock to the entry file in a timely manner.

[0068] Another embodiment of the present disclosure also provides a method for processing LVM data. Figure 4 As shown, the LVM data processing method includes:

[0069] A lock directory is configured in the configuration file of the network file system. The lock directory includes an entry file and multiple lock files. The entry file corresponds to multiple volume groups VG, and each lock file corresponds to one VG.

[0070] Further, such as Figure 4As shown, the lock directory also includes a lock file list, and the lock file list is used to record the names of the lock files corresponding to all VGs managed by the management device.

[0071] like Figure 4 As shown in the figure, the management device is configured with a lock directory, which is provided to all computing nodes for mounting through NFS. Under the lock directory, a corresponding empty file named according to the VG name is created for each VG managed by the management device as a lock file, such as .xxxx-vg1, .xxxx-vg2, etc. A special file (i.e., lock file list) is created under the lock directory to maintain all created lock files for use when adding global locks, such as the .lock_list file. An empty file with a special name is created under the lock directory as the entry file for all locking operations, such as the .xxxx-00000000 file.

[0072] The LVM data processing method is described in detail below in conjunction with two specific embodiments.

[0073] When the VG to be processed is all the VGs managed by the management device, when the computing node receives the data processing request, the following steps can be performed: the computing node calls the entry file with the file name .xxxx-00000000 from the management device, and adds a write lock to the entry file within a preset time length. Specifically, the computing node calls the lock file list file with the file name .lock_list from the management device, and adds write locks to the files .xxxx-vg1, .xxxx-vg2, etc. one by one according to the lock file names recorded in the lock file list. The computing node performs LVM operations according to the data processing request, and after processing the metadata in the VG to be processed, releases the write locks of all lock files .xxxx-vg1, .xxxx-vg2, etc., and releases the write lock of the entry file.

[0074] When the VG to be processed is a VG managed by the management device, such as a lock file named .xxxx-vg1, when the computing node receives a data processing request, it calls the entry file named .xxxx-00000000 from the management device and adds a read lock to the entry file within a preset time. The computing node adds a write lock to the lock file named .xxxx-vg1, performs LVM operations according to the data processing request, and releases the read lock of the entry file and the write lock of the .xxxx-vg1 file after processing the metadata in the VG corresponding to the .xxxx-vg1 file.

[0075] Based on the same technical concept, the embodiment of the present disclosure also provides an LVM data processing device, such as Figure 5As shown, the LVM data processing device includes a receiving module 51, a calling module 52 and a processing module 53.

[0076] The receiving module 51 is used to receive a data processing request.

[0077] The calling module 52 is used to call an entry file from a management device, wherein the entry file corresponds to multiple volume groups VGs and a lock file corresponds to one VG; call the lock file of the VG to be processed from the management device; and call the lock file of the VG to be processed corresponding to the data processing request from the management device.

[0078] The processing module 53 is used to lock the entry file; process the metadata in the to-be-processed VG according to the data processing request; and release the write lock of the lock file and the lock of the entry file.

[0079] In some embodiments, the processing module 53 is used to lock the entry file within a preset time period; if the locking is successful, the lock file of the to-be-processed VG corresponding to the data processing request is called from the management device; if the locking is unsuccessful, the entry file is locked again.

[0080] In some embodiments, the calling module 52 is used to call the entry file and the lock file from a configuration file of the network file system of the management device.

[0081] In some embodiments, the to-be-processed VG corresponding to the data processing request is all VGs managed by the management device, and the processing module 53 is used to add a write lock to the entry file; and release the write lock of the entry file.

[0082] In some embodiments, the calling module 52 is used to call a lock file list from the management device, wherein the lock file list is used to record the names of lock files corresponding to all VGs managed by the management device.

[0083] The processing module 53 is used to add write locks to each lock file recorded in the lock file list one by one.

[0084] In some embodiments, the to-be-processed VG corresponding to the data processing request is one VG, and the processing module 53 is used to add a read lock to the entry file; and release the read lock of the entry file.

[0085] In some embodiments, the to-be-processed VG corresponding to the data processing request is a VG, and the processing module 53 is used to first release the read lock of the entry file, and then release the write lock of the lock file of the to-be-processed VG.

[0086] The present disclosure also provides a management device, such as Figure 6 As shown, the management device includes: a configuration module 61;

[0087] The configuration module 61 is used to configure a lock directory in the configuration file of the network file system, wherein the lock directory includes an entry file and multiple lock files, wherein the entry file corresponds to multiple volume groups VG, and each lock file corresponds to one VG.

[0088] In some embodiments, the configuration module 61 is further used to configure a lock file list in the lock directory, where the lock file list is used to record the names of the lock files corresponding to all VGs managed by the management device.

[0089] The embodiments of the present disclosure also provide a computer device, which includes: one or more processors and a storage device; wherein one or more programs are stored on the storage device, and when the one or more programs are executed by the one or more processors, the one or more processors implement the LVM data processing method provided in the aforementioned embodiments.

[0090] The embodiments of the present disclosure further provide a computer-readable medium on which a computer program is stored, wherein when the computer program is executed, the LVM data processing method provided in the aforementioned embodiments is implemented.

[0091] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, the functional modules / units in the device may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0092] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.

Claims

1. A LVM data processing method, comprising: When a data processing request is received, an entry file is called from the lock directory of the management device, and the entry file is locked, wherein the entry file corresponds to multiple volume groups VG; the lock loaded by the entry file is a write lock or a read lock, which is used to lock all VGs managed by the management device, or to lock a single VG managed by the management device; Recalling the lock file of the to-be-processed VG corresponding to the data processing request from the lock directory of the management device, and adding a write lock to the lock file of the to-be-processed VG, wherein one lock file corresponds to one VG; According to the data processing request, processing the metadata in the to-be-processed VG; Release the write lock of the lock file and the lock of the entry file.

2. The method of claim 1, wherein: The step of locking the entry file comprises: The entry file is locked within a preset time period; if the locking is successful, the lock file of the to-be-processed VG corresponding to the data processing request is called from the lock directory of the management device; if the locking is unsuccessful, the entry file is locked again.

3. The method of claim 1, wherein: The entry file and the lock file are stored in a configuration file of the network file system of the management device.

4. The method according to any one of claims 1 to 3, wherein: The to-be-processed VGs corresponding to the data processing request are all VGs managed by the management device, and the step of locking the entry file includes: adding a write lock to the entry file; The releasing the lock of the entry file includes: releasing the write lock of the entry file.

5. The method of claim 4, wherein: The calling the lock file of the to-be-processed VG corresponding to the data processing request from the lock directory of the management device includes: Calling a lock file list from the lock directory of the management device, wherein the lock file list is used to record the names of the lock files corresponding to all VGs managed by the management device; Adding a write lock to the lock file of the VG to be processed includes: Write locks are added to each lock file recorded in the lock file list one by one.

6. The method according to any one of claims 1 to 3, wherein: The to-be-processed VG corresponding to the data processing request is a VG, and the locking of the entry file comprises: adding a read lock to the entry file; The releasing the lock of the entry file includes: releasing the read lock of the entry file.

7. The method of claim 6, wherein: The releasing the write lock of the lock file and the lock of the entry file comprises: First release the read lock of the entry file, and then release the write lock of the lock file of the VG to be processed.

8. A LVM data processing method, comprising: A lock directory is configured in a configuration file of the network file system, wherein the lock directory includes an entry file and a plurality of lock files, wherein the entry file corresponds to a plurality of volume groups VG, and each lock file corresponds to a VG; By locking the entry file, all the managed VGs are locked, or one managed VG is locked separately; the lock loaded by the entry file is a write lock or a read lock.

9. The method of claim 8, wherein: The lock directory also includes a lock file list, and the lock file list is used to record the names of the lock files corresponding to all VGs managed by the management device.

10. An LVM data processing device, comprising: Receiving module, calling module and processing module; The receiving module is used to receive a data processing request; The calling module is used to call an entry file corresponding to the data processing request from a management device, wherein the entry file corresponds to multiple volume groups VGs, and one lock file corresponds to one VG; call the lock file of the VG to be processed from the management device; the lock loaded by the entry file is a write lock or a read lock, which is used to lock all VGs managed by the management device, or to lock a VG managed by the management device alone; The processing module is used to lock the entry file; process the metadata in the to-be-processed VG according to the data processing request; and release the write lock of the lock file and the lock of the entry file.

11. A management device, comprising: Configuration module; The configuration module is used to configure a lock directory in the configuration file of the network file system, wherein the lock directory includes an entry file and multiple lock files, wherein the entry file corresponds to multiple volume groups VGs, and each lock file corresponds to one VG respectively; by locking the entry file, all the managed VGs are locked, or a managed VG is locked separately; the lock loaded by the entry file is a write lock or a read lock.

12. A computer device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the LVM data processing method according to any one of claims 1 to 9.

13. A computer readable medium having a computer program stored thereon, wherein: When the program is executed, the LVM data processing method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Cluster file system

    CN106777394A

  • Distributed system and method for dispatching target objects in distributed system

    CN106790694A

  • Service request processing method and device and computer readable storage medium

    CN110097330A

  • Data processing method, device, equipment and storage medium

    CN110413628A