Dual-active storage difference data recording method and system based on difference bitmap

By using differential bitmap recording and synchronizing differential data in the dual-active storage architecture, the problems of high synchronization complexity, volatile memory space occupation and inter-device disk recovery in the prior art are solved, and simplified differential data recording and efficient data consistency guarantees are achieved.

CN120011151APending Publication Date: 2025-05-16TOYOU FEIJI ELECTRONICS
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510111057.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing dual-active storage architecture is highly complex during synchronization, requires volatile memory space, and cannot recover in scenarios where disks are interchangeable between devices.

Method used

The dual-live storage differential data recording method based on the differential bitmap is adopted. By allocating two differential bitmap spaces in the physical partition of the dual-live volume disk, marking it when a write request is received, and modifying the differential bitmap after it falls, the persistent recording and synchronization of the differential data is achieved.

Benefits of technology

The differential data recording method between dual-active storage arrays is simplified, ensuring that the data of dual-active storage sites is consistent, and it can accurately recover in scenarios such as abnormal shutdown and power down of the storage array, and avoiding additional volatile memory space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011151A_ABST
    Figure CN120011151A_ABST
Patent Text Reader

Abstract

The invention discloses an active-active storage difference data recording method and system based on a difference bitmap, and the method comprises the steps: receiving a write request initiated by a service cluster, and determining a currently used difference bitmap; according to the positions of the difference bitmaps, two difference bitmap spaces are respectively allocated from a physical partition of the dual-active volume disk in advance when the dual-active relation is created; calculating the initial position of the write request in the difference bitmap and the bit number of the write request IO length required to be recorded in the difference bitmap, and setting the bit number at the corresponding position in the currently used difference bitmap as dirty; according to the write request, executing a dual-active master-slave site storage array disk falling operation; and after judging that the use time of the currently used difference bitmap exceeds a preset time or when the ratio of the record dity bit of the currently used difference bitmap exceeds a preset threshold value, switching the currently used difference bitmap to another difference bitmap. According to the invention, the data consistency of the active-active storage sites can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and in particular to a method and system for recording differential data of active-active dual storage. Background Art

[0002] Since the beginning of the 21st century, with the rise of the Internet of Things and big data, today's society is entering the era of information technology and big data. In the context of this era, while it brings us convenience, it also brings many challenges. With the continuous increase in the scale of data storage, how to ensure the security and efficiency of data storage is a common problem faced by the storage industry.

[0003] Active-active storage technology is a new type of disaster recovery and backup technology. It means that there are two or more active data centers in a storage system at the same time, and each data center can process requests and perform operations. This architecture ensures that data is synchronized between different data centers, and when one of the data centers fails, it can quickly switch to other data centers to ensure service continuity. The active-active storage architecture usually consists of two data centers that are close to each other and connected by a high-speed network. Each data center has a storage gateway and an underlying storage array. When the host sends a read or write request, the request is sent to any storage gateway, and then the gateway mirrors the request to another storage gateway, thereby achieving real-time replication and synchronization of data. When one of the data centers fails, it can quickly switch to another data center to ensure business continuity.

[0004] Current Active-Active (AA) storage solutions, such as Figure 1 As shown in the figure, two sets of storage arrays are usually used to form a cross-site active-active cluster. Two volumes of the same size in the storage arrays at both ends can form an active-active volume. The data of the active-active volume is synchronized in real time, and both ends can process the read and write requests of the application server at the same time, providing the application server with the same AA parallel access capability. When any end fails, the business can automatically and seamlessly switch to the storage access of the other end, and the business access is not interrupted.

