Method and system for realizing storage lock of distributed block storage system
By directly parsing the application lock instructions in the distributed block storage system and using the distributed DHT hash algorithm to determine the main storage node, the problems of storage lock synchronization complexity and performance degradation in the existing technology are solved, and efficient storage lock support is achieved. and system stability.
Patent Information
- Application Number
- CN202410778288.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-08-30
AI Technical Summary
When existing distributed storage systems support shared storage architecture, storage lock synchronization is complicated, leading to performance degradation and stability issues. Especially in multi-path access scenarios, the synchronization mechanism of the SCSI gateway cluster increases failure points.
By directly parsing the application lock instructions in the distributed block storage system, using the cluster status information of the distributed storage cluster, the lock request is converted into a lock request within the distributed storage, and is directly sent to the main storage node for processing, using distributed DHT The hash algorithm determines the primary storage node and performs mutex protection at the node level to avoid synchronization issues with SCSI or NVME protocols.
It realizes support for shared storage structures in distributed storage systems, reduces storage performance losses, improves system stability and access performance, and avoids problems with SCSI PR information synchronization and CAW lock logic concurrent access.
Smart Images

Figure CN118567569A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer software defined storage, and relates to a computer distributed block storage system, and in particular to a storage lock implementation method and system for the distributed block storage system. Background Art
[0002] In a shared storage environment, multiple front-end hosts may access the same storage volume space at the same time. If multiple hosts concurrently write to the same storage volume at the same time, this will cause data corruption. SCSI lock is a technical solution to the corresponding problem in the SCSI storage protocol. The SCSI Persistent Reservation (PR) command is used by the application to set access rights for the entire LUN (storage volume level), and the SCSI COMPARE AND WRITE (CAW) command is used for more fine-grained atomic access control of a data block, also known as CAS (Compare and Swap) hardware-assisted lock. The NVME protocol that has gradually developed in recent years also supports corresponding PR and CAW instructions to support this scenario.
[0003] Both SCSI and NVME protocols are storage protocols of the client-server point-to-point model. In the field of software-defined storage, the IO model between the client and the storage server is one-to-many. In order to support the PR / CAW logic under the shared storage architecture, the mainstream distributed storage software on the market often introduces SCSI gateway clusters on the upper layer of the distributed storage client. The PR / CAW processing method at the SCSI gateway layer solves the problem of supporting storage locks in the shared storage architecture. This solution not only complicates the storage system, but also reduces storage performance. The PR lock information must be fully synchronized between the SCSI gateway clusters to cope with the multi-path access method of the front-end application. This will inevitably introduce a clustered PR lock information synchronization mechanism, complicating the entire storage technology solution, bringing more failure points, and affecting the stability of the storage system. The read and write requests first need to be parsed by the SCSI protocol after passing through the SCSI gateway, and then converted into the private access parsing of the distributed storage to the back-end for IO processing. This has an extra layer of storage link transmission and storage protocol conversion, which has a huge impact on storage performance. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a distributed block storage system storage lock implementation method and system to achieve support for shared storage structure in distributed storage scenarios.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A method for implementing a storage lock in a distributed block storage system comprises the following steps:
[0007] Receive an application lock instruction, parse the application lock instruction, convert the application lock instruction into a lock request for a corresponding offset position of a storage volume or storage object within the distributed storage according to the pre-stored cluster status information of the distributed storage cluster, and send the lock request to the primary storage node of the corresponding storage volume or storage object;
[0008] After receiving the lock processing result fed back by the primary storage node, judging whether the storage lock is successfully implemented according to the lock processing result;
[0009] Among them, the lock processing result is lock processing success or error failure. When the lock processing result is lock processing success, the primary storage node performs access control on subsequent read and write requests from different clients for the same storage volume according to the latest configuration and permission settings of the lock.
[0010] Furthermore, the cluster status information includes mounted volume information and cluster view information.
[0011] Furthermore, the lock request is a volume-level PR lock request or a block-level CAW lock request.
[0012] Furthermore, the primary storage node is determined by using a distributed DHT hash algorithm according to the cluster status information.
[0013] Furthermore, the determination of the primary storage node is specifically as follows:
[0014] If the lock request is a volume-level PR lock request, the storage object ID of the volume metadata is used to calculate the storage locations of all copies of the volume metadata object in the data distribution DHT hash ring, and the storage node where the first copy is located is used as the primary storage node for processing. For the EC storage pool, the first data shard is used as the primary storage node for processing;
[0015] If the lock request is a block-level CAW lock request, the logical volume offset address and data block length specified in the lock request are converted into a lock request for the corresponding storage object. The lock request for each storage object calculates its own storage distribution position in the data distribution DHT hash ring according to the storage object ID, and the storage node corresponding to each storage distribution position serves as the main storage node for processing.
[0016] Furthermore, the process of the primary storage node feeding back the lock processing result includes:
[0017] If a volume-level PR lock request is received, determine whether it is a PR_IN request. If so, read the storage volume metadata and generate a lock processing result based on the PR information in the volume metadata. If not, it is a PR_OUT request, read the volume metadata, update the volume metadata PR lock information according to the volume-level PR lock request, and persist it to the underlying storage medium of the distributed storage system, and synchronize the volume metadata PR lock information to all storage nodes of the distributed storage system. After waiting for all storage nodes to feedback the synchronization status, generate a lock processing result;
[0018] Among them, for the PR lock operation of the same volume, the storage node uses the node-level MUTEX mutex lock for protection;
[0019] If a block-level CAW lock request is received, a memory-level mutex lock is constructed for the storage area specified by the block-level CAW lock request, and concurrent block-level CAW lock requests for the same storage object are added to the lock request waiting queue being processed, waiting for the previous CAW lock operation to be completed before being processed; the storage location data content corresponding to the block-level CAW lock request is read from the underlying storage medium, and compared with the expected data in the block-level CAW lock request to determine whether the content is consistent, and a lock processing result is generated based on the determination result.
[0020] Furthermore, the lock request includes a client ID of a block access client that sends the lock request.
[0021] Furthermore, the method further comprises:
[0022] When the application lock instruction comes from a heterogeneous platform, the received application lock instruction is forwarded through a PASSTHROUGH interface and then parsed.
[0023] The present invention also provides a distributed block storage system, including a distributed storage cluster and a plurality of block device clients, wherein:
[0024] The block device client includes a PBDX block driver with a built-in SCSI command parser, and the SCSI command parser is used to receive and parse the application lock instruction, and according to the cluster status information of the pre-stored distributed storage cluster, convert the application lock instruction into a lock request for the corresponding offset position of the storage volume or storage object inside the distributed storage, and send it to the primary storage node of the corresponding storage volume or storage object, and after receiving the lock processing result fed back by the primary storage node, determine whether the storage lock is successfully implemented according to the lock processing result;
[0025] The distributed storage cluster includes a main storage node, which is used to receive the lock request and perform corresponding processing, generate a lock processing result, and feed it back to the block device client;
[0026] Among them, the lock processing result is lock processing success or error failure. When the lock processing result is lock processing success, the primary storage node performs access control on subsequent read and write requests from different clients for the same storage volume according to the latest configuration and permission settings of the lock.
[0027] Furthermore, the block device client further includes a PASSTHROUGH interface, and the PASSTHROUGH interface is used for forwarding to the PBDX block driver.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] The present invention directly parses the application lock instruction without adding a SCSI or NVME protocol conversion gateway layer, and directly implements the lock function through the PBDX private block access interface. At the same time, the PR and CAW storage locks are implemented in the underlying distributed storage logic, and the lock logic is implemented through a distributed algorithm, thereby avoiding the synchronization problem of SCSIPR information in the storage gateway layer and the concurrent access atomic problem of CAW lock logic. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a schematic diagram of the overall process of distributed storage cluster storage lock processing of the present invention;
[0031] Figure 2 A schematic diagram of the process of a storage node processing a PR lock request according to the present invention;
[0032] Figure 3 The figure is a flow chart of a storage node processing a CAW lock request according to the present invention. DETAILED DESCRIPTION
[0033] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0034] Example 1
[0035] The present embodiment provides a method for implementing storage locks in a distributed block storage system, which can be run in a block device client, and includes the following steps: receiving an application lock instruction, parsing the application lock instruction, and converting the application lock instruction into a lock request for the corresponding offset position of the storage volume or storage object within the distributed storage according to the pre-stored cluster status information of the distributed storage cluster, including the mounted volume information and cluster view information, and sending it to the primary storage node of the corresponding storage volume or storage object; after receiving the lock processing result fed back by the primary storage node, judging whether the storage lock is successfully implemented according to the lock processing result. Wherein, the lock processing result is a successful lock processing or an erroneous failure. When the lock processing result is a successful lock processing, the primary storage node performs access control on subsequent read and write requests from different clients for the same storage volume according to the latest configuration and permission settings of the lock.
[0036] The above method is used to solve the problem of multiple application servers mutually exclusive access to the same storage volume (LUN) as a storage-level lock implementation mechanism. In the distributed block storage system, a distributed algorithm is used to natively implement storage volume-level and finer-grained block-level storage atomic locks. At the same time, SCSI instructions such as SCSIPR and CAW are parsed at the private block device client interface layer to achieve seamless compatibility support for SCSI protocol locks. Through the above method, the distributed block storage system does not need to deploy a SCSI access interface layer on the upper layer of the block storage, reducing the performance loss and storage link loss caused by a layer of storage protocol conversion, and achieving storage lock support for shared storage architecture while having higher storage access performance.
[0037] refer to Figure 1The figure shows the overall processing flow chart of the above method, wherein the block device client is provided with PBDX, which is a Linux kernel virtual block driver for the distributed storage system block access client, and has a built-in SCSI command parser. The application system can use the sg command for traditional operation of SCSI block devices to send SCSIPR / CAW instructions to the PBDX block device. When the block device client is initialized, it has obtained the mounted volume information and cluster view information from the backend storage cluster. When the PBDX block driver receives the SCSIPR / CAW instruction, it converts the instruction into a lock request for the corresponding offset position of the storage volume or storage object inside the distributed storage according to the volume information, and sends the request to the master node of the corresponding storage volume or storage object for processing with the client identification ID that initiates the request. Specifically, the PBDX kernel driver (PBDX block driver) of the block device client (i.e., the block access client) receives the application lock instruction of the application side through the IOCTL system call, and converts it into a lock request for one or more storage objects in the distributed storage private protocol according to the volume logical address and length of the application lock instruction, and sends it to the corresponding master storage node determined by the distribution algorithm for processing, and asynchronously waits for the storage node to process the lock request and returns the result to the upper application. The main storage node is determined by the distributed DHT hash algorithm based on the cluster status information. Specifically, a data distribution DHT hash ring is constructed according to the distributed storage cluster status to determine the main storage node, thereby ensuring that concurrent access to the same lock resource by multiple block access clients is processed by the same storage node, ensuring mutual exclusivity and atomicity.
[0038] In this embodiment, the PBDX kernel driver of the block device client has a built-in SCSI command parser, which can parse traditional SCSI commands such as Inquery, PR, and CAW for SCSI block devices. The application side does not need to be adapted separately and does not make any modifications. It is seamlessly compatible with various applications that use the SCSI lock mechanism. The lock request generated after parsing is a volume-level PR lock request or a block-level CAW lock request. Each block access client has a unique Client ID, and each lock request sent to the primary storage node contains a Client ID (CID) to identify the client of the volume-level PR lock operation.
[0039] When determining the primary storage node, the block access client builds a data distribution DHT hash ring based on the state of the distributed storage cluster and uses the distributed DHT hash algorithm to determine the primary storage node. For PR lock requests, the block access client uses the VolumeID of the volume to which the request belongs to calculate the primary storage node and sends the PR request to the primary storage node; for CAW lock requests, the block access client calculates the corresponding storage object ID based on the volume logical offset address in the request, and uses the storage object ID to calculate the primary storage node through the data distribution DHT hash algorithm, constructs a CAW lock request and sends it to the primary storage node.
[0040] Specifically, if the request is a volume-level PR lock request, the storage object ID where the volume metadata is located is used to calculate the storage locations of all copies of the volume metadata object in the data distribution DHT hash ring, and the lock request is sent to the primary storage node where the first copy is located for processing. For the EC storage pool, the first data shard is used as the primary storage node for processing. If the request is a block-level CAW lock request, the logical volume offset address and data block length specified in the lock request are converted into a lock request for the corresponding storage object. If the application lock request data block length spans multiple storage objects, the corresponding lock request is converted into lock requests for multiple storage objects. The lock request for each storage object calculates its respective storage distribution location in the data distribution DHT hash ring according to the storage object ID, and sends them to their respective primary storage nodes for processing. The application lock request returns success only when all the lock requests for storage objects are successfully processed. As long as one storage object lock request fails, the application lock request returns failure.
[0041] After receiving the lock request, the storage node will use the current storage cluster data distribution DHT hash algorithm to confirm whether the main storage node of the lock request is this node again. If it is not this node, the block access client will update the cluster view and try again. This avoids the main storage node that handles the lock changing after the distributed storage cluster status changes, causing the lock request to be executed in parallel on multiple storage nodes, destroying the mutual exclusivity and atomicity of the lock.
[0042] If the storage cluster status is changed, the data distribution DHT hash ring will be reconstructed according to the latest storage cluster status, and the block access client will resend the storage lock request to the new primary storage node for processing. In this process, the block access client waits for the storage lock request that has been sent to the old primary storage object to time out before retrying, avoiding the same lock request from being executed concurrently on different storage nodes, violating the atomicity of the lock and causing the lock to fail.
[0043] In a preferred embodiment, the private block device client interface layer also provides a PassThrough interface for PR / CAW SCSI instructions to the upper SCSI Target to be compatible with storage ATS locks that support closed-source operating systems such as VMWare. The block access client PBDX kernel driver provides a Passthrough interface for SCSI lock requests. In scenarios where heterogeneous support for SCSI PR / CAW locks is required, the SCSI Target that comes with the distributed storage system will add processing logic to check the block device type. If the underlying block device is PBDX, it will further query whether the block device supports the PR / CAW Passthrough interface. If it does, the lock request will be passed through to the block access client for processing. Otherwise, it will be processed by itself at the SCSI Target layer according to the original logic to ensure upgrade compatibility between new and old versions.
[0044] After receiving the lock request, the primary storage node will perform corresponding processing to feedback the lock processing result to the client. Different processing methods are used for different requests. Specifically, when the storage node receives a volume-level PR lock operation request, for a PR_IN request, it directly reads the storage volume metadata and returns the PR information in the volume metadata to the block access client; for a PR_OUT request, it first reads the volume metadata, performs corresponding permission checks, updates the volume metadata PR lock information according to the request, and persists it to the underlying storage medium of the distributed storage system; and synchronizes the volume PR lock information to all storage nodes in the distributed storage system, waits for all storage nodes to feedback the synchronization status, and then returns the result to the block access client; for the PR lock operation of the same volume, the storage node uses a node-level MUTEX mutex lock for protection to avoid concurrency problems of multiple block access clients. Different storage objects have different primary storage nodes, and the PR information must be synchronized to all storage nodes to ensure that all subsequent read and write requests after the PR request is completed can be access-controlled according to the latest PR information. After the synchronization is completed, the primary storage node returns the PR lock request result to the block access client. After processing the lock request, the storage node will set the type permissions based on the PR lock of the application storage volume and perform access control on read and write requests from different clients. If the corresponding client does not have the relevant PR permissions, its read and write access requests will be rejected.
[0045] refer to Figure 2 As shown in the figure, the process of storage node processing PR lock includes:
[0046] ① The primary storage node of the corresponding storage volume receives the PR request;
[0047] ② The storage node request processing thread first sets the MUTEX lock protection for the storage volume PR information. If the corresponding MUTEX lock is already occupied, the current PR request is added to the waiting queue of the MUTEX lock.
[0048] ③ The processing thread reads the volume PR metadata information from the IOS storage cluster. If the volume has a PR lock set, it checks whether the client of the current PR request has the permission to modify or read the PR information based on the PR lock information. If it does not have the permission, the PR request processing ends;
[0049] ④ If the client is the holder of the PR lock, reconfigure the PR lock according to the latest PR lock request type, and update and persist the volume PR metadata;
[0050] ⑤ After metadata persistence is successful, the processing thread synchronizes the PR lock information of the latest storage volume to all storage nodes through the storage cluster message pipeline and waits for the Ack message of all storage nodes; after receiving the PR synchronization information, other storage nodes complete the update of the PR information of the internal volume of the node and send ACK to the main storage node; during the asynchronous waiting period of the main storage node, cluster event monitoring is set. If a storage node offline event occurs during the PR synchronization process, the main storage node removes the abnormal storage node;
[0051] ⑥ The processing thread receives ACK messages from all normal storage nodes’ PR requests, releases the MUTEX lock on the corresponding storage volume’s PR information, and if there are any waiting PR requests in the waiting queue, puts the waiting PR requests into the execution queue for further processing;
[0052] ⑦The processing thread sends an ACK message with a PR lock processing success or error failure code to the client.
[0053] The main storage node receives a block-level CAW lock operation request for a storage object, builds a memory-level mutex lock for the storage area specified by the lock operation, and adds concurrent CAW lock operation requests for the same storage object to the waiting queue of the lock request being processed, waiting for the previous CAW lock operation request to be completed before processing, to ensure the atomicity of the CAW lock; the storage node reads the storage location data content corresponding to the CAW lock request from the underlying storage medium, and compares it with the expected data in the CAW lock request. If the content is consistent, the new data of the CAW lock request is written to the backend storage medium. If the content is inconsistent, the MISCOMPARE standard error return code is returned to the block access client. When the storage node receives a CAW lock request, it builds a data access MUTEX lock within the node based on the requested storage object ID and the data offset within the storage object, to avoid concurrency issues with multiple block access clients for the same storage area. Concurrent CAW lock requests for the same storage object but non-overlapping storage areas are not affected and can be processed concurrently.
[0054] refer to Figure 3 As shown, the process of a storage node processing a CAW block-level atomic lock request includes:
[0055] ① The primary storage node corresponding to the storage object receives the CAW request;
[0056] ② The storage node request processing thread sets the storage area lock according to the requested storage object, offset position and data length of the operation. If the corresponding storage object has a CAW request to set the storage area lock, the CAW request is placed in the waiting queue;
[0057] ③ The processing thread first reads the storage area data corresponding to the offset position of the CAW request from the storage cluster;
[0058] ④The processing thread performs memcmp on the read data and the expected data in the CAW request;
[0059] ⑤If the data is completely consistent, the processing thread writes the new write data in the CAW request to the offset position of the storage object corresponding to the CAW request, indicating that the CAW lock is successful; if the memcmp comparison data is inconsistent, it means that the CAW block atomic lock has been occupied;
[0060] ⑥ The processing thread completes the CAW request processing and releases the corresponding storage area lock. If there are subsequent CAW requests waiting in the waiting queue, the waiting CAW requests are placed in the request processing queue for further processing;
[0061] ⑦ The processing thread sends an ACK message to the block access client indicating that CAW locking is successful or MISCOMPARE locking fails.
[0062] If the above method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0063] Example 2
[0064] This embodiment provides a distributed block storage system, including a distributed storage cluster and multiple block device clients, the block device client includes a PBDX block driver with a built-in SCSI command parser, the SCSI command parser is used to receive and parse application lock instructions, and according to the pre-stored cluster status information of the distributed storage cluster, the application lock instruction is converted into a lock request for the corresponding offset position of the storage volume or storage object inside the distributed storage, and sent to the main storage node of the corresponding storage volume or storage object, after receiving the lock processing result fed back by the main storage node, it is judged whether the storage lock is successfully implemented according to the lock processing result; the distributed storage cluster includes a main storage node, which is used to receive the lock request and perform corresponding processing, generate a lock processing result, and feed it back to the block device client. Wherein, the lock processing result is a lock processing success or an error failure. When the lock processing result is a lock processing success, the main storage node performs access control on subsequent read and write requests from different clients for the same storage volume according to the latest configuration and permission settings of the lock.
[0065] In a preferred embodiment, the block device client further includes a PASSTHROUGH interface, which is used for forwarding to the PBDX block driver.
[0066] The rest is the same as in Example 1.
[0067] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for implementing storage lock in a distributed block storage system, characterized in that: The following steps are involved: Receive an application lock instruction, parse the application lock instruction, convert the application lock instruction into a lock request for a corresponding offset position of a storage volume or storage object within the distributed storage according to the pre-stored cluster status information of the distributed storage cluster, and send the lock request to the primary storage node of the corresponding storage volume or storage object; After receiving the lock processing result fed back by the primary storage node, judging whether the storage lock is successfully implemented according to the lock processing result; Among them, the lock processing result is lock processing success or error failure. When the lock processing result is lock processing success, the primary storage node performs access control on subsequent read and write requests from different clients for the same storage volume according to the latest configuration and permission settings of the lock.
2. The method for implementing storage lock in a distributed block storage system according to claim 1, characterized in that: The cluster status information includes mounted volume information and cluster view information.
3. The method for implementing storage lock in a distributed block storage system according to claim 1, characterized in that: The lock request is a volume-level PR lock request or a block-level CAW lock request.
4. The method for implementing storage lock in a distributed block storage system according to claim 3, characterized in that: The primary storage node is determined by using a distributed DHT hash algorithm according to the cluster status information.
5. The method for implementing storage lock in a distributed block storage system according to claim 4, characterized in that: The determination of the primary storage node is specifically as follows: If the lock request is a volume-level PR lock request, the storage object ID of the volume metadata is used to calculate the storage locations of all copies of the volume metadata object in the data distribution DHT hash ring, and the storage node where the first copy is located is used as the primary storage node for processing. For the EC storage pool, the first data shard is used as the primary storage node for processing; If the lock request is a block-level CAW lock request, the logical volume offset address and data block length specified in the lock request are converted into a lock request for the corresponding storage object. The lock request for each storage object calculates its own storage distribution position in the data distribution DHT hash ring according to the storage object ID, and the storage node corresponding to each storage distribution position serves as the main storage node for processing.
6. The method for implementing storage lock in a distributed block storage system according to claim 3, characterized in that: The process of the primary storage node feeding back the lock processing result includes: If a volume-level PR lock request is received, determine whether it is a PR_IN request. If so, read the storage volume metadata and generate a lock processing result based on the PR information in the volume metadata. If not, it is a PR_OUT request, read the volume metadata, update the volume metadata PR lock information according to the volume-level PR lock request, and persist it to the underlying storage medium of the distributed storage system, and synchronize the volume metadata PR lock information to all storage nodes of the distributed storage system. After waiting for all storage nodes to feedback the synchronization status, generate a lock processing result; Among them, for the PR lock operation of the same volume, the storage node uses the node-level MUTEX mutex lock for protection; If a block-level CAW lock request is received, a memory-level mutex lock is constructed for the storage area specified by the block-level CAW lock request, and concurrent block-level CAW lock requests for the same storage object are added to the lock request waiting queue being processed, waiting for the previous CAW lock operation to be completed before being processed; the storage location data content corresponding to the block-level CAW lock request is read from the underlying storage medium, and compared with the expected data in the block-level CAW lock request to determine whether the content is consistent, and a lock processing result is generated based on the determination result.
7. The method for implementing storage lock in a distributed block storage system according to claim 1, characterized in that: The lock request includes the client ID of the block access client that sends the lock request.
8. The method for implementing storage lock in a distributed block storage system according to claim 1, characterized in that: The method further includes: When the application lock instruction comes from a heterogeneous platform, the received application lock instruction is forwarded through a PASSTHROUGH interface and then parsed.
9. A distributed block storage system, characterized in that: It includes a distributed storage cluster and multiple block device clients, among which: The block device client includes a PBDX block driver with a built-in SCSI command parser, and the SCSI command parser is used to receive and parse the application lock instruction, and according to the cluster status information of the pre-stored distributed storage cluster, convert the application lock instruction into a lock request for the corresponding offset position of the storage volume or storage object inside the distributed storage, and send it to the primary storage node of the corresponding storage volume or storage object, and after receiving the lock processing result fed back by the primary storage node, determine whether the storage lock is successfully implemented according to the lock processing result; The distributed storage cluster includes a main storage node, which is used to receive the lock request and perform corresponding processing, generate a lock processing result, and feed it back to the block device client; Among them, the lock processing result is lock processing success or error failure. When the lock processing result is lock processing success, the primary storage node performs access control on subsequent read and write requests from different clients for the same storage volume according to the latest configuration and permission settings of the lock.
10. The distributed block storage system according to claim 9, characterized in that: The block device client also includes a PASSTHROUGH interface, which is used to forward to the PBDX block driver.