[0005] However, how to ensure the consistency of data in the two data centers is a key point in the storage active-active architecture. The current mainstream solution is to achieve data consistency between the two storage arrays through differential data recording and differential synchronization. Active-active differential recording is to mark the business write operations that have not been synchronized. Common marking methods include snapshots, log records, and DCL mechanism records. The snapshot method is to take snapshots of the active-active volume of the site regularly, record the change in the storage volume data within a time slice, and then compare the difference data between the two snapshots; log records are to save the business data address information to a memory space with power-off protection when receiving a business write operation. When the write request of the storage array on either end fails, the log record is converted into a differential bitmap table and written to the logical volume; DCL mechanism, when a data center fails, DCL can record the data changes in the data center during business operation. After the failure is restored, the change data is tracked and synchronized to the storage device of the data center, so as to prevent data from being missed during the synchronization process. This differential data recording method ensures that when the primary storage array fails, the business can continue to be carried out on the backup storage array, and at the same time, the consistency and integrity of the data are ensured by recording differential data.

[0006] In the prior art, there are two commonly used methods:

[0007] The first type is that after the dual-end storage completes the initialization synchronization, the source storage takes a snapshot at a certain interval, compares and records the difference data between two similar snapshots, and splits the difference data into multiple IO stream segments, which are synchronized to the remote storage array for update;

[0008] The second type records the business write request in the LOG first. If the write fails on either end, the LOG is converted into a DCL (Data Change log) and written into the logical volume.

[0009] However, in the first category, in the active-active storage architecture, the difference data recording method cannot be persisted. In the case of abnormal shutdown of the storage array, power failure, etc., the two storage arrays are prone to data inconsistency. The difference data comparison and synchronization rely on snapshots, which increases the complexity and uncontrollable factors of active-active difference data comparison and synchronization. In the second category, the log is converted to dcl and written to the logical volume only in the event of failure. This mechanism requires additional volatile memory space and is not directly recorded in the logical volume. In the scenario of exchanging disks between devices, the difference data of the active-active volume cannot be converted from log records to dcl, and thus cannot be recovered. Summary of the invention

[0010] Based on this, in order to solve the above technical problems, a dual-active storage difference data recording method and system based on difference bitmap is provided to solve the complexity of synchronization in the existing technology, the need to occupy volatile memory space, and the problem of being unable to recover in the scenario of exchanging disks between devices.

[0011] In a first aspect, a method for recording active-active storage difference data based on a difference bitmap is provided, the method comprising:

[0012] Receive a write request initiated by the business cluster, determine the difference bitmap currently in use according to the bitmap selection flag in the difference record structure member in the logical volume object, and increase the number of write requests recorded in the difference bitmap currently in use by 1; the location of the difference bitmap is that when creating the active-active relationship, two difference bitmap spaces are pre-allocated from the physical partitions of the active-active volume disk;

[0013] Perform an offset operation according to the write request logical block address, calculate the starting position of the write request in the difference bitmap and the number of bits required for the write request I0 length to be recorded in the difference bitmap, and encapsulate them into a write state machine control block object, and put them into the write state machine scheduling queue;

[0014] Scheduling the write state machine control object in the write state machine scheduling queue, according to the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of the record required in the difference bitmap, the corresponding position in the difference bitmap currently being used is dirty;

[0015] Execute a write operation on the storage array of the active-active master site according to the write request, and synchronize the write request to the active-active slave site gateway to perform a write operation on the storage array of the active-active slave site; after both the active-active master site storage array and the active-active slave site storage array have successfully written to disk, reduce the number of write requests recorded in the difference bitmap currently in use by 1;

[0016] The master dual-volume storage array and the slave dual-volume storage array are differentially synchronized according to the differential bitmap currently in use; and after determining that the number of write requests for the differential bitmap currently in use is 0, after the usage time of the differential bitmap currently in use exceeds a preset time or the proportion of dirty bits recorded in the differential bitmap currently in use exceeds a preset threshold, the differential bitmap currently in use is switched to another one.

[0017] In the above scheme, optionally, after switching the difference bitmap currently in use to another one, it also includes: when the switch is successful, resetting the difference bitmap before the switch; the resetting includes: resetting all dirty bits of the difference bitmap before the switch, and reinitializing the metadata record of the difference bitmap before the switch; the metadata includes: the time when the bitmap starts recording the difference bits, the bitmap flag, the number of bits that are 1, the number of write tasks waiting to be completed, and the sequence number of the write tasks waiting to be completed.

[0018] In the above scheme, further optionally, when creating a dual-active relationship, after pre-allocating two difference bitmap spaces from the physical partitions of the dual-active volume disk, it also includes: judging whether the primary dual-volume storage array and the secondary dual-volume storage array already have data, if so, filling the difference bitmap with all 1s, if not, filling the difference bitmap with 0s.

[0019] In the above scheme, optionally, when creating a dual-active relationship, after pre-allocating two difference bitmap spaces from the physical partitions of the dual-active volume disk, it also includes: judging whether the primary dual-volume storage array and the secondary dual-volume storage array already have data, if so, filling the difference bitmap with all 1s, if not, filling the difference bitmap with 0s.

[0020] In the above scheme, optionally, after scheduling the write state machine control object in the write state machine scheduling queue, it also includes: obtaining the corresponding stripe cache according to the starting position of the write request in the difference bitmap and the required number of record bits, and applying write lock protection to the logical blocks in the stripe cache that need to be set dirty.

[0021] In the above scheme, further optionally, the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of records required in the difference bitmap, and the corresponding position in the difference bitmap currently in use is dirty, including: formatting the stripe cache as a long integer array, and judging whether the corresponding bit in the long integer variable in the difference bitmap currently in use has been set to a dirty bit according to the starting position of the write request in the difference bitmap and the number of bits of records required in the difference bitmap; if it has been set to dirty, the currently used difference bitmap is not operated; if it has not been set, the corresponding position is set to dirty.

[0022] In the above scheme, further optionally, the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of the record required in the difference bitmap are further included after the corresponding position in the difference bitmap currently being used is dirty:

[0023] The difference bitmap currently in use is written to the disk, and the write lock protection on the stripe is released.

[0024] In a second aspect, a dual-active storage difference data recording system based on a difference bitmap, the system comprising:

[0025] The difference bitmap determination module is used to receive a write request initiated by a business cluster, determine the difference bitmap currently in use according to the bitmap selection flag in the difference record structure member in the logical volume object, and increase the number of write requests recorded in the difference bitmap currently in use by 1; the location of the difference bitmap is to allocate two difference bitmap spaces in advance from the physical partitions of the active-active volume disk when creating an active-active relationship;

[0026] Calculation module: used to perform offset operation according to the write request logical block address, calculate the starting position of the write request in the difference bitmap and the number of bits required for the write request I0 length to be recorded in the difference bitmap, and encapsulate it into a write state machine control block object, and put it into the write state machine scheduling queue;

[0027] The difference bitmap dirty module is used to schedule the write state machine control object in the write state machine scheduling queue, and the corresponding position in the difference bitmap currently in use is dirty according to the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of the record required in the difference bitmap;

[0028] The disk placement module is used to perform a disk placement operation on the active-active master site storage array according to the write request, and synchronize the write request to the active-active slave site gateway to perform a disk placement operation on the active-active slave site storage array; after both the active-active master site storage array and the active-active slave site storage array have successfully placed the data on disk, the number of write requests recorded in the difference bitmap currently in use is reduced by 1;

[0029] The difference bitmap switching module is used to perform difference synchronization on the master dual-volume storage array and the slave dual-volume storage array according to the difference bitmap currently in use; and when it is determined that the use time of the difference bitmap currently in use exceeds a preset time or the proportion of dirty bits recorded in the difference bitmap currently in use exceeds a preset threshold, the difference bitmap currently in use is switched to another one.

[0030] In a third aspect, a computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for recording active-active storage difference data based on a difference bitmap described in the first aspect are implemented.

[0031] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for recording difference data of active-active storage based on a difference bitmap described in the first aspect are implemented.

[0032] This application has at least the following beneficial effects:

[0033] The present application allocates two difference bitmap spaces in the physical partition of the dual-active volume disk, and then when a write request is received, it is first marked in the difference bitmap space, and then the dual-active volume is written to the disk, and then the difference bitmap space is modified according to the writing situation. At the same time, when the use time of the difference bitmap in use exceeds the preset time or the proportion of dirty bits recorded in the difference bitmap currently in use exceeds the preset threshold, the difference bitmap currently in use is switched to another one. This simplifies the difference data recording method between the dual-active storage arrays, ensures the consistency of data in the dual-active storage sites, and can effectively ensure that in special scenarios such as shutdown, power failure, restart, abnormal crash, and replacement of the frame of a single storage array, the data of the two storage arrays in the dual-active are consistent after the storage array is restored. At the same time, the difference bitmap is modified according to the result returned by the writing, which simplifies the synchronization method of the difference bitmap. Moreover, since the difference bitmap is in the physical partition of the dual-active volume disk, it does not need to occupy additional volatile internal space. There is no need to convert the log record to dcl, so in the scenario of exchanging disks between devices, accurate recovery can also be performed. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a schematic diagram of the existing active-active storage solution;

[0035] Figure 2 It is a flow chart of data synchronization by recording LOG and converting LOG into DCL in the prior art;

[0036] Figure 3 The present invention is a schematic diagram of a specific process of a method for recording difference data in active-active storage based on a difference bitmap in one embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0038] like Figure 2 As shown, it is a flow chart of the prior art that synchronizes data by recording LOG and converting LOG into DCL. The specific steps include the following:

[0039] The host sends a write I / O request to the active-active management module (HM);

[0040] HM records the write I / O request in the LOG;

[0041] The HM performs a dual write operation, writing I / O to the local and remote caches;

[0042] After the local and remote caches complete the write I / O, they return the write I / O results to the HM.

[0043] After both caches return the structure, the write I / O result is returned to the host.

[0044] 1. If the cache on both ends is written successfully, a write success message is returned to the host and the LOG is cleared;

[0045] 2. If a write fails on either end, the HM will convert the LOG into a DCL (difference bitmap) to record the difference data between the local LUN and the remote LUN.

[0046] When the device is repaired, the different data is synchronized according to DCL. After the synchronization is completed, DCL is cleared and the active-active mode is restored.

[0047] In one embodiment, Figure 3 As shown, a method for recording active-active storage difference data based on a difference bitmap is provided, the method comprising:

[0048] Step S1: Receive a write request initiated by a business cluster, determine the difference bitmap currently in use based on the bitmap selection flag in the difference record structure member in the logical volume object, and increase the number of write requests recorded in the difference bitmap currently in use by 1; the location of the difference bitmap is when creating a dual-active relationship, and two difference bitmap spaces are pre-allocated from the physical partitions of the dual-active volume disk.

[0049] In step S1, according to the capacity of the dual-active volume and the size of the original volume data recorded in a single bit (the default is to record a 16M data block in a bit), calculate how many bits are needed for the dual-active volume, and then apply for the corresponding memory space. If it is formatted as a long integer array, a long integer variable of 8 bytes, 64 bits, can record a volume of 64*16=1024M. When writing io to set the dirty bit, the corresponding bit position is set to 1.

[0050] When creating a hyperactive relationship, allocate two sizes of difference bitmap space from the physical partition of the hyperactive volume disk, such as 1M, set a single bit to record the difference data range, and initialize it. If the volume is in use and has business data, fill the difference bitmap with all 1s; if there is no business data, fill it with all 0s.

[0051] After the business cluster initiates a write request, the active-active storage array master site receives the write request. The master site detects that the write request belongs to the active-active volume and enters the DCL processing module to record the difference data.

[0052] Enter the dcl difference bitmap processing logic. First, according to the bitmap selection flag in the difference record structure member of the logical volume object, obtain the difference bitmap object currently in use, assign a difference record sequence number to the write request, and record it in the difference record sequence number linked list in the difference record structure member to avoid difference record conflicts. And increase the number of write requests recorded in the current difference bitmap metadata.

[0053] Step S2: Perform an offset operation based on the write request logical block address to calculate the starting position of the write request in the difference bitmap and the number of bits required to record the write request I0 length in the difference bitmap, and encapsulate it into a write state machine control block object and put it into the write state machine scheduling queue.

[0054] In step S2, an offset operation is performed based on the write request logical block address to calculate the starting position of the write request in the difference bitmap, and the number of write requests that need to set the dirty bit (set the bit position to 1) in the difference bitmap is calculated based on the write request IO length. Then, the write state machine control block object is encapsulated based on the starting position of the difference bitmap and the number of dirty bits set, and is placed in the dcl write state machine scheduling queue.

[0055] Step S3: Schedule the write state machine control object in the write state machine scheduling queue, and according to the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits required for the record in the difference bitmap, the corresponding position in the difference bitmap currently in use is dirty.

[0056] In step S3, specifically: after the dcl write state machine is dispatched to the difference bitmap record state machine control block object, it obtains the corresponding stripe cache according to the difference bitmap starting position, and applies write lock protection to the lba (logical block) in the stripe that needs to be set to dirty to avoid write conflicts during the difference recording process, and then formats the stripe cache into a long integer array, and determines whether the corresponding bit in the 64-bit long integer variable of the difference bitmap has been set to the dirty bit according to the difference bitmap starting position and the number of dirty bits. If it has been set to dirty, it means that the difference recording of this segment of data has been completed, then exit the current difference bitmap write state machine, and write the write io data to the disk. If it is not set, the corresponding position is set to dirty.

[0057] Step S4: Execute the disk write operation of the active-active master site storage array according to the write request, and synchronize the write request to the active-active slave site gateway to perform the disk write operation on the active-active slave site storage array; after the disk write operation of both the active-active master site storage array and the active-active slave site storage array is successfully completed, reduce the number of write requests recorded in the difference bitmap currently in use by 1.

[0058] In step S4, after the dirty bit of the difference bitmap is set, the difference bitmap is written to the disk. For a direct write volume, it is written directly to the physical partition of the disk. After the disk is written, the stripe write lock is released and the data is returned. For a write-back volume, the stripe write lock is released and the data is returned after the dirty bit is set. The cache management module executes the cache flushing and disk writing action.

[0059] Step S5: performing differential synchronization on the master dual-volume storage array and the slave dual-volume storage array according to the differential bitmap currently in use; and after determining that the number of write requests for the differential bitmap currently in use is 0, after the usage time of the differential bitmap currently in use exceeds a preset time, or when the proportion of dirty bits recorded in the differential bitmap currently in use exceeds a preset threshold, switching the differential bitmap currently in use to another one.

[0060] In step S5, in the callback function, it is determined whether the difference bitmap needs to be switched based on the metadata of the current bitmap difference record. When the bitmap has been used for more than 10 minutes, or the number of dirty bits recorded in the current difference bitmap exceeds 25% of the total (the time and threshold can be dynamically adjusted when creating the active-active volume, with the default settings of 10 minutes and 25%), or the active-active volume has just completed difference synchronization, a difference bitmap switching operation is performed, the difference bitmap selection flag in the difference record structure member in the logical volume object is set, the difference bitmap start recording timestamp is updated, and when the next write operation performs difference recording, another difference bitmap is selected for recording.

[0061] In the above-mentioned method for recording differential data of active-active storage based on differential bitmap, two differential bitmap spaces are allocated in the physical partition of the active-active volume disk, and then when a write request is received, it is first marked in the differential bitmap space, and then the active-active volume is written to the disk, and then the differential bitmap space is modified according to the writing situation. At the same time, when the use time of the differential bitmap in use exceeds the preset time or the proportion of dirty bits recorded in the differential bitmap currently in use exceeds the preset threshold, the differential bitmap currently in use is switched to another one. This simplifies the differential data recording method between active-active storage arrays, ensures the consistency of data at active-active storage sites, and can effectively ensure that in special scenarios such as shutdown, power failure, restart, abnormal crash, replacement of machine frame, etc. of a single storage array, after the storage array is restored, the data of the two active-active storage arrays are consistent. At the same time, the differential bitmap is modified according to the result returned by the writing, which simplifies the synchronization method of the differential bitmap. Moreover, since the differential bitmap is in the physical partition of the active-active volume disk, no additional volatile internal space is required. There is no need to convert log records to dcl, so accurate recovery can be performed even when disks are swapped between devices.

[0062] In one embodiment, switching the currently used difference bitmap to another one also includes: when the switch is successful, resetting the difference bitmap before the switch; the resetting includes: resetting all dirty bits of the difference bitmap before the switch, and reinitializing the metadata record of the difference bitmap before the switch; the metadata includes: the time when the bitmap starts recording the difference bits, the bitmap flag, the number of bits that are 1, the number of write tasks waiting to be completed, and the sequence number of the write tasks waiting to be completed.

[0063] After the difference bitmap record is completed, the host write request is executed and the data is synchronized to the storage array of the active-active slave site. After both storage sites are successfully written to disk, the business write request completion callback function is executed. In the business write request completion callback function, the difference bitmap record number of write requests is released. When the number of write requests waiting to be completed recorded in the difference bitmap metadata is 0, and the bitmap has been switched, it means that the difference bitmap record io is synchronized to the opposite storage array and the disk is successfully written and the bitmap is no longer used. In this case, the difference bitmap can be cleared, the metadata record of the difference bitmap can be reinitialized, and all dirty bits of the difference bitmap can be reset, and the difference bitmap metadata and difference bitmap revisions can be written to the disk.

[0064] In one embodiment, when creating an active-active relationship, after pre-allocating two difference bitmap spaces from the active-active volume disk physical partitions, the method further includes: determining whether the primary dual-volume storage array and the secondary dual-volume storage array already have data; if so, filling the difference bitmap with all 1s; if not, filling the difference bitmap with 0s.

[0065] In one embodiment, the receiving of a write request initiated by a business cluster, after determining the difference bitmap currently in use based on a bitmap selection flag in a difference record structure member in a logical volume object, also includes: allocating a difference record sequence number to the write request and recording it in a difference record sequence number linked list in the difference record structure member.

[0066] In one embodiment, scheduling the write state machine control object in the write state machine scheduling queue also includes: obtaining the corresponding stripe cache according to the starting position of the write request in the difference bitmap and the required number of record bits, and applying write lock protection to the logical blocks in the stripe cache that need to be set dirty.

[0067] In one embodiment, the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of records required in the difference bitmap, and the corresponding position in the difference bitmap currently in use is dirty include: formatting the stripe cache as a long integer array, and judging whether the corresponding bit in the long integer variable in the difference bitmap currently in use has been set to a dirty bit according to the starting position of the write request in the difference bitmap and the number of bits of records required in the difference bitmap; if it has been set to dirty, the currently used difference bitmap is not operated; if it has not been set, the corresponding position is set to dirty.

[0068] In one embodiment, the control block object according to the write state machine further includes: after the starting position of the write request in the difference bitmap and the number of bits of the record required in the difference bitmap in the current difference bitmap is dirty:

[0069] The difference bitmap currently in use is written to the disk, and the write lock protection on the stripe is released.

[0070] In one embodiment, a dual-active storage difference data recording system based on a difference bitmap is provided, the system comprising:

[0071] The difference bitmap determination module is used to receive a write request initiated by a business cluster, determine the difference bitmap currently in use according to the bitmap selection flag in the difference record structure member in the logical volume object, and increase the number of write requests recorded in the difference bitmap currently in use by 1; the location of the difference bitmap is to allocate two difference bitmap spaces in advance from the physical partitions of the active-active volume disk when creating an active-active relationship;

[0072] Calculation module: used to perform offset operation according to the write request logical block address, calculate the starting position of the write request in the difference bitmap and the number of bits required for the write request I0 length to be recorded in the difference bitmap, and encapsulate it into a write state machine control block object, and put it into the write state machine scheduling queue;

[0073] The difference bitmap dirty module is used to schedule the write state machine control object in the write state machine scheduling queue, and the corresponding position in the difference bitmap currently in use is dirty according to the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of the record required in the difference bitmap;

[0074] The disk placement module is used to perform a disk placement operation on the active-active master site storage array according to the write request, and synchronize the write request to the active-active slave site gateway to perform a disk placement operation on the active-active slave site storage array; after both the active-active master site storage array and the active-active slave site storage array have successfully placed the data on disk, the number of write requests recorded in the difference bitmap currently in use is reduced by 1;

[0075] The difference bitmap switching module is used to perform difference synchronization on the master dual-volume storage array and the slave dual-volume storage array according to the difference bitmap currently in use; and when it is determined that the use time of the difference bitmap currently in use exceeds a preset time or the proportion of dirty bits recorded in the difference bitmap currently in use exceeds a preset threshold, the difference bitmap currently in use is switched to another one.

[0076] For the specific definition of a dual-active storage difference data recording system based on a difference bitmap, please refer to the definition of a dual-active storage difference data recording method based on a difference bitmap above, which will not be repeated here. Each module in the above-mentioned dual-active storage difference data recording system based on a difference bitmap can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0077] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the above-mentioned active-active storage difference data recording method based on a difference bitmap is implemented.

[0078] In one embodiment, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, involves all or part of the process in the above-mentioned embodiment method.

[0079] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0080] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0081] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for recording difference data in active-active storage based on a difference bitmap, characterized in that: The method comprises: Receive a write request initiated by the business cluster, determine the difference bitmap currently in use according to the bitmap selection flag in the difference record structure member in the logical volume object, and increase the number of write requests recorded in the difference bitmap currently in use by 1; the location of the difference bitmap is that when creating the active-active relationship, two difference bitmap spaces are pre-allocated from the physical partitions of the active-active volume disk; Perform an offset operation according to the write request logical block address, calculate the starting position of the write request in the difference bitmap and the number of bits required for the write request I0 length to be recorded in the difference bitmap, and encapsulate them into a write state machine control block object, and put them into the write state machine scheduling queue; Scheduling the write state machine control object in the write state machine scheduling queue, according to the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of the record required in the difference bitmap, the corresponding position in the difference bitmap currently being used is dirty; Execute a write operation on the storage array of the active-active master site according to the write request, and synchronize the write request to the active-active slave site gateway to perform a write operation on the storage array of the active-active slave site; after both the active-active master site storage array and the active-active slave site storage array have successfully written to disk, reduce the number of write requests recorded in the difference bitmap currently in use by 1; The master dual-volume storage array and the slave dual-volume storage array are differentially synchronized according to the differential bitmap currently in use; and after determining that the number of write requests for the differential bitmap currently in use is 0, after the usage time of the differential bitmap currently in use exceeds a preset time or the proportion of dirty bits recorded in the differential bitmap currently in use exceeds a preset threshold, the differential bitmap currently in use is switched to another one.

2. The method for recording active-active storage difference data based on difference bitmap according to claim 1, characterized in that: After switching the difference bitmap currently in use to another one, it also includes: when the switch is successful, resetting the difference bitmap before the switch; the resetting includes: resetting all dirty bits of the difference bitmap before the switch, and reinitializing the metadata record of the difference bitmap before the switch; the metadata includes: the time when the bitmap starts recording the difference bits, the bitmap flag, the number of bits that are 1, the number of write tasks waiting to be completed, and the sequence number of the write tasks waiting to be completed.

3. The method for recording active-active storage difference data based on difference bitmap according to claim 2, characterized in that: When creating a dual-active relationship, after pre-allocating two difference bitmap spaces from the dual-active volume disk physical partitions, it also includes: judging whether the primary dual-volume storage array and the secondary dual-volume storage array already have data, if so, filling the difference bitmap with all 1s, if not, filling the difference bitmap with 0s.

4. The method for recording active-active storage difference data based on difference bitmap according to claim 1, characterized in that: The receiving of the write request initiated by the business cluster and determining the difference bitmap currently in use according to the bitmap selection flag in the difference record structure member in the logical volume object also include: allocating a difference record serial number for the write request and recording it in the difference record serial number linked list in the difference record structure member.

5. The method for recording active-active storage difference data based on difference bitmap according to claim 1, characterized in that: After scheduling the write state machine control object in the write state machine scheduling queue, it also includes: obtaining the corresponding stripe cache according to the starting position of the write request in the difference bitmap and the required number of record bits, and applying write lock protection to the logical blocks that need to be set dirty in the stripe cache.

6. The method for recording active-active storage difference data based on difference bitmap according to claim 5, characterized in that: The controlling block object according to the write state machine determines that the starting position of the write request in the difference bitmap and the number of bits of records required in the difference bitmap are dirty at the corresponding position in the difference bitmap currently in use, including: formatting the stripe cache as a long integer array, and judging whether the corresponding bit in the long integer variable in the difference bitmap currently in use has been set to a dirty bit according to the starting position of the write request in the difference bitmap and the number of bits of records required in the difference bitmap; if it has been set to a dirty bit, the difference bitmap currently in use is not operated; if it has not been set, the corresponding position is set to a dirty bit.

7. The method for recording active-active storage difference data based on difference bitmap according to claim 5, characterized in that: The control block object according to the write state machine further includes: after the starting position of the write request in the difference bitmap and the number of bits of the record required in the difference bitmap in the corresponding position of the difference bitmap currently being used is dirty: The difference bitmap currently in use is written to the disk, and the write lock protection on the stripe is released.

8. A dual-active storage difference data recording system based on difference bitmap, characterized in that: The system comprises: The difference bitmap determination module is used to receive a write request initiated by a business cluster, determine the difference bitmap currently in use according to the bitmap selection flag in the difference record structure member in the logical volume object, and increase the number of write requests recorded in the difference bitmap currently in use by 1; the location of the difference bitmap is to allocate two difference bitmap spaces in advance from the physical partitions of the active-active volume disk when creating an active-active relationship; Calculation module: used to perform offset operation according to the write request logical block address, calculate the starting position of the write request in the difference bitmap and the number of bits required for the write request I0 length to be recorded in the difference bitmap, and encapsulate it into a write state machine control block object, and put it into the write state machine scheduling queue; The difference bitmap dirty module is used to schedule the write state machine control object in the write state machine scheduling queue, and the corresponding position in the difference bitmap currently in use is dirty according to the starting position of the write request in the write state machine control block object in the difference bitmap and the number of bits of the record required in the difference bitmap; The disk placement module is used to perform a disk placement operation on the active-active master site storage array according to the write request, and synchronize the write request to the active-active slave site gateway to perform a disk placement operation on the active-active slave site storage array; after both the active-active master site storage array and the active-active slave site storage array have successfully placed the data on disk, the number of write requests recorded in the difference bitmap currently in use is reduced by 1; The difference bitmap switching module is used to perform difference synchronization on the master dual-volume storage array and the slave dual-volume storage array according to the difference bitmap currently in use; and when it is determined that the use time of the difference bitmap currently in use exceeds a preset time or the proportion of dirty bits recorded in the difference bitmap currently in use exceeds a preset threshold, the difference bitmap currently in use is switched to another one.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Storage space monitoring method and device and electronic equipment

    CN122412246A